diff --git a/account_move_line_purchase_info/README.rst b/account_move_line_purchase_info/README.rst index 8a6942a68..040f6c2e3 100644 --- a/account_move_line_purchase_info/README.rst +++ b/account_move_line_purchase_info/README.rst @@ -14,13 +14,13 @@ Account Move Line Purchase Info :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--financial--tools-lightgray.png?logo=github - :target: https://github.com/OCA/account-financial-tools/tree/13.0/account_move_line_purchase_info + :target: https://github.com/OCA/account-financial-tools/tree/14.0/account_move_line_purchase_info :alt: OCA/account-financial-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/account-financial-tools-13-0/account-financial-tools-13-0-account_move_line_purchase_info + :target: https://translation.odoo-community.org/projects/account-financial-tools-14-0/account-financial-tools-14-0-account_move_line_purchase_info :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/92/13.0 + :target: https://runbot.odoo-community.org/runbot/92/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -52,7 +52,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. @@ -69,6 +69,7 @@ Contributors * Jordi Ballester Alomar * Héctor Villarreal +* Pimolnat Suntian Maintainers ~~~~~~~~~~~ @@ -83,6 +84,6 @@ 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-financial-tools `_ project on GitHub. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_move_line_purchase_info/__manifest__.py b/account_move_line_purchase_info/__manifest__.py index df544e217..cc33fd732 100644 --- a/account_move_line_purchase_info/__manifest__.py +++ b/account_move_line_purchase_info/__manifest__.py @@ -5,9 +5,9 @@ { "name": "Account Move Line Purchase Info", "summary": "Introduces the purchase order line to the journal items", - "version": "13.0.1.1.0", + "version": "14.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", - "website": "https://www.github.com/OCA/account-financial-tools", + "website": "https://github.com/OCA/account-financial-tools", "category": "Generic", "depends": ["purchase_stock"], "license": "AGPL-3", diff --git a/account_move_line_purchase_info/migrations/13.0.1.1.0/post-migration.py b/account_move_line_purchase_info/migrations/13.0.1.1.0/post-migration.py deleted file mode 100644 index e36822eff..000000000 --- a/account_move_line_purchase_info/migrations/13.0.1.1.0/post-migration.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2020 ForgeFlow (https://www.forgeflow.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - pos = ( - env["account.move.line"] - .search([("purchase_id", "!=", False), ("move_id.type", "=", "entry")]) - .mapped("purchase_id") - ) - pos._compute_invoice() diff --git a/account_move_line_purchase_info/migrations/14.0.1.0.0/pre-migration.py b/account_move_line_purchase_info/migrations/14.0.1.0.0/pre-migration.py new file mode 100644 index 000000000..798b7ac88 --- /dev/null +++ b/account_move_line_purchase_info/migrations/14.0.1.0.0/pre-migration.py @@ -0,0 +1,26 @@ +# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """ + Column `purchase_id` of table `account_move_line` has been renamed to `purchase_order_id` + because `purchase_order_id` is now in the core. + """ + old_purchase_column = "purchase_id" + new_purchase_column = "purchase_order_id" + + if not openupgrade.column_exists(env.cr, "account_move_line", new_purchase_column): + openupgrade.rename_fields( + env, + [ + ( + "account.move.line", + "account_move_line", + old_purchase_column, + new_purchase_column, + ), + ], + ) diff --git a/account_move_line_purchase_info/models/account_move.py b/account_move_line_purchase_info/models/account_move.py index b5a717ef7..b8a6e1bbe 100644 --- a/account_move_line_purchase_info/models/account_move.py +++ b/account_move_line_purchase_info/models/account_move.py @@ -6,13 +6,10 @@ from odoo import fields, models class AccountMoveLine(models.Model): - _inherit = "account.move.line" - purchase_id = fields.Many2one( + purchase_order_id = fields.Many2one( comodel_name="purchase.order", - related="purchase_line_id.order_id", - string="Purchase Order", store=True, index=True, ) diff --git a/account_move_line_purchase_info/readme/CONTRIBUTORS.rst b/account_move_line_purchase_info/readme/CONTRIBUTORS.rst index fb4e6fb3e..b48396422 100644 --- a/account_move_line_purchase_info/readme/CONTRIBUTORS.rst +++ b/account_move_line_purchase_info/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Jordi Ballester Alomar * Héctor Villarreal +* Pimolnat Suntian diff --git a/account_move_line_purchase_info/static/description/index.html b/account_move_line_purchase_info/static/description/index.html index 6bab1a819..19ca4918f 100644 --- a/account_move_line_purchase_info/static/description/index.html +++ b/account_move_line_purchase_info/static/description/index.html @@ -3,7 +3,7 @@ - + Account Move Line Purchase Info