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

I was trying to call a function when the page is loaded, I made some changes to the XML but none worked, for example:

field name="code">action = env['res.config.settings'].set_values()

I didn't find any viable method for odoo 14, does anyone have any suggestions?


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

Hello, André Leite

I hope you doing well.

You can use 'fields_view_get' method For call function when page is loaded.
fields_view_get method is called when once the XML code of the view is loaded.

Find Code in Comment. 

Under this method you can call your method. An it is call when fields_view_get method is called.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

อวตาร
ละทิ้ง

@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
submenu=False):
res = super(TestProject, self).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar,
submenu=submenu)
------- called you method here--------
return res

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 21
3016
2
พ.ค. 23
2642
2
ส.ค. 22
22982
2
มิ.ย. 21
4492
1
เม.ย. 25
4944