i want to generate a new Sale Order No. (Sequence) when a user press Confirm button on the Quotation screen.
which field will be updated and what value updated when user Confirm it so i can use it in Automated Action - On Update to generate the sequence for this confirmed order.
please also help to write Python Code to execute to generate new Sequence No.
regards
i have done as below, please advise:
1) created a custom field = x_confirm_sale_order_seq in sale.order
2) created a sequence (copied sale.order sequence & modified as required)
3) created an Automated Action (Trigger: On Update - Trigger Field: state)
Python Code:
if record.state == 'sale':
if not record.x_confirm_sale_order_seq:
seq = env['ir.sequence'].next_by_code('sale.order.confirm.seq')
record.write({'x_confirm_sale_order_seq': seq})
when trying to Confirm in Quotations it is showing error:
ValueError: class 'ValueError': "invalid literal for int() with base 10: 'S000026'"
the sequence i have created as below:
Name: Sales Order Confirm Seq
Sequence Code: sale.order.confirm.seq
Sequence Size: 6
Steps: 1
Prefix: S
Next Number: 25
regards