Skip to Content
Menu
This question has been flagged
2 Replies
1970 Views

how to generate approvals to change status?

Avatar
Discard
Best Answer

HI,

If it is needed in your custom module, you can directly add the new buttons in the header of the form as follows:

See: https://ibb.co/Wsy6Gny

Also you can control the button visibility based on the state of based on the user group. 

Then you have to define a function, that will get executed on clicking the button,

def action_confirm(self):
self.state = 'confirm'

Thanks

Avatar
Discard
Best Answer

Hi,

Try add the button code on xml to get a button view in needed form.

< form>
< header>
< button name="get_approval" string="Approval" type="object" class="oe_highlight"/>
< /header>
< /form>

and just add the function in the .py file for changing state in the button click,

def get_approval(self):      
 self.state = 'changing_state'

You can also refer the following apps for approval purpose.

https://apps.odoo.com/apps/modules/13.0/account_payment_approval/

https://apps.odoo.com/apps/modules/13.0/invoice_multi_approval/

If you are using an enterprise edition then you have the option to configure the approvals using the studio module.

https://www.odoo.com/event/odoo-experience-2020-2622/track/studio-approvals-and-workflows-3908

Regards

Avatar
Discard