Add active field to product.cost.plan.
This commit is contained in:
parent
f9cfe403d3
commit
77054c4564
5
plan.py
5
plan.py
|
@ -18,6 +18,7 @@ class Plan(Workflow, ModelSQL, ModelView):
|
|||
__name__ = 'product.cost.plan'
|
||||
|
||||
number = fields.Char('Number')
|
||||
active = fields.Boolean('Active')
|
||||
product = fields.Many2One('product.product', 'Product',
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
|
@ -69,6 +70,10 @@ class Plan(Workflow, ModelSQL, ModelView):
|
|||
}
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
def default_active():
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def default_state():
|
||||
return 'draft'
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<form string="Product Cost Plan" col="6">
|
||||
<label name="number"/>
|
||||
<field name="number"/>
|
||||
<label name="active"/>
|
||||
<field name="active"/>
|
||||
<newline/>
|
||||
<label name="product"/>
|
||||
<field name="product"/>
|
||||
<label name="bom"/>
|
||||
|
|
|
@ -6,4 +6,5 @@
|
|||
<field name="product"/>
|
||||
<field name="bom"/>
|
||||
<field name="state"/>
|
||||
<field name="active" invisible_tree="1"/>
|
||||
</tree>
|
||||
|
|
Loading…
Reference in New Issue