Commit 0ec8b72
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
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
0 commit comments