Hi,
I want to add a custom state "Printed" in stock.picking between "Ready to Transfer" and "Transfer".
I also want to add a button to go to this state. However, I managed to add button and I created the matching function in my python but I can't change the state of the object.
This is the code of the button action:
@api.one
def print_report_picking(self):
self.write({'state':'printed'})
and the code for adding my new item to the selection:
state = fields.Selection(
[('draft', 'Draft'),
('cancel', 'Cancelled'),
('waiting', 'Waiting Another Operation'),
('confirmed', 'Waiting Availability'),
('partially_available', 'Partially Available'),
('assigned', 'Ready to Transfer'),
('printed', 'Printed'),
('done', 'Transferred')])
Could someone tells me why my state is not updated ?