diff --git a/purchase_allowed_product/__manifest__.py b/purchase_allowed_product/__manifest__.py index 771cd1b4bb7..9c88585e25b 100644 --- a/purchase_allowed_product/__manifest__.py +++ b/purchase_allowed_product/__manifest__.py @@ -11,7 +11,7 @@ "website": "https://github.com/OCA/purchase-workflow", "author": "Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": ["purchase"], + "depends": ["purchase", "base_view_inheritance_extension"], "data": [ "views/res_partner_views.xml", "views/account_move_views.xml", diff --git a/purchase_allowed_product/models/product.py b/purchase_allowed_product/models/product.py index f627b4b79f8..d6f7e4839a7 100644 --- a/purchase_allowed_product/models/product.py +++ b/purchase_allowed_product/models/product.py @@ -27,7 +27,7 @@ def _search( .commercial_partner_id ) supplierinfos = self.env["product.supplierinfo"].search( - [("name", "=", seller.id)] + [("partner_id", "=", seller.id)] ) args += [ "|", diff --git a/purchase_allowed_product/tests/test_purchase_allowed_product.py b/purchase_allowed_product/tests/test_purchase_allowed_product.py index bc067fa90ef..dc8e0c7edcb 100644 --- a/purchase_allowed_product/tests/test_purchase_allowed_product.py +++ b/purchase_allowed_product/tests/test_purchase_allowed_product.py @@ -13,7 +13,7 @@ def setUp(self): self.product_model = self.env["product.product"] self.partner_4 = self.env.ref("base.res_partner_4") self.supplierinfo = self.supplierinfo_model.search( - [("name", "=", self.partner_4.id)] + [("partner_id", "=", self.partner_4.id)] ) self.partner_4_supplied_products = self.product_model.search( [ diff --git a/purchase_allowed_product/views/purchase_order_views.xml b/purchase_allowed_product/views/purchase_order_views.xml index 810c2b0ed45..c5a65d010df 100644 --- a/purchase_allowed_product/views/purchase_order_views.xml +++ b/purchase_allowed_product/views/purchase_order_views.xml @@ -20,19 +20,19 @@ expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes" > - { - 'restrict_supplier_id': parent.partner_id, - 'use_only_supplied_product': parent.use_only_supplied_product - } + + {'restrict_supplier_id': parent.partner_id, + 'use_only_supplied_product': parent.use_only_supplied_product} + - { - 'restrict_supplier_id': parent.partner_id, - 'use_only_supplied_product': parent.use_only_supplied_product - } + + {'restrict_supplier_id': parent.partner_id, + 'use_only_supplied_product': parent.use_only_supplied_product} +