Skip to content

Commit

Permalink
[FIX] brand: Pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed May 1, 2024
1 parent 27e21a7 commit 0b94285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions brand/models/res_brand_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def _onchange_brand_id(self):

def _get_view(self, view_id=None, view_type="form", **options):
"""set visibility and requirement rules"""
print("_get_view")
arch, view = super()._get_view(view_id, view_type, **options)
if self.env["res.brand"].check_access_rights("read", raise_exception=False):
if view.type in ["form", "tree"]:
brand_node = next(
iter(
arch.xpath(
'//field[@name="brand_id"][not(ancestor::*[@widget="one2many" or @widget="many2many"])]'
'//field[@name="brand_id"][not(ancestor::*'
'[@widget="one2many" or @widget="many2many"])]'
)
),
None,
Expand Down

0 comments on commit 0b94285

Please sign in to comment.