Skip to content

Commit 0ec8b72

Browse files
committed
[FIX] sale: prevent error on clicking Edit Configuration on a combo
Currently, when a user adds a combo to an order line, and remove the name of combo and click on Edit Configuration (pencil icon) error is encountered. Steps to replicate: - Install `sale_management` with demo and create a new SO. - Add a combo product and remove the combo name and click Edit Configuration (pencil icon). Error: `TypeError: SaleProductConfiguratorController.sale_combo_configurator_get_data() missing 1 required positional argument: 'product_template_id'` Cause: - When a user clicks on Edit configuration, the client-side JavaScript makes an RPC call to the server, targeting the `sale_combo_configurator_get_data()` which expects `product_template_id` at [1] and since it is removed from order line the error is encountered. Solution: - Changed the content of method `isCombo()` to use the product_template_id to make sure the Edit Configuration is only visible when product template is present. Similar PR for reference: odoo#217464 [1]: https://github.com/odoo/odoo/blob/fa4307b9758800f26c9ee87cf3698fd60bfd1ab5/addons/sale/controllers/combo_configurator.py#L12-L14 No ID closes odoo#239755 X-original-commit: d1ab74a Signed-off-by: Louis Tinel (loti) <loti@odoo.com> Signed-off-by: Bhavya Ashesh Nanavati (bhna) <bhna@odoo.com>
1 parent bd275b4 commit 0ec8b72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/sale/static/src/js/sale_product_field.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class SaleOrderLineProductField extends ProductLabelSectionAndNoteField {
116116
return this.props.record.data.is_configurable_product;
117117
}
118118
get isCombo() {
119-
return this.props.record.data.product_type === 'combo';
119+
return this.props.record.data.product_template_id && this.props.record.data.product_type === 'combo';
120120
}
121121
get isDownpayment() {
122122
return this.props.record.data.is_downpayment;

0 commit comments

Comments
 (0)