Community mailing list archives

community@mail.odoo.com

Re: attrs not "behaving" properly

by
Elmatica AS, Luis Alberto Panozzo
- 06/09/2016 13:10:04
Well, that is not exactly what I had in mind but thinking about it I you may have a point.
I tried it and it fits the task.
Thank you for sharing your thoughts, Togar


Luis Panozzo (Lp)
Technology Manager
Elmatica AS
luis.panozzo@elmatica.com
Skype: luispanozzo

On 9 June 2016 at 18:27, Togar Hutabarat <togarhutabarat80@gmail.com> wrote:
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


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