Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/purchase-workflow (18.0) #1696

Merged
merged 26 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b5666bb
Adds purchase_analytic_global,
guewen Sep 1, 2014
8154608
Add translations for purchase_analytic_global
guewen Sep 1, 2014
2e77ce2
[9.0][PORT] purchase_analytic_global
yvaucher May 10, 2016
1b3a7b8
Replace <openerp> by <odoo>
yvaucher Aug 19, 2016
221dc54
[MIG][REF] 12.0 purchase_analytic_global
Nov 26, 2019
7853621
[MIG] Migrated the module purchase_analytic_global to v13.
sudhir-erpharbor Feb 26, 2020
9b5b466
[ADD] Added test case for purchase_analytic_global and improved the c…
sudhir-erpharbor Feb 26, 2020
c4469d4
[14.0][MIG] purchase_analytic_global: Migration to 14.0
Dec 27, 2021
2c1f4e2
[IMP] purchase_analytic_global: black, isort, prettier
yankinmax May 4, 2022
73a6ebc
[MIG] purchase_analytic_global: Migration to 15.0
yankinmax May 4, 2022
732029d
[FIX] purchase_analytic_global: different analytic accounts are not r…
yankinmax Oct 18, 2022
99a6b03
purchase_analytic_global 15.0.1.0.1
OCA-git-bot Oct 20, 2022
5f0c6b0
Added translation using Weblate (Spanish)
Ivorra78 Jul 18, 2023
7bfad31
Translated using Weblate (Spanish)
Ivorra78 Jul 18, 2023
61dceaf
[IMP] purchase_analytic_global: pre-commit auto fixes
yankinmax Feb 12, 2025
24b5c38
[MIG] purchase_analytic_global: Migration to 18.0
yankinmax Jan 6, 2025
9390faa
purchase_exception: replace old tree node by list node
Ricardoalso Feb 26, 2025
6977ad0
purchase_invoice_plan: replace old tree node by list node
Ricardoalso Feb 26, 2025
77c74cb
Merge PR #2558 into 18.0
OCA-git-bot Mar 3, 2025
f46ca62
[UPD] Update purchase_analytic_global.pot
Mar 3, 2025
95b3200
[BOT] post-merge updates
OCA-git-bot Mar 3, 2025
4071254
Merge PR #2584 into 18.0
OCA-git-bot Mar 3, 2025
74a5685
[BOT] post-merge updates
OCA-git-bot Mar 3, 2025
8cafad3
Merge PR #2583 into 18.0
OCA-git-bot Mar 3, 2025
b36cd2d
[BOT] post-merge updates
OCA-git-bot Mar 3, 2025
d566efe
Translated using Weblate (Italian)
mymage Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[purchase_all_shipments](purchase_all_shipments/) | 18.0.1.0.0 | | Purchase All Shipments
[purchase_analytic_global](purchase_analytic_global/) | 18.0.1.0.0 | | Purchase - Analytic Account Global
[purchase_cancel_reason](purchase_cancel_reason/) | 18.0.1.0.0 | | Purchase Cancel Reason
[purchase_commercial_partner](purchase_commercial_partner/) | 18.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Add stored related field 'Commercial Supplier' on POs
[purchase_delivery_split_date](purchase_delivery_split_date/) | 18.0.1.0.0 | | Allows Purchase Order you confirm to generate one Incoming Shipment for each expected date indicated in the Purchase Order Lines
[purchase_deposit](purchase_deposit/) | 18.0.1.0.0 | | Option to create deposit from purchase order
[purchase_exception](purchase_exception/) | 18.0.1.0.0 | | Custom exceptions on purchase order
[purchase_exception](purchase_exception/) | 18.0.1.0.1 | | Custom exceptions on purchase order
[purchase_force_invoiced](purchase_force_invoiced/) | 18.0.1.0.0 | | Allows to force the billing status of the purchase order to "Invoiced"
[purchase_invoice_plan](purchase_invoice_plan/) | 18.0.1.0.0 | [![kittiu](https://github.com/kittiu.png?size=30px)](https://github.com/kittiu) | Add to purchases order, ability to manage future invoice plan
[purchase_invoice_plan](purchase_invoice_plan/) | 18.0.1.0.1 | [![kittiu](https://github.com/kittiu.png?size=30px)](https://github.com/kittiu) | Add to purchases order, ability to manage future invoice plan
[purchase_last_price_info](purchase_last_price_info/) | 18.0.1.0.0 | [![LoisRForgeFlow](https://github.com/LoisRForgeFlow.png?size=30px)](https://github.com/LoisRForgeFlow) | Purchase Product Last Price Info
[purchase_open_qty](purchase_open_qty/) | 18.0.1.0.0 | | Allows to identify the purchase orders that have quantities pending to invoice or to receive.
[purchase_order_archive](purchase_order_archive/) | 18.0.1.0.0 | | Archive Purchase Orders
Expand Down
96 changes: 96 additions & 0 deletions purchase_analytic_global/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
==================================
Purchase - Analytic Account Global
==================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a0f9dc4b6ce66852de767aeebef547d00a60f696a4755da649c0e488c2ff34c3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_analytic_global
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_analytic_global
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds an analytic account on the purchases that is applied on
all the lines distributions.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_analytic_global%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp

Contributors
------------

- `Camptocamp <https://camptocamp.com>`__:

- Guewen Baconnier <[email protected]>
- Yannick Vaucher <[email protected]>
- Iryna Vyshnevska <[email protected]>
- Maksym Yankin <[email protected]>

- `ERP Harbor <https://erpharbor.com>`__:

- Sudhir Arya <[email protected]>

- `Trobz <https://trobz.com>`__:

- Phuc Tran <[email protected]>

Other credits
-------------

The migration of this module from 15.0 to 18.0 was financially supported
by Camptocamp

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_analytic_global>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions purchase_analytic_global/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions purchase_analytic_global/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2014-2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "Purchase - Analytic Account Global",
"version": "18.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"maintainer": "Camptocamp",
"license": "AGPL-3",
"category": "Purchase Management",
"complexity": "easy",
"depends": ["purchase"],
"website": "https://github.com/OCA/purchase-workflow",
"data": ["views/purchase_order.xml"],
"installable": True,
"auto_install": False,
}
36 changes: 36 additions & 0 deletions purchase_analytic_global/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic_global
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-18 18:08+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: purchase_analytic_global
#: model:ir.model.fields,field_description:purchase_analytic_global.field_purchase_order__account_analytic_id
msgid "Analytic Account"
msgstr "cuenta analítica"

#. module: purchase_analytic_global
#: model:ir.model,name:purchase_analytic_global.model_purchase_order
msgid "Purchase Order"
msgstr "orden de compra"

#. module: purchase_analytic_global
#: model:ir.model.fields,help:purchase_analytic_global.field_purchase_order__account_analytic_id
msgid ""
"This account will be propagated to all lines, if you need to use different "
"accounts, define the account at line level."
msgstr ""
"Esta cuenta se propagará a todas las líneas, si necesita utilizar diferentes "
"cuentas, defina la cuenta a nivel de línea."
38 changes: 38 additions & 0 deletions purchase_analytic_global/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * purchase_analytic_global
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-01 10:04+0000\n"
"PO-Revision-Date: 2015-09-01 10:04+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: purchase_analytic_global
#: model:ir.model.fields,field_description:purchase_analytic_global.field_purchase_order__account_analytic_id
msgid "Analytic Account"
msgstr "Compte analytique"

#. module: purchase_analytic_global
#: model:ir.model,name:purchase_analytic_global.model_purchase_order
msgid "Purchase Order"
msgstr "Commande d'achat"

#. module: purchase_analytic_global
#: model:ir.model.fields,help:purchase_analytic_global.field_purchase_order__account_analytic_id
#, fuzzy
msgid ""
"This account will be propagated to all lines, if you need to use different "
"accounts, define the account at line level."
msgstr ""
"Le compte analytique sera défini sur toutes les lignes. Afin d'utiliser des "
"comptes différents sur les lignes, veuillez laisser ce champ vide et les "
"définir manuellement sur les lignes."
42 changes: 42 additions & 0 deletions purchase_analytic_global/i18n/purchase_analytic_global.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic_global
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: purchase_analytic_global
#: model:ir.model.fields,field_description:purchase_analytic_global.field_purchase_order__analytic_distribution
msgid "Analytic Distribution"
msgstr ""

#. module: purchase_analytic_global
#: model:ir.model.fields,field_description:purchase_analytic_global.field_purchase_order__analytic_precision
msgid "Analytic Precision"
msgstr ""

#. module: purchase_analytic_global
#: model:ir.model.fields,field_description:purchase_analytic_global.field_purchase_order__distribution_analytic_account_ids
msgid "Distribution Analytic Account"
msgstr ""

#. module: purchase_analytic_global
#: model:ir.model,name:purchase_analytic_global.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: purchase_analytic_global
#: model:ir.model.fields,help:purchase_analytic_global.field_purchase_order__analytic_distribution
msgid ""
"This analytic distribution will be propagated to all lines analytic "
"distributions, if you need to use different analytic distribution, define it"
" at line level."
msgstr ""
1 change: 1 addition & 0 deletions purchase_analytic_global/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order
40 changes: 40 additions & 0 deletions purchase_analytic_global/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2014-2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import api, fields, models


class PurchaseOrder(models.Model):
_name = "purchase.order"
_inherit = ["purchase.order", "analytic.mixin"]

analytic_distribution = fields.Json(
inverse="_inverse_analytic_distribution",
help="This analytic distribution will be propagated to all lines "
"analytic distributions, if you need to use different "
"analytic distribution, define it at line level.",
)

@api.depends("order_line.analytic_distribution")
def _compute_analytic_distribution(self):
"""Set the analytic distribution on the order based on its order lines.

If all order lines have the same analytic distribution,
then set it on the order, otherwise left the field empty.
"""
res = super()._compute_analytic_distribution()
for order in self:
distributions = order.mapped("order_line.analytic_distribution")
if distributions and all(
distribute == distributions[0] for distribute in distributions
):
order.analytic_distribution = distributions[0]
else:
order.analytic_distribution = False
return res

def _inverse_analytic_distribution(self):
"""Propagate the analytic distribution to order lines if set on the order"""
for order in self:
if order.analytic_distribution:
order.order_line.analytic_distribution = order.analytic_distribution
3 changes: 3 additions & 0 deletions purchase_analytic_global/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
11 changes: 11 additions & 0 deletions purchase_analytic_global/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- [Camptocamp](https://camptocamp.com):
- Guewen Baconnier \<<[email protected]>\>
- Yannick Vaucher \<<[email protected]>\>
- Iryna Vyshnevska \<<[email protected]>\>
- Maksym Yankin \<<[email protected]>\>

- [ERP Harbor](https://erpharbor.com):
- Sudhir Arya \<<[email protected]>\>

- [Trobz](https://trobz.com):
- Phuc Tran \<<[email protected]>\>
2 changes: 2 additions & 0 deletions purchase_analytic_global/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 15.0 to 18.0 was financially supported
by Camptocamp
2 changes: 2 additions & 0 deletions purchase_analytic_global/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds an analytic account on the purchases that is applied on
all the lines distributions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading