Add active field to product.cost.plan.

This commit is contained in:
Albert Cervera i Areny 2014-03-16 02:49:45 +01:00
parent f9cfe403d3
commit 77054c4564
3 changed files with 9 additions and 0 deletions

View File

@ -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'

View File

@ -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"/>

View File

@ -6,4 +6,5 @@
<field name="product"/>
<field name="bom"/>
<field name="state"/>
<field name="active" invisible_tree="1"/>
</tree>