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 27, 2023
1 parent e0838ab commit 6cfe9bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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
2 changes: 1 addition & 1 deletion price_security/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_discount_restriction_all,discount_restriction_all,model_res_users_discount_restriction,,1,0,0,0
access_discount_restriction_all,discount_restriction_all,model_res_users_discount_restriction,base.group_user,1,0,0,0
access_discount_restriction_manager,discount_restriction_manager,model_res_users_discount_restriction,base.group_erp_manager,1,1,1,1

0 comments on commit 6cfe9bb

Please sign in to comment.