Saturday, October 26, 2024
2 changes · saas-17.4
Resolved issues and error corrections
This fixes a receipt creation issue that prevented users from adding serial numbers for tracked products. Warehouse teams can now record incoming products with the required serial or lot information as expected.
Original PR description
The `use_create_lots` field was missing in the parent view after this…
The `use_create_lots` field was missing in the parent view after this https://github.com/odoo/odoo/pull/137031/commits/ecc6a3c0776501ca79604af21fd5515f74f6b7e8#diff-7a1e0a179b7361b04b4bb165dbfc18fabd2fc972ff190fbf21144db03f9b86b1L139 , causing a silent failure in the `options` condition for allowing users to create new lots/serial numbers. As a result, users were unable to add serial numbers during receipt creation because the condition `options="{'create': [('parent.use_create_lots', '=', True)]}"` was never met.
Steps to reproduce the error:
1. Create a new product with lot/serial number tracking.
2. Create a receipt for that product.
3. Try to add serial numbers to the receipt.
The expected behavior is to be able to add serial numbers, but users were blocked from doing so due to the missing field.
To resolve this, the `use_create_lots` field has been added to the parent view, ensuring that the condition for allowing lot creation works as expected.
opw-4150626
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThis fix prevents the checkout page from repeatedly refreshing when customers use discount codes while prices are shown with tax included. It ensures discount information is correctly recognized in the cart summary and avoids reload loops for shops with older templates.
Original PR description
Versions -------- - saas-17.4+ Steps ----- 1. Set website to display prices tax included; 2. have a discount code program (e.g. '10pc' on runbot); 3. add a deliverable product to cart; 4. apply…
Versions -------- - saas-17.4+ Steps ----- 1. Set website to display prices tax included; 2. have a discount code program (e.g. '10pc' on runbot); 3. add a deliverable product to cart; 4. apply discount code; 5. proceed to delivery options page. Issue ----- Endless refresh loop. Cause ----- Commit 5ba6723578af fixed an issue with updating the cart summary after a discount reward change. Part of this process is reloading the page if the rewards are no longer in sync. For this to work, it relies on the `data-reward-type` attribute being present in the summary, which isn't the case when prices are set to display tax included. The reason for this is `xpath` only adding the attribute to the first child[^1] of `website_sale_cart_summary_line_price`, which is the `price_subtotal`[^2], but misses the second element displaying the `price_total`, hence it lacks the `data-reward-type` attribute. Solution -------- Add an `xpath` node to add the attribute on the second element as well. Also update the JavaScript added in 5ba6723578af to not reload if no `[data-reward-type=discount]` elements were found, to prevent an endless refresh cycle for clients who haven't updated their templates yet. opw-4284046 [^1]: https://github.com/odoo/odoo/blob/72addc749879/addons/website_sale_loyalty/views/website_sale_templates.xml#L172-L176 [^2]: https://github.com/odoo/odoo/blob/72addc749879/addons/website_sale/views/templates.xml#L2341-L2349