Hi,
I had made some customizations in sales order for, and as part of that i have added a state to the state
field in the sale.order. The state is test
. And by default this state should be set while creating a quotation instead of draft
. Since in openerp defalt code most of the fields will be editable in the draft state in sale.order and sale.order.line
. I have inherited sale.order fields and added the condition to make fields editable in test
state also as follows:
'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'test': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility='always'),
Thus sale.order fields got editable in my new state. But sale.order.line fields are read-only. So i tried the same thing in sale.order.line.
1) inherited state field and added test state.
2) Inherited other fields and added 'test': [('readonly', False)]
condition to it.
But this didnât work for sale.order.line. the fields are still readonly , the Add An Item
button is not seen. How can i do this? I want to add products in my new state , how can i do this?
The below given is the state field definition of sale.order.line:
'state': fields.selection([('cancel', 'Cancelled'),('draft', 'Draft'),('confirmed', 'Confirmed'),('exception', 'Exception'),('done', 'Done')], 'Status', required=True, readonly=True,
help='* The \'Draft\' status is set when the related sales order in draft status. \
\n* The \'Confirmed\' status is set when the related sales order is confirmed. \
\n* The \'Exception\' status is set when the related sales order is set as exception. \
\n* The \'Done\' status is set when the sales order line has been picked. \
\n* The \'Cancelled\' status is set when a user cancel the sales order related.'),
In the help of state is written The 'Draft' status is set when the related sales order in draft status.
.
How is this achieved?How is the state in sale.order.line related to sale.order state field