1

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()</field>

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

arleite
  • 101
  • 6

1 Answers1

1

I would try custom view or custom widget. When they are started they can call server function.

For starters.

How to create new widget: https://www.odoo.com/documentation/15.0/developer/reference/frontend/javascript_cheatsheet.html#creating-a-new-field-widget

Or extending a wiev:

https://www.odoo.com/documentation/15.0/developer/reference/frontend/javascript_cheatsheet.html#customizing-an-existing-view

Paxmees
  • 1,540
  • 1
  • 15
  • 28