diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-02-28 16:11:42 +0100 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-03-05 13:10:11 +0100 |
| commit | a86200597ff3e0a8fbbf3b9272f7a3b80b1f5bfe (patch) | |
| tree | dadacff1db260db7048a2a8d21f5dd2049079626 /addons/web/static | |
| parent | 3807e71801490873c1885cd71e27ac89b6d254c8 (diff) | |
[FIX] website_sale: update when changing quantity
There is several issue happening when changing quantity:
1) if website_sale_stock is installed, the displayed price is not
updated when changing quantities.
2) if the "Add to Cart" price is not updated, it erroneously displays
the price multiplied by the quantity.
3) when prices are updated, it only update attribute_value_ids.
4) when variant are displayed as list view, visually the last list item
is selected instead of the first, also changing quantity doesn't
update price as it should be given pricelist.
The first issue is caused by invalid JSON in data-attribute_value_ids
attribute. The code modify the `.data('attribute_value_ids')` thinking
it will be permanent. But if the value was invalid JSON we always parse
it on the fly inside a temporary object so the object is never changed.
The second issue is because originally, the "data-attribute_value_ids"
inside "Add to Cart" was set wrongly (when rendering the view) because
get_attribute_value_ids got the website_price multiplied by quantity.
The third issue was even with website_sale_stock is not installed
`.data('attribute_value_ids')` was only updated for one of the possible
multiple ones in the page.
With this change, we had json.dumps to ensure data-attribute_value_ids
is good JSON, and we correct errors so it is fixed for instance only
updating sources without updating website_sale and website_sale_options
modules.
note: when views are updated, this also solves a bigger issue when
python2 is used (because attribute_value_ids contained u'text' strings.
master equivalent of #23392 without js crutches for xml not updated
opw-1816479
closes #23467
Diffstat (limited to 'addons/web/static')
0 files changed, 0 insertions, 0 deletions
