Search code examples
pythonxmlodoo-8odoo

How to use ORM methods on save button click?


i have done ORM methods worked out only when some action buttons defined in xml file. but i want to know how to do the same when the SAVE button clicks.


Solution

  • When you click the "Save" button the create method of the model is executed. Is that what you are looking for?

    If you want to run a specific method of the model, write the name of the method in the attribute name of the button. The type of the button should be object:

    <button name="method_name" type="object" string="Example" class="oe_highlight" />