sale_order_batch_product: make Sale Order Lines Readonly when confirmed
This commit is contained in:
parent
94c874f0f2
commit
ef3f1785ba
2 changed files with 3 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ class SaleOrderBatchProduct(models.Model):
|
|||
copy=False,
|
||||
readonly=True,
|
||||
)
|
||||
state = fields.Selection(related="batch_id.state")
|
||||
product_id = fields.Many2one(comodel_name="product.product", required=True, readonly=True)
|
||||
product_template_id = fields.Many2one(
|
||||
"product.template", related="product_id.product_tmpl_id", string="Product Template"
|
||||
|
|
|
|||
|
|
@ -23,10 +23,11 @@
|
|||
</group>
|
||||
<notebook>
|
||||
<page string="Sale Order Lines" name="order_line">
|
||||
<field name="state" invisible="1"/>
|
||||
<field
|
||||
name="sale_order_line_ids"
|
||||
widget="section_and_note_one2many"
|
||||
attrs="{'readonly': [('state', 'in', ('closed'))]}"
|
||||
attrs="{'readonly': [('state', '=', 'closed')]}"
|
||||
>
|
||||
<tree editable="bottom" create="0">
|
||||
<field name="company_id" invisible="1"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue