Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2455 มุมมอง

how to generate approvals to change status?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง