Skip to content

Commit f51fb60

Browse files
committed
[FIX] price_security_sale_margin: enhance view cache key handling and update invisible fields logic
1 parent 91d4818 commit f51fb60

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

price_security_sale_margin/models/sale_order.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ def _get_view(self, view_id=None, view_type="form", **options):
3232
node.set("invisible", "1")
3333
modifiers = json.loads(node.get("modifiers") or "{}")
3434
modifiers["invisible"] = True
35+
node.set("column_invisible", "1")
36+
modifiers["column_invisible"] = True
3537
node.set("modifiers", json.dumps(modifiers))
3638
return arch, view

price_security_sale_margin/models/sale_order_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _get_view_cache_key(self, view_id=None, view_type="form", **options):
2121
@api.model
2222
def _get_view(self, view_id=None, view_type="form", **options):
2323
arch, view = super()._get_view(view_id, view_type, **options)
24-
if view_type == "tree":
24+
if view_type == "list":
2525
if self.env.user.has_group("price_security.group_only_view"):
2626
readonly_fields = (
2727
arch.xpath("//field[@name='purchase_price']")

0 commit comments

Comments
 (0)