Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contract/models/contract_template_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class ContractTemplateLine(models.Model):
comodel_name="res.partner", related="contract_id.partner_id"
)
# === Product & UOM ===
product_id = fields.Many2one("product.product", string="Product")
product_id = fields.Many2one(
"product.product",
string="Product",
domain=[("active", "=", True)],
)
name = fields.Text(
string="Description",
required=True,
Expand Down
9 changes: 6 additions & 3 deletions contract/views/contract_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
<field name="priority" eval="20" />
<field name="arch" type="xml">
<field name="product_id" position="attributes">
<attribute name="domain">[('sale_ok', '=', True)]</attribute>
<attribute
name="domain"
>[('sale_ok', '=', True), ('active', '=', True)]</attribute>
</field>
</field>
</record>
Expand All @@ -65,8 +67,9 @@
<field name="priority" eval="20" />
<field name="arch" type="xml">
<field name="product_id" position="attributes">
<attribute name="domain">[('purchase_ok', '=', True)]
</attribute>
<attribute
name="domain"
>[('purchase_ok', '=', True), ('active', '=', True)]</attribute>
</field>
<field name="automatic_price" position="attributes">
<attribute name="invisible">True</attribute>
Expand Down
Loading