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

[17.0][mig] purchase_analytic #707

Open
wants to merge 46 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
bbaf49e
module to manage analytic on purchase order
Apr 22, 2016
25ea752
[10.0][MIG] port purchase_analytic to V10.0
May 11, 2017
4223423
[UPD] Update purchase_analytic.pot
oca-travis Oct 1, 2019
9324f28
[ADD] icon.png
OCA-git-bot Oct 1, 2019
6a88e54
[MIG] purchase_analytic: Migration to 12.0
MiquelRForgeFlow Oct 23, 2019
36683af
[UPD] Update purchase_analytic.pot
oca-travis Oct 28, 2019
8ceb316
[UPD] README.rst
OCA-git-bot Oct 28, 2019
dc2f836
Update translation files
oca-transbot Nov 5, 2019
46480ff
[IMP] purchase_analytic: black, isort
ps-tubtim Jan 8, 2020
03aa83e
[MIG] purchase_analytic: Migration to 13.0
ps-tubtim Mar 25, 2020
c496b41
[UPD] Update purchase_analytic.pot
oca-travis Mar 30, 2020
e78a380
Added translation using Weblate (Spanish)
eduardgm Mar 26, 2021
232da31
[IMP] purchase_analytic: black, isort, prettier
alan196 Nov 29, 2021
577e18c
[MIG] purchase_analytic: Migration to 15.0
alan196 Nov 29, 2021
dd867e1
[UPD] Update purchase_analytic.pot
May 17, 2022
508cf05
[UPD] README.rst
OCA-git-bot May 17, 2022
c4b357b
[IMP] purchase_analytic: adapt to newest framework.
LoisRForgeFlow Aug 11, 2022
7d97a88
[UPD] Update purchase_analytic.pot
Aug 22, 2022
086d1e0
[UPD] README.rst
OCA-git-bot Aug 22, 2022
33abf0d
purchase_analytic 15.0.2.0.0
OCA-git-bot Aug 22, 2022
5f777ac
Update translation files
oca-transbot Aug 22, 2022
2f3bc9a
[MIG] purchase_analytic: Migration to 16.0
AungKoKoLin1997 Jan 16, 2023
aae4f08
analytic_distribution readonly states
AungKoKoLin1997 Feb 2, 2023
8da0448
[UPD] Update purchase_analytic.pot
Feb 11, 2023
e69fafd
[UPD] README.rst
OCA-git-bot Feb 11, 2023
5859849
Added translation using Weblate (Croatian)
badbole Feb 16, 2023
eeacecd
Translated using Weblate (Croatian)
badbole Feb 16, 2023
0fab286
Translated using Weblate (Spanish)
Gelo-fl Apr 12, 2023
8dd3e5f
Translated using Weblate (French)
sanrav May 8, 2023
1870f06
[UPD] Update purchase_analytic.pot
May 15, 2023
632697a
Update translation files
weblate May 15, 2023
c09a8aa
Added translation using Weblate (French (France) (fr_FR))
sanrav May 15, 2023
c35aee5
Translated using Weblate (French)
sanrav May 15, 2023
e4e3bf0
Translated using Weblate (French (France) (fr_FR))
sanrav May 15, 2023
e82d3c5
[IMP] purchase_analytic: add default value in order line
AungKoKoLin1997 Jun 5, 2023
05afc0d
purchase_analytic 16.0.2.0.0
OCA-git-bot Jun 10, 2023
24f6ed0
Added translation using Weblate (Portuguese (Brazil))
adrianojprado Jun 14, 2023
8dd9c63
Translated using Weblate (Portuguese (Brazil))
adrianojprado Jun 14, 2023
40cdceb
Translated using Weblate (Spanish)
Ivorra78 Jul 11, 2023
2e8c97f
[UPD] README.rst
OCA-git-bot Sep 3, 2023
73a3697
[FIX] purchase_analytic: Access Denied by ACLs
AungKoKoLin1997 Sep 21, 2023
3a99e36
[BOT] post-merge updates
OCA-git-bot Sep 21, 2023
8e64cf8
[TRN] remove fr_FR.po
sbidoul Nov 21, 2023
c729dbc
[IMP] purchase_analytic: pre-commit stuff
Wodran14 Feb 14, 2024
1cae1c8
[MIG] purchase_analytic: Migration to 17.0
Wodran14 Feb 14, 2024
31fcdc5
[IMP] purchase_analytic: improve tests to increase coverage
CLaurelB Jan 6, 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
125 changes: 125 additions & 0 deletions purchase_analytic/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
=================
Purchase Analytic
=================

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

.. |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%2Faccount--analytic-lightgray.png?logo=github
:target: https://github.com/OCA/account-analytic/tree/17.0/purchase_analytic
:alt: OCA/account-analytic
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-purchase_analytic
: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/account-analytic&target_branch=17.0
:alt: Try me on Runboat

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

The goal of this module is to ease analytic distribution management on
purchase order. This module add analytic distribution on purchase order.

If all lines of the purchase order have the same analytic distribution,
the analytic distribution on the purchase order is automatically set
with this value. If a analytic distribution is set on the purchase
order, all lines of the purchase will take this value.

**Table of contents**

.. contents::
:local:

Changelog
=========

16.0.1.0.0 (2023-01-16)
-----------------------

Migrated to odoo 16.

15.0.1.0.0 (2022-05-17)
-----------------------

Migrated to odoo 15.

13.0.1.0.0 (2020-01-08)
-----------------------

Migrated to odoo 13.

12.0.1.0.0 (2019-10-23)
-----------------------

Migrated to odoo 12.

10.0.1.0.0 (2017-05-11)
-----------------------

Migrated to odoo 10.

8.0.1.0.0 (2016-04-22)
----------------------

First version.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-analytic/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/account-analytic/issues/new?body=module:%20purchase_analytic%0Aversion:%2017.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
-------

* Acsone SA/NV

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

- Laetitia Gangloff <[email protected]>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't fixing double spaces part of the changes performed by precommit?

I mean:

Suggested change
- Laetitia Gangloff <[email protected]>
- Laetitia Gangloff <[email protected]>

- Cédric Pigeon <[email protected]>
- Pimolnat Suntian <[email protected]>
- `Jarsa <https://www.jarsa.com>`__

- Alan Ramos

- Lois Rilo <[email protected]>
- `Quartile <https://www.quartile.co>`__:

- Aung Ko Ko Lin

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/account-analytic <https://github.com/OCA/account-analytic/tree/17.0/purchase_analytic>`_ 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/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions purchase_analytic/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Purchase Analytic",
"version": "17.0.1.0.0",
"author": "Acsone SA/NV, Odoo Community Association (OCA)",
"category": "Purchase Management",
"website": "https://github.com/OCA/account-analytic",
"depends": ["purchase", "base_view_inheritance_extension"],
"data": ["views/purchase_views.xml"],
"license": "AGPL-3",
"installable": True,
"application": False,
}
43 changes: 43 additions & 0 deletions purchase_analytic/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-11 10:10+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
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution
msgid "Analytic"
msgstr "Analítico"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution_search
msgid "Analytic Distribution Search"
msgstr "Búsqueda de distribución analítica"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_precision
msgid "Analytic Precision"
msgstr "Precisión analítica"

#. module: purchase_analytic
#: model:ir.model,name:purchase_analytic.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de Compra"

#~ msgid "Analytic Account"
#~ msgstr "Cuenta Analítica"

#~ msgid "The analytic account related to a purchase order."
#~ msgstr "La cuenta analítica relacionada al pedido de compra."
52 changes: 52 additions & 0 deletions purchase_analytic/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-04-07 08:25+0000\n"
"PO-Revision-Date: 2023-05-15 18:34+0000\n"
"Last-Translator: Sandrine (ACSONE) <[email protected]>\n"
"Language-Team: \n"
"Language: fr\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.14.1\n"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution
msgid "Analytic"
msgstr "Analytique"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution_search
msgid "Analytic Distribution Search"
msgstr "Recherche de distribution analytique"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_precision
msgid "Analytic Precision"
msgstr "Précision analytique"

#. module: purchase_analytic
#: model:ir.model,name:purchase_analytic.model_purchase_order
msgid "Purchase Order"
msgstr "Bon de commande"

#~ msgid "Analytic Account"
#~ msgstr "Compte analytique"

#~ msgid "The analytic account related to a purchase order."
#~ msgstr "Le compte analytique lié à un bon de commande."

#~ msgid "Contract / Analytic"
#~ msgstr "Contrat / analytique"

#~ msgid "Use to store the value of project_id if there is no lines"
#~ msgstr ""
#~ "Utilisé pour stocker la valeur du champs project_id lorsqu'il n'y a pas "
#~ "de lignes"
38 changes: 38 additions & 0 deletions purchase_analytic/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-02-16 14:23+0000\n"
"Last-Translator: Bole <[email protected]>\n"
"Language-Team: none\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.14.1\n"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution
msgid "Analytic"
msgstr "Analitika"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution_search
msgid "Analytic Distribution Search"
msgstr ""

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_precision
msgid "Analytic Precision"
msgstr "Preciznost analitike"

#. module: purchase_analytic
#: model:ir.model,name:purchase_analytic.model_purchase_order
msgid "Purchase Order"
msgstr "Nalog za nabavu"
37 changes: 37 additions & 0 deletions purchase_analytic/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_analytic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-14 20:09+0000\n"
"Last-Translator: Adriano Prado <[email protected]>\n"
"Language-Team: none\n"
"Language: pt_BR\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
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution
msgid "Analytic"
msgstr "Analítica"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution_search
msgid "Analytic Distribution Search"
msgstr "Pesquisa Distribuição Analítica"

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_precision
msgid "Analytic Precision"
msgstr "Precisão Analítica"

#. module: purchase_analytic
#: model:ir.model,name:purchase_analytic.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de Compra"
34 changes: 34 additions & 0 deletions purchase_analytic/i18n/purchase_analytic.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are missing commits present in 16.0, mainly related to translations, e.g. de8e27f. I'd suggest retrieving the history again and then cherrypicking the migration commits.

# This file contains the translation of the following modules:
# * purchase_analytic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution
msgid "Analytic"
msgstr ""

#. module: purchase_analytic
#: model:ir.model.fields,field_description:purchase_analytic.field_purchase_order__analytic_distribution_search
msgid "Analytic Distribution Search"
msgstr ""

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

#. module: purchase_analytic
#: model:ir.model,name:purchase_analytic.model_purchase_order
msgid "Purchase Order"
msgstr ""
1 change: 1 addition & 0 deletions purchase_analytic/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase
44 changes: 44 additions & 0 deletions purchase_analytic/models/purchase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu)
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

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")

@api.depends("order_line.analytic_distribution")
def _compute_analytic_distribution(self):
"""If all order line have same analytic distribution set analytic_distribution.
If no lines, respect value given by the user.
"""
for po in self:
if po.order_line:
al = po.order_line[0].analytic_distribution or False
for ol in po.order_line:
if ol.analytic_distribution != al:
al = False
break
po.analytic_distribution = al

def _inverse_analytic_distribution(self):
"""
When set analytic_distribution set analytic distribution on all order lines

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"when setting

Same in the below docstring.

"""
for po in self:
if po.analytic_distribution:
po.order_line.write({"analytic_distribution": po.analytic_distribution})

@api.onchange("analytic_distribution")
def _onchange_analytic_distribution(self):
"""
When change analytic_distribution set analytic distribution on all order lines
"""
if self.analytic_distribution:
self.order_line.update(
{"analytic_distribution": self.analytic_distribution}
)
Loading
Loading