Skip to content

Commit

Permalink
[MIG] price_security: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jok-adhoc committed Dec 26, 2023
1 parent e0838ab commit 2c20f88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions price_security/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Price Security',
'version': "16.0.1.0.0",
'version': "17.0.1.0.0",
'category': 'Sales Management',
'author': 'ADHOC SA, Odoo Community Association (OCA)',
'website': 'http://www.adhoc.com.ar/',
Expand All @@ -38,5 +38,5 @@
'views/res_users_views.xml',
'views/sale_order_views.xml',
],
'installable': False,
'installable': True,
}
4 changes: 2 additions & 2 deletions price_security/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def _get_view(self, view_id=None, view_type='form', **options):
fields = (arch.xpath("//field[@name='invoice_line_ids']/tree//field[@name='price_unit']")
+ arch.xpath("//field[@name='invoice_line_ids']/tree//field[@name='tax_ids']"))
for node in fields:
node.set('attrs', "{'readonly': [('parent.move_type', 'in', ('out_invoice', 'out_refund')),('product_can_modify_prices','=', False)]}")
node.set('readonly', "parent.move_type in ('out_invoice', 'out_refund') and product_can_modify_prices == False")
modifiers = json.loads(node.get("modifiers") or "{}")
modifiers['attrs'] = "{'readonly': [('parent.move_type', 'in', ('out_invoice', 'out_refund')),('product_can_modify_prices','=', False)]}"
modifiers['readonly'] = "parent.move_type in ('out_invoice', 'out_refund') and product_can_modify_prices == False"
node.set("modifiers", json.dumps(modifiers))
node.set('force_save', '1')
modifiers = json.loads(node.get("modifiers") or "{}")
Expand Down
4 changes: 2 additions & 2 deletions price_security/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def _get_view(self, view_id=None, view_type='form', **options):
+ arch.xpath("//field[@name='order_line']/form//field[@name='tax_id']")
)
for node in fields:
node.set('attrs', "{'readonly': [('product_can_modify_prices','=', False)]}")
node.set('readonly', "product_can_modify_prices == False")
modifiers = json.loads(node.get("modifiers") or "{}")
modifiers['attrs'] = "{'readonly': [('product_can_modify_prices','=', False)]}"
modifiers['readonly'] = "product_can_modify_prices == False"
node.set("modifiers", json.dumps(modifiers))
node.set('force_save', '1')
modifiers = json.loads(node.get("modifiers") or "{}")
Expand Down

0 comments on commit 2c20f88

Please sign in to comment.