Wednesday, December 11, 2024
3 changes · saas-17.4
Resolved issues and error corrections
This fixes an error that could stop shoppers from adding products to their cart when strikethrough pricing and certain discount pricelists were enabled. The pricing calculation now passes details more reliably, helping affected online stores complete purchases normally.
Original PR description
Versions -------- - saas-17.4+ Steps ----- 1. Start a fresh database with only `website_sale` installed; 2. configure Website to show strikethrough price; 3. configure Website to let user decide on…
Versions
--------
- saas-17.4+
Steps
-----
1. Start a fresh database with only `website_sale` installed;
2. configure Website to show strikethrough price;
3. configure Website to let user decide on "Add to Cart";
4. create a pricelist with a discount based on another pricelist;
5. have discount apply to all product categories;
6. make pricelist selectable;
7. go to /shop;
8. add a product to cart.
Issue
-----
> ```
> AssertionError:
> Invalid value res.currency(1,) in domain term ('date_end', '>=', res.currency(1,))
>```
Cause
-----
PR https://github.com/odoo/odoo/pull/181014 changed how versions 17.4+ display strikethrough prices for discount rules.
In doing so, it added a call to `_compute_price_before_discount`, passing the parameters positionally.
The problem is that not all helper functions used in the process accept these arguments in the same order, specifically:
https://github.com/odoo/odoo/blob/4c68ce24eaf4e1b431485a3bdcd55ca0064c0ae0/addons/product/models/product_pricelist_item.py#L521
https://github.com/odoo/odoo/blob/4c68ce24eaf4e1b431485a3bdcd55ca0064c0ae0/addons/product/models/product_pricelist.py#L161-L164
Solution
--------
Name the arguments, so that they get passed as `**kwargs` instead of `*args`.
opw-4366956Point of Sale orders marked for later shipping can now be validated when the Belgian blackbox integration is enabled. This removes a blocking error at checkout, helping stores complete sales that require delivery at a future date.
Original PR description
Currently, when using `pos_blackbox_be`, if you make an order to be shipped later, you cannot validate your order. Steps to reproduce: ------------------- * Install `pos_blackbox_be` * Set up the blackbox on the pos store * Configure the shop to allow shipping later * Open shop * Make an order * Select customer and ship for a later date * Select payment method and try to validate > Observation: Error message: Modifying registered orders in not allowed Why the fix: ------------ The error is trigerred by a write operation on a `pos.order` record. The field that is being modified is not in the list of white listed fields https://github.com/odoo/enterprise/blob/ade74c4ebecc1d78fe9cd4a4301b332cb79fc6db/pos_blackbox_be/models/pos_order.py#L89-L97 By passing `backend_recomputation=True` in the context we bypass the check of whitelisted fields. It allows to fix without having to modifying the blackbox code. opw-4369744
Portal users can now save their account information even when their related company does not have a country set. This prevents an internal server error and keeps the self-service account page usable in simpler contact setups.
Original PR description
Reproduce --- 1. Set a fresh database, with just Website and Contacts apps installed. 2. Enable Developer Mode. 3. Create a new Internal User of type Portal, save and set a password. 4. In the Contacts app, create a new contact of type company and save. 5. Navigate to the automatically created contact of the Portal User we just created (at step 3). 6. Set the parent_id (Related Company) of this user contact to be the company contact we just created (at step 4) and save. 7. Log in with the Portal User we created (at step 3). 8. Navigate to /my/home and click Edit information (/my/account). 9. Without making any changes to the form (or even with changes, it's the same), click SAVE, 500: Internal Server Error will appear and the log will be opw-4335353