Solution 0
@api.multi def check_tax_id(self): self.ensure_one() self.name = "New name" return { "type": "ir.actions.do_nothing", }
This decision was provided here by Tadeusz Karpinsky.
Solution 1
You can return a new form with the same record ID.
@api.multi def check_tax_id(self): self.ensure_one() self.name = "New name" return { 'context': self.env.context, 'view_type': 'form', 'view_mode': 'form', 'res_model': 'model_name', 'res_id': self.id, 'view_id': False, 'type': 'ir.actions.act_window', 'target': 'new', }
Decision 2
You can create a widget in jQuery. This will open the wizard, and you can assign the behavior you want for the buttons manually. You can use the call function to call python functions:
[...] new instance.web.Dialog(this, { title: _t("Title"), width: '95%', buttons: [ { text: _t("First button"), click: function() { self.first_button(); }}, { text: _t("Second button"), click: function() { self.second_button(); }}, { text: _t("Close"), click: function() { dialog.close(); }}, ], }); [...]
Decision 3
Of course, you can also override the create method to avoid creating an entry in some cases.
Decision 4
The last parameter. Create a workflow with a status field. Create workflow buttons to send alerts for status changes. You can show or hide the rest of the fields using the attrs attribute and the status field. But I do not know if this will fit your needs.
Chesucr
source share