Community mailing list archives

community@mail.odoo.com

Re: attrs not "behaving" properly

by
Togar Hutabarat
- 06/09/2016 12:24:26
Hi Luis,

Well, if you want it to be filled/populated before you send the quotation, you should make the field being required when it is NOT sent yet. Thus, by assuming you haven't override field state, your attrs should be: attrs="{'required':[('state','=','draft')]}". Hope it works.

Happy coding!

On Thu, Jun 9, 2016 at 11:16 PM, Luis Panozzo <luis.panozzo@elmatica.com> wrote:
I have a quotation that I need to send via email.
There is a field I want to make sure is populated before my customer gets the quotation
So the field has the following
attrs="{'required':[('state','=','sent')]}"

But the system still allows me to send and therefore the state changes without enforcing the condition.
Can anyone tell me what I am doing incorrect. 

BTW, the following has worked perfectly ok in the Opportunities flow (where we have several intermediate stages):
attrs="{'required':[('stage_id','=',9)]}"
Thank you in advance

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe