[IMP] purchase_requisition: if state is done the readonly some field and button

bzr revid: sbh@tinyerp.com-20100708142102-ctl0bozqkby8nh6b
This commit is contained in:
sbh (Open ERP) 2010-07-08 19:51:02 +05:30
parent 8064b86d8d
commit 977d51f569
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class purchase_requisition(osv.osv):
'exclusive': fields.selection([('exclusive','Purchase Tender (exclusive)'),('multiple','Multiple Requisitions')],'Requisition Type', required=True, help="Purchase Tender (exclusive):On the confirmation of a purchase order, it cancels the remaining purchase order.Multiple Requisitions:It allows to have multiple purchase orders.On confirmation of a purchase order it does not cancel the remaining orders"""),
'description': fields.text('Description'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders'),
'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders',states={'done': [('readonly', True)]}),
'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase',states={'done': [('readonly', True)]}),
'state': fields.selection([('draft','Draft'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
}

View File

@ -41,7 +41,6 @@
<field name="origin"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<notebook colspan="4">
<page string="Products">
<field name="line_ids" colspan="4" nolabel="1">
@ -83,7 +82,8 @@
<separator colspan="4" string=""/>
<group col="8" colspan="4">
<label colspan="6" string=""/>
<button name="%(action_purchase_requisition_partner)d" string="Requests for Quotation" type="action" icon="gtk-execute" />
<button name="%(action_purchase_requisition_partner)d" string="Requests for Quotation" type="action" icon="gtk-execute"
attrs="{'readonly': [('state', '=', 'done')]}" />
</group>
</page>
<page string="Notes">