Daily updates from Odoo
Navigate
Branch
Friday, March 2, 2018
2 changes
Enhancements to existing features
Product labels now format prices more appropriately for currencies that do not use decimals or place the currency symbol after the amount. This makes printed labels clearer and more consistent for customers and staff across different currencies.
Original PR description
…s without decimals or having symbol after price) Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Fixes several online shop issues where changing product quantities could show outdated or incorrectly multiplied prices, especially with stock checks or product variants. This helps customers see accurate pricing before adding items to their cart, reducing confusion and checkout errors.
Original PR description
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…
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
opw-1816479