Skip to content

Commit

Permalink
[ADD] customized_list_view
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Feb 22, 2024
1 parent f8e89f8 commit 4b4725d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
12 changes: 1 addition & 11 deletions customized_list_view/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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::
Expand All @@ -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
===========

Expand Down
1 change: 1 addition & 0 deletions customized_list_view/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import custom_list
from . import ir_ui_view
from . import ir_module
18 changes: 18 additions & 0 deletions customized_list_view/models/ir_module.py
Original file line number Diff line number Diff line change
@@ -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([])

Check warning on line 11 in customized_list_view/models/ir_module.py

View check run for this annotation

Codecov / codecov/patch

customized_list_view/models/ir_module.py#L10-L11

Added lines #L10 - L11 were not covered by tests
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

Check warning on line 18 in customized_list_view/models/ir_module.py

View check run for this annotation

Codecov / codecov/patch

customized_list_view/models/ir_module.py#L16-L18

Added lines #L16 - L18 were not covered by tests
5 changes: 0 additions & 5 deletions customized_list_view/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion customized_list_view/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
Reapply list views changes after modules update.

0 comments on commit 4b4725d

Please sign in to comment.