vbt
vbt

Reputation: 805

odoo button definition not working before setting value to a mandatory field

I have a button say 'calc_val' when I click on the button I had to pass values to a mandatory field.But my button definition is not working while the mandatory field is empty.Only if I put some values to the mandatory field and after when I click on the button , the button works.The whole thing is in a 'wizard' Please help.Thanks in advance.

Upvotes: 0

Views: 481

Answers (3)

vbt
vbt

Reputation: 805

I have done this by removing the mandatory field and then adding a validation while clicking on the final button in the wizard (For not keeping the mandatory field empty). If any other answers are available,feel free to post.Thanks

Upvotes: 0

Avani Somaiya
Avani Somaiya

Reputation: 348

Hello, vbt

You have to set some default value in that specific field. After set default value, you can use that button behavior. And if you want to change that value, they can change also.

May Help this answer. Thank you.

Upvotes: 1

Akshay
Akshay

Reputation: 649

Because in odoo after clicking on any button create or write function called before executing the working function of your button and for create and write you have to fill mandatory fields thats why you have to fill mandatory fields before executing any button functionality.

Upvotes: 1

Related Questions