diff --git a/customized_list_view/README.rst b/customized_list_view/README.rst index f1e38a51fb..a9ade938c0 100644 --- a/customized_list_view/README.rst +++ b/customized_list_view/README.rst @@ -7,7 +7,7 @@ Customized List View !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c9893aff0b66566cd1468747e95cbf4f5d20b75c921a390837f3926d34a8f0f7 + !! source digest: sha256:3a84bbcf7504991f8ea35e9c11270c99debf913dad0f53c5bc0c402e10372871 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -31,11 +31,6 @@ Customized List View Using this module you can add new fields into list views without having deep odoo technical knowledge. -WARNING - -Changes done by module (when you click Apply Changes) can be lost after modules update. -If so - need to apply list view/views changes again. - **Table of contents** .. contents:: @@ -55,11 +50,6 @@ Usage * Open list view you modified. You will see new field there. * You can click Restore Original to restore original view. -Known issues / Roadmap -====================== - -Reapply list views changes after modules update. - Bug Tracker =========== diff --git a/customized_list_view/models/__init__.py b/customized_list_view/models/__init__.py index 0d331dd29e..ede4e202c8 100644 --- a/customized_list_view/models/__init__.py +++ b/customized_list_view/models/__init__.py @@ -1,2 +1,3 @@ from . import custom_list from . import ir_ui_view +from . import ir_module diff --git a/customized_list_view/models/ir_module.py b/customized_list_view/models/ir_module.py new file mode 100644 index 0000000000..7057528f65 --- /dev/null +++ b/customized_list_view/models/ir_module.py @@ -0,0 +1,18 @@ +# Copyright 2024 ooops404 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import models + + +class Module(models.Model): + _inherit = "ir.module.module" + + def _button_immediate_function(self, function): + res = super(Module, self)._button_immediate_function(function) + views_mods = self.env["custom.list.view"].search([]) + for vm in views_mods: + for vml in vm.line_ids: + if not vml.field_id: + # field was deleted during modules operation + vml.unlink() + vm.button_apply_changes() + return res diff --git a/customized_list_view/readme/DESCRIPTION.rst b/customized_list_view/readme/DESCRIPTION.rst index 07a2c1377f..1c5c5fe946 100644 --- a/customized_list_view/readme/DESCRIPTION.rst +++ b/customized_list_view/readme/DESCRIPTION.rst @@ -1,7 +1,2 @@ Using this module you can add new fields into list views without having deep odoo technical knowledge. - -WARNING - -Changes done by module (when you click Apply Changes) can be lost after modules update. -If so - need to apply list view/views changes again. diff --git a/customized_list_view/readme/ROADMAP.rst b/customized_list_view/readme/ROADMAP.rst index 8460b4ff18..e69de29bb2 100644 --- a/customized_list_view/readme/ROADMAP.rst +++ b/customized_list_view/readme/ROADMAP.rst @@ -1 +0,0 @@ -Reapply list views changes after modules update.