-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0][ADD] web_tree_customized_field_list #623
[14.0][ADD] web_tree_customized_field_list #623
Conversation
@ilyasProgrammer can you rebase ? |
/ocabot rebase |
Sorry @elvise you are not allowed to rebase. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
c3a40cc
to
eab9c76
Compare
@elvise done |
@ilyasProgrammer please rebase :) |
a6b3e20
to
8d5aae7
Compare
b5630bc
to
131f3e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional ok!
Often a customer asks to add a field to tree view, and this requires dev time. This module allows functionals to be independent on adding fields to tree view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fix code by my comments.
131f3e1
to
6d4a936
Compare
@geomer198 Thanks for the review. Updated according to your suggestions. |
6d4a936
to
253aa8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review, only a few minor remarks.
However, I should point out that the customizations do not survive an upgrade. In other words, when any module is upgraded, the views of that module are reverted back to what is written in the XML file, and it would be necessary to press "Apply Changes" again to make them appear again (Tested on runboat)
253aa8d
to
121a7f0
Compare
Thats right. Updated description and added roadmap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with the above caveat that it may be very counterintuitive to use.
121a7f0
to
f8e89f8
Compare
class Module(models.Model): | ||
_inherit = "ir.module.module" | ||
|
||
def _button_immediate_function(self, function): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise this is an elegant way of making the changes persistent
thought: not all changes may be applied. at any given time. I'd say we could either add the active
field to the custom.list.view
model, or another boolean field to keep track of which changes need to be applied and which ones should not.
4b4725d
to
5da2f83
Compare
Code review LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check my review?
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution is not optimal.
Please change this implementation without 2 cycles. If you want remove all 'custom.list.view.line' records without field_id
value, you can use search for this. I think it's faster then you solution.
5da2f83
to
c0bf56a
Compare
ee8a1b8
to
7b0eb28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add little fix.
active = fields.Boolean(default=True) | ||
name = fields.Char(required=True) | ||
model_id = fields.Many2one("ir.model", required=True, ondelete="cascade") | ||
model_name = fields.Char(related="model_id.model", store=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what you use store
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid recompute.
cls.users_model = cls.env["ir.model"]._get("res.users") | ||
cls.view_users_tree = cls.env.ref("base.view_users_tree") | ||
|
||
def test_all_customized_list_view(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add doc string for this test method, which describe what this method do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is for tests. There is comment for each subtest and message for each assert. It is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@pedrobaeza could you merge this one? thanks! |
Being a modification of the web client, it should be prefixed with |
@pedrobaeza should it be in this repo or in OCA/web in your opinion? |
Good question... Let's keep it here as is less crowded. |
7b0eb28
to
c7cba10
Compare
c7cba10
to
fdf71f6
Compare
This PR has the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@pedrobaeza shall we go?
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at 7054737. Thanks a lot for contributing to OCA. ❤️ |
No description provided.