From 5fba3f27c36fa59dc9a153873d04583a1e155a51 Mon Sep 17 00:00:00 2001 From: Joan Sisquella Date: Fri, 6 Mar 2020 12:45:52 +0100 Subject: [PATCH] [MIG] stock_orderpoint_purchase_link: Migration to 13.0 --- stock_orderpoint_purchase_link/__manifest__.py | 6 +++--- .../models/purchase_order_line.py | 2 +- .../models/stock_rule.py | 14 +++++++------- .../models/stock_warehouse_orderpoint.py | 2 +- .../readme/CONTRIBUTORS.rst | 2 +- .../tests/test_stock_orderpoint_purchase_link.py | 2 +- .../views/purchase_order_views.xml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/stock_orderpoint_purchase_link/__manifest__.py b/stock_orderpoint_purchase_link/__manifest__.py index 8aa1105a8..1492487a0 100644 --- a/stock_orderpoint_purchase_link/__manifest__.py +++ b/stock_orderpoint_purchase_link/__manifest__.py @@ -1,13 +1,13 @@ -# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { "name": "Stock Orderpoint Purchase Link", "summary": "Link Reordering rules to purchase orders", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-warehouse", - "author": "Eficent, " "Odoo Community Association (OCA)", + "author": "ForgeFlow, Odoo Community Association (OCA)", "category": "Warehouse Management", "depends": ["stock_orderpoint_move_link", "purchase_stock"], "data": ["views/purchase_order_views.xml"], diff --git a/stock_orderpoint_purchase_link/models/purchase_order_line.py b/stock_orderpoint_purchase_link/models/purchase_order_line.py index 0e4e45650..5399625f1 100644 --- a/stock_orderpoint_purchase_link/models/purchase_order_line.py +++ b/stock_orderpoint_purchase_link/models/purchase_order_line.py @@ -1,4 +1,4 @@ -# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import fields, models diff --git a/stock_orderpoint_purchase_link/models/stock_rule.py b/stock_orderpoint_purchase_link/models/stock_rule.py index 3dcbe6754..b595034f8 100644 --- a/stock_orderpoint_purchase_link/models/stock_rule.py +++ b/stock_orderpoint_purchase_link/models/stock_rule.py @@ -1,4 +1,4 @@ -# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import models @@ -8,13 +8,13 @@ class StockRule(models.Model): _inherit = "stock.rule" def _prepare_purchase_order_line( - self, product_id, product_qty, product_uom, values, po, partner + self, product_id, product_qty, product_uom, company_id, values, po ): vals = super()._prepare_purchase_order_line( - product_id, product_qty, product_uom, values, po, partner + product_id, product_qty, product_uom, company_id, values, po ) # If the procurement was run directly by a reordering rule. - if "orderpoint_id" in values: + if "orderpoint_id" in values and values["orderpoint_id"].id: vals["orderpoint_ids"] = [(4, values["orderpoint_id"].id)] # If the procurement was run by a stock move. elif "orderpoint_ids" in values: @@ -22,12 +22,12 @@ class StockRule(models.Model): return vals def _update_purchase_order_line( - self, product_id, product_qty, product_uom, values, line, partner + self, product_id, product_qty, product_uom, company_id, values, line ): vals = super()._update_purchase_order_line( - product_id, product_qty, product_uom, values, line, partner + product_id, product_qty, product_uom, company_id, values, line ) - if "orderpoint_id" in values: + if "orderpoint_id" in values and values["orderpoint_id"].id: vals["orderpoint_ids"] = [(4, values["orderpoint_id"].id)] # If the procurement was run by a stock move. elif "orderpoint_ids" in values: diff --git a/stock_orderpoint_purchase_link/models/stock_warehouse_orderpoint.py b/stock_orderpoint_purchase_link/models/stock_warehouse_orderpoint.py index 6c4edadab..6b4621eee 100644 --- a/stock_orderpoint_purchase_link/models/stock_warehouse_orderpoint.py +++ b/stock_orderpoint_purchase_link/models/stock_warehouse_orderpoint.py @@ -1,4 +1,4 @@ -# Copyright 2018 Eficent Business and IT Consulting Services, S.L. +# Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import fields, models diff --git a/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst b/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst index 6edbd9d63..767f5b23d 100644 --- a/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst +++ b/stock_orderpoint_purchase_link/readme/CONTRIBUTORS.rst @@ -1,2 +1,2 @@ -* Jordi Ballester +* Jordi Ballester * Kitti Upariphutthiphong. (http://ecosoft.co.th) 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 d0eebd7df..1ae049be4 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 @@ -1,4 +1,4 @@ -# Copyright 2018 Eficent Business and IT Consulting Services S.L. +# Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). from odoo.tests import common diff --git a/stock_orderpoint_purchase_link/views/purchase_order_views.xml b/stock_orderpoint_purchase_link/views/purchase_order_views.xml index 198818ac6..a4652cd69 100644 --- a/stock_orderpoint_purchase_link/views/purchase_order_views.xml +++ b/stock_orderpoint_purchase_link/views/purchase_order_views.xml @@ -10,7 +10,7 @@ -