diff --git a/edit_save_button/__manifest__.py b/edit_save_button/__manifest__.py index ffeb6be47..61122c8ef 100644 --- a/edit_save_button/__manifest__.py +++ b/edit_save_button/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Edit Button In Odoo16', - 'version': '16.0.1.0.4', + 'version': '16.0.1.0.5', 'summary': 'Edit Button Odoo16', 'description': 'Edit Button in Odoo16', 'author': 'Cybrosys Techno Solutions', diff --git a/edit_save_button/doc/RELEASE_NOTES.md b/edit_save_button/doc/RELEASE_NOTES.md index 462296779..06aa89ebb 100644 --- a/edit_save_button/doc/RELEASE_NOTES.md +++ b/edit_save_button/doc/RELEASE_NOTES.md @@ -21,3 +21,9 @@ #### Fix - Bug fixed +#### 15.06.2024 +#### Version 16.0.1.0.5 +#### Fix +- Save button failure in email templates form view fixed. +- Switching to readonly mode while data evaluation failed is fixed. + diff --git a/edit_save_button/static/src/views/form/form_controller.js b/edit_save_button/static/src/views/form/form_controller.js index 4cf032af7..d1f818681 100644 --- a/edit_save_button/static/src/views/form/form_controller.js +++ b/edit_save_button/static/src/views/form/form_controller.js @@ -24,20 +24,22 @@ patch(FormController.prototype, "save",{ }, async edit(){ - this._super(); + await this._super(); await this.model.root.switchMode("edit"); }, async saveButtonClicked(params = {}){ - this._super(); - if (!this.env.inDialog){ + let saved = await this._super(); + if (saved) { + if (!this.env.inDialog) { await this.model.root.switchMode("readonly"); + } else { + await this.model.actionService.doAction({ type: 'ir.actions.act_window_close' }); } - else { - this.model.actionService.doAction({type: 'ir.actions.act_window_close'}); - } + } + return saved; }, async discard(){ - this._super(); + await this._super(); if (!this.env.inDialog){ await this.model.root.switchMode("readonly"); }