Skip to content

Commit

Permalink
[FIX][ISSUE: OCA#142]product_configurator: Custom attributes don't work
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzappdev authored and dreispt committed Dec 9, 2023
1 parent da6051a commit 67eff97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion product_configurator/models/product_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def validate_custom_val(self, val):
if self.custom_type in ('int', 'float'):
minv = self.min_val
maxv = self.max_val
val = literal_eval(val)
val = literal_eval(str(val))
if minv and maxv and (val < minv or val > maxv):
raise ValidationError(
_("Selected custom value '%s' must be between %s and %s"
Expand Down
3 changes: 2 additions & 1 deletion product_configurator/models/product_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _get_custom_vals_dict(self):
if val.attribute_id.custom_type in ['float', 'int']:
custom_vals[val.attribute_id.id] = literal_eval(val.value)
else:
custom_vals[val.attribute_id.id] = val.value
custom_vals[val.attribute_id.id] = val.attachment_ids
return custom_vals

@api.multi
Expand Down Expand Up @@ -464,6 +464,7 @@ def update_config(self, attr_val_dict=None, custom_val_dict=None):
if attr_id in binary_field_ids:
attachments = [(0, 0, {
'name': val.get('name'),
'datas_fname': val.get('name'),
'datas': val.get('datas')
}) for val in vals]
custom_vals.update({'attachment_ids': attachments})
Expand Down

0 comments on commit 67eff97

Please sign in to comment.