From 45078919d3c9f95f1ea46c4082126a132a21fcb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=A9ng=20=28Tr=E1=BA=A7n=20=C4=90=C3=ACnh=29?= Date: Mon, 5 Dec 2022 19:00:23 +0700 Subject: [PATCH] [MIG] account_cutoff_accrual_picking: Migration to 16.0 --- account_cutoff_accrual_picking/README.rst | 21 ++++++++++------ .../__manifest__.py | 2 +- .../models/account_cutoff.py | 12 ++++----- .../readme/CONTRIBUTORS.rst | 2 ++ .../readme/CREDITS.rst | 1 + .../static/description/index.html | 25 ++++++++++++++----- 6 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 account_cutoff_accrual_picking/readme/CREDITS.rst diff --git a/account_cutoff_accrual_picking/README.rst b/account_cutoff_accrual_picking/README.rst index 21fa25366cb..28f10df9dec 100644 --- a/account_cutoff_accrual_picking/README.rst +++ b/account_cutoff_accrual_picking/README.rst @@ -14,14 +14,14 @@ Account Cut-off Accrual Picking :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--closing-lightgray.png?logo=github - :target: https://github.com/OCA/account-closing/tree/15.0/account_cutoff_accrual_picking + :target: https://github.com/OCA/account-closing/tree/16.0/account_cutoff_accrual_picking :alt: OCA/account-closing .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-closing-15-0/account-closing-15-0-account_cutoff_accrual_picking + :target: https://translation.odoo-community.org/projects/account-closing-16-0/account-closing-16-0-account_cutoff_accrual_picking :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/89/15.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/account-closing&target_branch=16.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -57,7 +57,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -73,6 +73,13 @@ Contributors ~~~~~~~~~~~~ * Alexis de Lattre +* `Trobz `_: + * Dzung Tran + +Other credits +~~~~~~~~~~~~~ + +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp Maintainers ~~~~~~~~~~~ @@ -95,6 +102,6 @@ Current `maintainer `__: |maintainer-alexis-via| -This module is part of the `OCA/account-closing `_ project on GitHub. +This module is part of the `OCA/account-closing `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_cutoff_accrual_picking/__manifest__.py b/account_cutoff_accrual_picking/__manifest__.py index 624a567f420..629f64afab1 100644 --- a/account_cutoff_accrual_picking/__manifest__.py +++ b/account_cutoff_accrual_picking/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Account Cut-off Accrual Picking", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Accounting", "license": "AGPL-3", "summary": "Accrued expense & accrued revenue from pickings", diff --git a/account_cutoff_accrual_picking/models/account_cutoff.py b/account_cutoff_accrual_picking/models/account_cutoff.py index 075cd0579c8..6f38bcf291b 100644 --- a/account_cutoff_accrual_picking/models/account_cutoff.py +++ b/account_cutoff_accrual_picking/models/account_cutoff.py @@ -64,7 +64,7 @@ def picking_prepare_cutoff_line(self, vdict, account_mapping): "name": vdict["name"], "account_id": account_id, "cutoff_account_id": accrual_account_id, - "analytic_account_id": vdict["analytic_account_id"], + "analytic_distribution": vdict["analytic_distribution"], "currency_id": vdict["currency"].id, "quantity": qty, "price_unit": vdict["price_unit"], @@ -139,7 +139,7 @@ def order_line_update_oline_dict(self, order_line, order_type, oline_dict): price_origin = invoice.name currency = invoice.currency_id account_id = iline.account_id.id - analytic_account_id = iline.analytic_account_id.id + analytic_distribution = iline.analytic_distribution taxes = iline.tax_ids if not price_origin: if order_type == "purchase": @@ -149,7 +149,7 @@ def order_line_update_oline_dict(self, order_line, order_type, oline_dict): price_unit = order_line.price_subtotal / oline_qty_puom price_origin = order.name currency = order.currency_id - analytic_account_id = order_line.account_analytic_id.id + analytic_distribution = order_line.analytic_distribution taxes = order_line.taxes_id account = product._get_product_accounts()["expense"] if not account: @@ -170,7 +170,7 @@ def order_line_update_oline_dict(self, order_line, order_type, oline_dict): price_unit = order_line.price_subtotal / oline_qty_puom price_origin = order.name currency = order.currency_id - analytic_account_id = order.analytic_account_id.id + analytic_distribution = order_line.analytic_distribution taxes = order_line.tax_id account = product._get_product_accounts()["income"] if not account: @@ -190,7 +190,7 @@ def order_line_update_oline_dict(self, order_line, order_type, oline_dict): "price_unit": price_unit, "price_origin": price_origin, "currency": currency, - "analytic_account_id": analytic_account_id, + "analytic_distribution": analytic_distribution, "account_id": account_id, "taxes": taxes, } @@ -261,7 +261,7 @@ def get_lines(self): # } # -> we use precut_delivered_qty - precut_invoiced_qty for p in pickings: - for move in p.move_lines.filtered(lambda m: m.state == "done"): + for move in p.move_ids.filtered(lambda m: m.state == "done"): self.stock_move_update_oline_dict(move, oline_dict) # from pprint import pprint diff --git a/account_cutoff_accrual_picking/readme/CONTRIBUTORS.rst b/account_cutoff_accrual_picking/readme/CONTRIBUTORS.rst index ff65d68ce6d..1cc05bdd35f 100644 --- a/account_cutoff_accrual_picking/readme/CONTRIBUTORS.rst +++ b/account_cutoff_accrual_picking/readme/CONTRIBUTORS.rst @@ -1 +1,3 @@ * Alexis de Lattre +* `Trobz `_: + * Dzung Tran diff --git a/account_cutoff_accrual_picking/readme/CREDITS.rst b/account_cutoff_accrual_picking/readme/CREDITS.rst new file mode 100644 index 00000000000..70bc307ad0b --- /dev/null +++ b/account_cutoff_accrual_picking/readme/CREDITS.rst @@ -0,0 +1 @@ +The migration of this module from 15.0 to 16.0 was financially supported by Camptocamp diff --git a/account_cutoff_accrual_picking/static/description/index.html b/account_cutoff_accrual_picking/static/description/index.html index d9aef71e836..c9ad7cb8aa5 100644 --- a/account_cutoff_accrual_picking/static/description/index.html +++ b/account_cutoff_accrual_picking/static/description/index.html @@ -3,7 +3,7 @@ - + Account Cut-off Accrual Picking