Skip to content

Commit 587d0cd

Browse files
committed
Merge PR #1850 into 16.0
Signed-off-by pedrobaeza
2 parents b657b4d + a3d57a3 commit 587d0cd

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

purchase_allowed_product/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"website": "https://github.com/OCA/purchase-workflow",
1212
"author": "Akretion, Odoo Community Association (OCA)",
1313
"license": "AGPL-3",
14-
"depends": ["purchase"],
14+
"depends": ["purchase", "base_view_inheritance_extension"],
1515
"data": [
1616
"views/res_partner_views.xml",
1717
"views/account_move_views.xml",

purchase_allowed_product/models/product.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _search(
2727
.commercial_partner_id
2828
)
2929
supplierinfos = self.env["product.supplierinfo"].search(
30-
[("name", "=", seller.id)]
30+
[("partner_id", "=", seller.id)]
3131
)
3232
args += [
3333
"|",

purchase_allowed_product/tests/test_purchase_allowed_product.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setUp(self):
1313
self.product_model = self.env["product.product"]
1414
self.partner_4 = self.env.ref("base.res_partner_4")
1515
self.supplierinfo = self.supplierinfo_model.search(
16-
[("name", "=", self.partner_4.id)]
16+
[("partner_id", "=", self.partner_4.id)]
1717
)
1818
self.partner_4_supplied_products = self.product_model.search(
1919
[

purchase_allowed_product/views/purchase_order_views.xml

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
expr="//field[@name='order_line']/tree/field[@name='product_id']"
2121
position="attributes"
2222
>
23-
<attribute name="context">{
24-
'restrict_supplier_id': parent.partner_id,
25-
'use_only_supplied_product': parent.use_only_supplied_product
26-
}</attribute>
23+
<attribute name="context" operation="update">
24+
{'restrict_supplier_id': parent.partner_id,
25+
'use_only_supplied_product': parent.use_only_supplied_product}
26+
</attribute>
2727
</xpath>
2828
<xpath
2929
expr="//field[@name='order_line']/form//field[@name='product_id']"
3030
position="attributes"
3131
>
32-
<attribute name="context">{
33-
'restrict_supplier_id': parent.partner_id,
34-
'use_only_supplied_product': parent.use_only_supplied_product
35-
}</attribute>
32+
<attribute name="context" operation="update">
33+
{'restrict_supplier_id': parent.partner_id,
34+
'use_only_supplied_product': parent.use_only_supplied_product}
35+
</attribute>
3636
</xpath>
3737
</field>
3838
</record>

0 commit comments

Comments
 (0)