Skip to Content
मेन्यू
This question has been flagged
2 Replies
4169 Views

How can you define a filed so that it is required before confirming a quotation turning it into a Sales Order? 

I would like to make certain fields on a quotation mandatory but only if you are hitting confirm to change it into a sales order. When applying the condition of required if state equals Sales Order it does not block the creation of the sales order and rather the field becomes required once it is in the Sales Order state already.

Avatar
Discard

This can be done using Automated Actions to display an error if fields are not set when confirming a Quotation.

@Chris I would greatly appreciate if you could give an example on how to write an automated action if a field on a task is not filled out.


See my answer. Also, if you ANSWER a question, only the OP gets a notification. Better to comment on the OP's post or ask your own question. I converted your answer to a comment.

Best Answer

"We would like to require a Project Name on all Sales Orders, but we often don't know until the Customer is ready to confirm, so can we force something only when Users are ready to confirm the Sales Order?"


Avatar
Discard
Best Answer

attrs param of XML will not work in this case.
override the write method and based on state and fields value raise the validation error

ref: https://github.com/odoo/odoo/blob/13.0/addons/account/models/account_move.py#L1658-L1659

Avatar
Discard