[FIX] purchase_requisition: Display only Can be Purchased Products

Followup on c058562d73

Before this commit, Domain for `purchase_ok` on the field `product_id` was applied on the field level which was Replaced by multi-company domain on views.

With this commit, we combine both domains to Display only `Can be Purchased` products.

closes odoo/odoo#47778

X-original-commit: 842b8a383b7868a89cbd3d81b0065cce37606db4
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Swapnesh Shah
2020-03-17 10:14:40 +00:00
committed by Simon Lejeune
parent 4d9d90bae0
commit ef043deafd
@@ -150,7 +150,8 @@
<page string="Products" name="products">
<field name="line_ids">
<tree string="Products" editable="bottom">
<field name="product_id" context="{'default_purchase_requisition': 'tenders'}" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
<field name="product_id" context="{'default_purchase_requisition': 'tenders'}"
domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
<field name="product_description_variants" attrs="{'readonly': [('parent.state', '!=', 'draft')]}"/>
<field name="product_qty"/>
<field name="qty_ordered" optional="show"/>
@@ -163,7 +164,8 @@
</tree>
<form string="Products">
<group>
<field name="product_id" />
<field name="product_id" context="{'default_purchase_requisition': 'tenders'}"
domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]" />
<field name="product_qty"/>
<field name="qty_ordered"/>
<field name="product_uom_category_id" invisible="1"/>