diff --git a/stock_orderpoint_purchase_link/README.rst b/stock_orderpoint_purchase_link/README.rst index 42fbcfef2..fae74a31d 100644 --- a/stock_orderpoint_purchase_link/README.rst +++ b/stock_orderpoint_purchase_link/README.rst @@ -1,52 +1,76 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 - ============================== Stock Orderpoint Purchase Link ============================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_orderpoint_purchase_link + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_orderpoint_purchase_link + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module adds to purchase order lines a direct link to the reordering rules that created them. In chained moves, the reordering rule is propagated from stock moves to the purchase order line. +**Table of contents** -Usage -===== - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 +.. contents:: + :local: 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 smash it by providing detailed and welcomed feedback. +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 `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Eficent + Contributors ------------- +~~~~~~~~~~~~ * Jordi Ballester +* Kitti Upariphutthiphong. (http://ecosoft.co.th) +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_orderpoint_purchase_link/__manifest__.py b/stock_orderpoint_purchase_link/__manifest__.py index eacb4352a..6f5a0aed6 100644 --- a/stock_orderpoint_purchase_link/__manifest__.py +++ b/stock_orderpoint_purchase_link/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Orderpoint Purchase Link", "summary": "Link Reordering rules to purchase orders", - "version": "11.0.1.0.2", + "version": "12.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", "author": "Eficent, " @@ -12,11 +12,11 @@ "category": "Warehouse Management", "depends": [ "stock_orderpoint_move_link", - "purchase", + "purchase_stock", ], "data": [ "views/purchase_order_views.xml", ], "installable": True, - 'auto_install': True, + "auto_install": True, } diff --git a/stock_orderpoint_purchase_link/i18n/stock_orderpoint_purchase_link.pot b/stock_orderpoint_purchase_link/i18n/stock_orderpoint_purchase_link.pot deleted file mode 100644 index c112b5024..000000000 --- a/stock_orderpoint_purchase_link/i18n/stock_orderpoint_purchase_link.pot +++ /dev/null @@ -1,43 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * stock_orderpoint_purchase_link -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 11.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: stock_orderpoint_purchase_link -#: model:ir.model,name:stock_orderpoint_purchase_link.model_stock_warehouse_orderpoint -msgid "Minimum Inventory Rule" -msgstr "" - -#. module: stock_orderpoint_purchase_link -#: model:ir.model.fields,field_description:stock_orderpoint_purchase_link.field_purchase_order_line_orderpoint_ids -#: model:ir.ui.view,arch_db:stock_orderpoint_purchase_link.purchase_order_form -#: model:ir.ui.view,arch_db:stock_orderpoint_purchase_link.purchase_order_line_form2 -msgid "Orderpoints" -msgstr "" - -#. module: stock_orderpoint_purchase_link -#: model:ir.model,name:stock_orderpoint_purchase_link.model_procurement_rule -msgid "Procurement Rule" -msgstr "" - -#. module: stock_orderpoint_purchase_link -#: model:ir.model,name:stock_orderpoint_purchase_link.model_purchase_order_line -msgid "Purchase Order Line" -msgstr "" - -#. module: stock_orderpoint_purchase_link -#: model:ir.model.fields,field_description:stock_orderpoint_purchase_link.field_stock_warehouse_orderpoint_purchase_line_ids -#: model:ir.model.fields,field_description:stock_orderpoint_purchase_link.field_stock_warehouse_orderpoint_template_purchase_line_ids -msgid "Purchase Order Lines" -msgstr "" - diff --git a/stock_orderpoint_purchase_link/models/__init__.py b/stock_orderpoint_purchase_link/models/__init__.py index 81b3cd1b7..87cace991 100644 --- a/stock_orderpoint_purchase_link/models/__init__.py +++ b/stock_orderpoint_purchase_link/models/__init__.py @@ -1,3 +1,3 @@ from . import purchase_order_line -from . import procurement_rule +from . import stock_rule from . import stock_warehouse_orderpoint diff --git a/stock_orderpoint_purchase_link/models/procurement_rule.py b/stock_orderpoint_purchase_link/models/stock_rule.py similarity index 77% rename from stock_orderpoint_purchase_link/models/procurement_rule.py rename to stock_orderpoint_purchase_link/models/stock_rule.py index 27c7da61a..72b3d8638 100644 --- a/stock_orderpoint_purchase_link/models/procurement_rule.py +++ b/stock_orderpoint_purchase_link/models/stock_rule.py @@ -4,13 +4,13 @@ from odoo import models -class ProcurementRule(models.Model): - _inherit = 'procurement.rule' +class StockRule(models.Model): + _inherit = 'stock.rule' def _prepare_purchase_order_line(self, product_id, product_qty, - product_uom, values, po, supplier): - vals = super(ProcurementRule, self)._prepare_purchase_order_line( - product_id, product_qty, product_uom, values, po, supplier) + product_uom, values, po, partner): + vals = super()._prepare_purchase_order_line( + product_id, product_qty, product_uom, values, po, partner) # If the procurement was run directly by a reordering rule. if 'orderpoint_id' in values: vals['orderpoint_ids'] = [ @@ -23,7 +23,7 @@ class ProcurementRule(models.Model): def _update_purchase_order_line(self, product_id, product_qty, product_uom, values, line, partner): - vals = super(ProcurementRule, self)._update_purchase_order_line( + vals = super()._update_purchase_order_line( product_id, product_qty, product_uom, values, line, partner) if 'orderpoint_id' in values: vals['orderpoint_ids'] = [ diff --git a/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst b/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..6edbd9d63 --- /dev/null +++ b/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Jordi Ballester +* Kitti Upariphutthiphong. (http://ecosoft.co.th) diff --git a/stock_orderpoint_purchase_link/readme/DESCRIPTION.rst b/stock_orderpoint_purchase_link/readme/DESCRIPTION.rst new file mode 100644 index 000000000..4921c935b --- /dev/null +++ b/stock_orderpoint_purchase_link/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module adds to purchase order lines a direct link to the reordering rules +that created them. In chained moves, the reordering rule is propagated +from stock moves to the purchase order line. diff --git a/stock_orderpoint_purchase_link/static/description/index.html b/stock_orderpoint_purchase_link/static/description/index.html new file mode 100644 index 000000000..e1daf1e33 --- /dev/null +++ b/stock_orderpoint_purchase_link/static/description/index.html @@ -0,0 +1,422 @@ + + + + + + +Stock Orderpoint Purchase Link + + + + + + diff --git a/stock_orderpoint_purchase_link/tests/test_stock_orderpoint_purchase_link.py b/stock_orderpoint_purchase_link/tests/test_stock_orderpoint_purchase_link.py index accd6e31d..4c5a48057 100644 --- a/stock_orderpoint_purchase_link/tests/test_stock_orderpoint_purchase_link.py +++ b/stock_orderpoint_purchase_link/tests/test_stock_orderpoint_purchase_link.py @@ -14,7 +14,7 @@ class TestOrderpointPurchaseLink(common.TransactionCase): self.location_obj = self.env['stock.location'] self.orderpoint_obj = self.env['stock.warehouse.orderpoint'] self.route_obj = self.env['stock.location.route'] - self.rule_obj = self.env['procurement.rule'] + self.rule_obj = self.env['stock.rule'] self.group_obj = self.env['procurement.group'] # WH and routes: @@ -24,13 +24,13 @@ class TestOrderpointPurchaseLink(common.TransactionCase): 'name': 'Test', 'location_id': self.warehouse.view_location_id.id, }) - route_buy = self.env.ref('purchase.route_warehouse0_buy').id + route_buy = self.env.ref('purchase_stock.route_warehouse0_buy').id route_test = self.route_obj.create({ 'name': 'Stock to Test', }).id self.rule_obj.create({ 'name': 'Stock to Test', - 'action': 'move', + 'action': 'pull', 'procure_method': 'make_to_order', 'location_id': self.test_location.id, 'location_src_id': self.stock_location.id,