I have to make Purchase Order Line as editable in Odoo 8. Currently, the field order_line in Purchase.Order Model has modifier as below:
'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines',
states={'approved':[('readonly',True)],
'done':[('readonly',True)]},
copy=True)
So the states is readonly if approved or done. I want to remove this. I tried with below:
<field name="order_line" position="attributes">
<attribute name="readonly">0</attribute>
</field>
Also,
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="readonly">0</attribute>
</xpath>
But It does not work.
Please help
Thanks,
UPDATE:
class PurchaseOrder(models.Model):
'''
classdocs
'''
_name = 'purchase.order'
_inherit = 'purchase.order'
total_cases = fields.Integer('Total Cases', default=None)
appointment_number = fields.Char('Appointment Number', default=None)
order_line = fields.One2many('purchase.order.line', 'order_id', 'Order Lines', copy=True)
I overrided the field order_line as above, But nothing happens