Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] #11337 access problem on ir.config.parameter when editing product #41

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion product_digi_sync/models/digi_sync_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def send_to_digi_directly(self):

def _get_digi_client(self):
digi_client_id = int(
self.env["ir.config_parameter"].get_param("digi_client_id")
self.env["ir.config_parameter"].sudo().get_param("digi_client_id")
)
client = self.env["product_digi_sync.digi_client"].browse(digi_client_id)
if not client.exists():
Expand Down
2 changes: 1 addition & 1 deletion product_digi_sync/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_current_barcode_rule(self):
return weighted_barcode_rule if self.is_weighted_article else piece_barcode_rule

def _get_barcode_rule(self, rule_id):
barcode_rule_id = self.env["ir.config_parameter"].get_param(rule_id)
barcode_rule_id = self.env["ir.config_parameter"].sudo().get_param(rule_id)
if barcode_rule_id:
return self.env["barcode.rule"].browse(int(barcode_rule_id))
return None
2 changes: 1 addition & 1 deletion product_digi_sync/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _prepare_barcode(barcode_pattern, shop_plucode, is_ean13):
return barcode

def _get_barcode_rule(self, rule_id):
barcode_rule_id = self.env["ir.config_parameter"].get_param(rule_id)
barcode_rule_id = self.env["ir.config_parameter"].sudo().get_param(rule_id)
if barcode_rule_id:
return self.env["barcode.rule"].browse(int(barcode_rule_id))
return None
Expand Down
Loading