Skip to content

Commit

Permalink
[IMP] product_configurator_sale: Show custom values in sale line
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech authored and dannyadair committed Feb 5, 2024
1 parent 19a7d33 commit 5e43bf7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions product_configurator_sale/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,18 @@ def _compute_price_unit(self):
else:
result = super(SaleOrderLine, line)._compute_price_unit()
return result

Check warning on line 71 in product_configurator_sale/models/sale.py

View check run for this annotation

Codecov / codecov/patch

product_configurator_sale/models/sale.py#L70-L71

Added lines #L70 - L71 were not covered by tests

def _get_sale_order_line_multiline_description_variants(self):
name = ""

Check warning on line 74 in product_configurator_sale/models/sale.py

View check run for this annotation

Codecov / codecov/patch

product_configurator_sale/models/sale.py#L74

Added line #L74 was not covered by tests
for line in self:
custom_values = line.custom_value_ids

Check warning on line 76 in product_configurator_sale/models/sale.py

View check run for this annotation

Codecov / codecov/patch

product_configurator_sale/models/sale.py#L76

Added line #L76 was not covered by tests
if custom_values:
name += "\n" + "\n".join(
[f"{cv.display_name}: {cv.value}" for cv in custom_values]
)
else:
name += super(

Check warning on line 82 in product_configurator_sale/models/sale.py

View check run for this annotation

Codecov / codecov/patch

product_configurator_sale/models/sale.py#L82

Added line #L82 was not covered by tests
SaleOrderLine,
line,
)._get_sale_order_line_multiline_description_variants()
return name

Check warning on line 86 in product_configurator_sale/models/sale.py

View check run for this annotation

Codecov / codecov/patch

product_configurator_sale/models/sale.py#L86

Added line #L86 was not covered by tests

0 comments on commit 5e43bf7

Please sign in to comment.