Skip to content

Commit

Permalink
[IMP] price_security_planned_price: View cleaning
Browse files Browse the repository at this point in the history
Remove fields that used to be manipulated because they are now treated
in other module
  • Loading branch information
jok-adhoc committed Sep 1, 2023
1 parent 3be139d commit a874558
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
8 changes: 1 addition & 7 deletions price_security_planned_price/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ def _get_view(self, view_id=None, view_type='form', **options):
+ arch.xpath("//field[@name='other_currency_list_price']")
+ arch.xpath("//field[@name='other_currency_id']")
+ arch.xpath("//field[@name='sale_margin']")
+ arch.xpath("//field[@name='sale_surcharge']")
+ arch.xpath("//field[@name='replenishment_cost_type']")
+ arch.xpath("//field[@name='replenishment_cost_last_update']")
+ arch.xpath("//field[@name='replenishment_base_cost']")
+ arch.xpath("//field[@name='replenishment_base_cost_currency_id']")
+ arch.xpath("//field[@name='replenishment_cost']")
+ arch.xpath("//field[@name='replenishment_cost_rule_id']"))
+ arch.xpath("//field[@name='sale_surcharge']"))
for node in readonly_fields:
node.set('readonly', '1')
modifiers = json.loads(node.get("modifiers") or "{}")
Expand Down
8 changes: 1 addition & 7 deletions price_security_planned_price/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ def _get_view(self, view_id=None, view_type='form', **options):
+ arch.xpath("//field[@name='other_currency_list_price']")
+ arch.xpath("//field[@name='other_currency_id']")
+ arch.xpath("//field[@name='sale_margin']")
+ arch.xpath("//field[@name='sale_surcharge']")
+ arch.xpath("//field[@name='replenishment_cost_type']")
+ arch.xpath("//field[@name='replenishment_cost_last_update']")
+ arch.xpath("//field[@name='replenishment_base_cost']")
+ arch.xpath("//field[@name='replenishment_base_cost_currency_id']")
+ arch.xpath("//field[@name='replenishment_cost']")
+ arch.xpath("//field[@name='replenishment_cost_rule_id']"))
+ arch.xpath("//field[@name='sale_surcharge']"))
for node in readonly_fields:
node.set('readonly', '1')
modifiers = json.loads(node.get("modifiers") or "{}")
Expand Down
3 changes: 2 additions & 1 deletion price_security_sale_margin/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def _get_view(self, view_id=None, view_type='form', **options):
if self.env.user.has_group('price_security.group_only_view_sale_price'):
invisible_fields = (arch.xpath("//field[@name='purchase_price']")
+ arch.xpath("//field[@name='margin']")
+ arch.xpath("//field[@name='margin_percent']"))
+ arch.xpath("//field[@name='margin_percent']")
+ arch.xpath("//field[@name='margin_percent']/.."))
for node in invisible_fields:
node.set('invisible', '1')
modifiers = json.loads(node.get("modifiers") or "{}")
Expand Down

0 comments on commit a874558

Please sign in to comment.