Technical архів поштової розсилки


Call function method from code (odoo 11)

Gaston Pablo
- 02.08.2019 17:28:54

I have a button that calls a method, so I need to call this method from code but, when I click the button odoo saves the record before de method execution. When I execute the method directly from the code odoo not saves the record, so I get an error because the record is not saved.

How can I call the save funcion before a method execution? In both cases, create or write. Is there any "save" function? or... How can I execute a button click from code?