diff --git a/purchase_discount/models/__init__.py b/purchase_discount/models/__init__.py index e1ee8a6e5d2..2e607b33761 100644 --- a/purchase_discount/models/__init__.py +++ b/purchase_discount/models/__init__.py @@ -1,6 +1,6 @@ from . import account_invoice from . import purchase_order from . import stock_move -from . import procurement_rule +from . import stock_rule from . import product_supplierinfo from . import res_partner diff --git a/purchase_discount/models/procurement_rule.py b/purchase_discount/models/stock_rule.py similarity index 96% rename from purchase_discount/models/procurement_rule.py rename to purchase_discount/models/stock_rule.py index ec4a7ec0acd..a93d47e2679 100644 --- a/purchase_discount/models/procurement_rule.py +++ b/purchase_discount/models/stock_rule.py @@ -3,7 +3,7 @@ from odoo import api, models -class ProcurementRule(models.Model): +class StockRule(models.Model): _inherit = 'stock.rule' @api.multi diff --git a/purchase_discount/tests/test_product_supplierinfo_discount.py b/purchase_discount/tests/test_product_supplierinfo_discount.py index 5a4e0072450..c8367e196cb 100644 --- a/purchase_discount/tests/test_product_supplierinfo_discount.py +++ b/purchase_discount/tests/test_product_supplierinfo_discount.py @@ -64,7 +64,7 @@ def test_003_purchase_order_partner_1_qty_1(self): "6 with partner 1 and qty 1") def test_004_prepare_purchase_order_line(self): - procurement_rule = self.env['stock.rule'].create({ + stock_rule = self.env['stock.rule'].create({ 'sequence': 20, 'location_id': self.env.ref('stock.stock_location_locations').id, 'picking_type_id': self.env.ref('stock.chi_picking_type_in').id, @@ -89,9 +89,9 @@ def test_004_prepare_purchase_order_line(self): 'name': 'WH: Stock -> Customers MTO', 'product_id': self.product.id, 'date_planned': fields.Datetime.now(), - 'rule_id': procurement_rule.id, + 'rule_id': stock_rule.id, } - res = procurement_rule._prepare_purchase_order_line( + res = stock_rule._prepare_purchase_order_line( self.product, 50, self.env.ref('uom.product_uom_unit'), po_line_vals, self.purchase_order, self.supplierinfo.name, ) diff --git a/subcontracted_service/init_hook.py b/subcontracted_service/init_hook.py index 6b57af64f3e..2fad5040106 100644 --- a/subcontracted_service/init_hook.py +++ b/subcontracted_service/init_hook.py @@ -8,10 +8,10 @@ def post_init_hook(cr, pool): env = Environment(cr, SUPERUSER_ID, {}) - create_warehouse_procurement_rules(env) + create_warehouse_stock_rules(env) -def create_warehouse_procurement_rules(env): +def create_warehouse_stock_rules(env): warehouses = env['stock.warehouse'].with_context( active_test=False).search([]) warehouses._set_subcontracting_service_proc_rule() diff --git a/subcontracted_service/tests/test_subcontracted_service.py b/subcontracted_service/tests/test_subcontracted_service.py index 0dad7148344..b54848a68e7 100644 --- a/subcontracted_service/tests/test_subcontracted_service.py +++ b/subcontracted_service/tests/test_subcontracted_service.py @@ -35,7 +35,7 @@ def setUp(self): limit=1 ) - def test_wh_procurement_rule(self): + def test_wh_stock_rule(self): """Tests if the procurement rule for subcontracting services is assigned properly to the warehouse.""" wh = self.test_wh