Monday, April 8, 2024
34 changes
Resolved issues and error corrections
When creating a purchase order with a product that has multiple vendor options, the product description was incorrectly showing information from all vendor lines instead of just the selected vendor. This fix ensures the product description displays only the information from the specific vendor chosen for that purchase order.
Original PR description
Currently, when creating a purchase order, if the product has multiple vendor lines (with the vendor selected on the PO), the product description uses information from all the vendor lines; instead…
Currently, when creating a purchase order, if the product has multiple vendor lines (with the vendor selected on the PO), the product description uses information from all the vendor lines; instead of using information from the vendor line that is used for the price.
Steps to reproduce:
-------------------
* Go to the **Purchase** App
* Go to **Products**
* Select any product
* Select the **Purchase** tab
* Add `Vendor Product Name` and `Vendor Product Code` in additional line fields
* Add two vendor lines
* Line 1:
`Vendor`: Vendor1
`Vendor Product Name`: P1
`Vendor Product Code`: A
`Price`: 1
* Line 2:
`Vendor`: Vendor 1
`Vendor Product Name`: P1 bis
`Vendor Product Code`: B
`Price`: 5
* Select **Orders** > **Request for quotation**
* Create a new quotation
* Select Vendor 1, add the product for which we just added the two vendor lines
> **Observation**: The description of the product shows information from both vendor lines added.
Why the fix:
------------
This behavior was introduced when `name_get` was removed to use `dispay_name` instead.
* https://github.com/odoo/odoo/pull/122085/commits/a8b15c7ab5e2d850d0551a6eb4213bb20a30b210
* https://github.com/odoo/odoo/pull/122085/commits/a8b15c7ab5e2d850d0551a6eb4213bb20a30b210
When adding a product to the purchase order, the onchange on `product_id` is called. The onchange calls the function `_product_id_change`, which itself calls `_get_product_purchase_description`. https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1224 https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1401-L1407
The line `name = product_lang.display_name` calls the function `_compute_display_name`.
* We do have a parnter_id in the context as we have selected a vendor on the purchase order. https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L434
* We don't have a supplierinfo in the context yet but we have multiple supplierinfo with the same partner_id. https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L466-L467 Here we thus have 2 sellers.
* Ultimately, the display name joins the different display names computer for each seller. https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/product/models/product_product.py#L473-L483
Coming back to the line `self.name = self._get_product_purchase_description(product_lang)`, we now have the name of the purchase order line set as the concatenation of display names from the supplierinfo, i.e `'[A] P1, [B] P1 bis'`.
Once the onchange is called, the function `_compute_price_unit_and_date_planned_and_name` is being called. https://github.com/odoo/odoo/blob/7e9b9494a8d6c4bb8b3800cc0e25fcd3596db75d/addons/purchase/models/purchase.py#L1295-L1302 In the current state, we do not meet the if condition. Indeed, the line has a name (`'[A] P1, [B] P1 bis'`) but it isn't in the default_names (`['[A] P1', '[B] P1 bis']`). It somehow corresponds to a setting where the name of the purchase order line was setup by the user.
With this current fix, the call to `_product_id_change` will set the name of the line with the product information from the company; and not the partner/seller. We also need to add this name to the `default_names` in `_compute_price_unit_and_date_planned_and_name` so that the description gets recomputed with regards to the seller, if any.
I tested the scenario where:
* The second supplierinfo has a smaller unit price when buying 10 products. On the sale order line, when I set the quantity to 20, the unit price is updated as well as the description. The description is updated as `line.name` is indeed in `default_names`.
opw-3802182
Forward-Port-Of: odoo/odoo#158398Fixed an issue where clicking the "Go to Website" button from the backend was incorrectly redirecting users to the website homepage instead of the specific course, event, or slide page. This problem occurred when users were accessing the system from a different domain than the configured base URL. The fix ensures users are taken to the correct page they intended to view.
Original PR description
How to reproduce: - Install website_slides with demo data - Log in from localhost - Log in from dev.localhost - Switch to localhost - (The system property web.base.url is http://dev.localhost:8069…
How to reproduce: - Install website_slides with demo data - Log in from localhost - Log in from dev.localhost - Switch to localhost - (The system property web.base.url is http://dev.localhost:8069 but we are on localhost) - Go to a course in the back end and click on “Go to website” button You are redirected to the frontend website home page instead of the course home page. This fix solves the problem. Afer correcting this error for the courses (slide.channel), we have found the same problem for: - event.sponsor - event.meeting.room - slide.slide So we apply the same correction for them. Technical note: the button "Go to website" uses the open_website_url method of WebsitePublishedMultiMixin that relies on website_url. That method expects a relative URL in the computed field website_url and not an absolute one (actually, the method already handle adding the website domain, so it expect the relative part). The problem is that the compute method for the field website_url of channel compute an absolute URL. The consequence is that the user is redirected to the home page instead of the course page (by WebsitePreview, see get path method). In stable, we cannot change easily website_url to make it relative as it is used in other of places (ex.: if we make it relative the share link in the sidebar on the frontend is relative which is not correct and in mail template, the URL might not be correct as the mail system append the default domain for relative URLs). So instead, we override open_website_url to use a relative URL when the website is not defined. If the website is defined on the course, we call the super implementation because a domain change might be required. Note that by doing that, we duplicate the code of _compute_website_url in open_website_url but making the URL relative instead of absolute. So we should clean that in master. Task-3635856 Forward-Port-Of: odoo/odoo#160114 Forward-Port-Of: odoo/odoo#148103
Portal users who are subcontractors were incorrectly seeing unpublished products in the online shop. This fix ensures that portal users can only view published products, while still maintaining their access to subcontracting features. The change prevents unpublished products from appearing in shop searches and listings for non-internal users.
Original PR description
### Steps to reproduce: - Activate Subcontracting in the settings. - Create a storable product - Create a BOM of type "subcontracting" where the subcontractor is a Portal user (e.g. Joel Willis) for…
### Steps to reproduce: - Activate Subcontracting in the settings. - Create a storable product - Create a BOM of type "subcontracting" where the subcontractor is a Portal user (e.g. Joel Willis) for that product. - Log out and connect as your portal user. - Go to the website shop and search your product. ### Expected behavior: The portal user should only be able to see the published products. ### Current behavior: The portal user sees unpublished products for which he is subcontractor. ### Cause of the issue: The commit 99b56ec has introduced a subcontracting portal. In order for portal users to be able to interact with product templates, the following rule was added to the "base.group_portal": https://github.com/odoo/odoo/blame/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/mrp_subcontracting/security/mrp_subcontracting_security.xml#L120-L131 When you go to the website shop, the records displayed in the shop will be computed here: https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/controllers/main.py#L348 https://github.com/odoo/odoo/blob/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/website/models/mixins.py#L353-L357 However, during this call, the "ir.rule" added for portal users will be added to the SQL query here: https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/odoo/models.py#L4682 As such, products (enven if unpublished) for which the portal user is a subcontractor will be fetched and displayed in the shop. ### Fix: Since the "ir.rule" can not be changed only for flows involving the `website_sale` application, we propose to make a change similar to commit b1f6171 whose purpose is to hide unpublished products for non internal users: https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/models/product_template.py#L105-L108 opw-3768845 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#159420
This update fixes an issue preventing SMS messages from being sent to partners with mobile phone numbers from Panama. The fix addresses a compatibility problem with the phone number validation library by applying a targeted patch to recognize Panama's updated mobile phone number format.
Original PR description
Current behavior:
---
Cannot send SMS to a partner that has a mobile phone number from Panama.
Steps to reproduce:
---
```python
# 6198 5462 is a valid phone number
parsed = phonenumbers.parse('6198 5462', region='PA')
is_valid = phonenumbers.is_valid_number(parsed)
is_valid == False
```
Cause of the issue:
---
Old versions of phonenumbers (external library) are not updated
to Panamas mobile phone numbers system change.
Fix:
---
Monkey patched the library
Similar as: https://github.com/odoo/odoo/commit/b21df8797141dac9f2cf0315658a08a238849f5b
opw-3682631
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#159970
Forward-Port-Of: odoo/odoo#156969This fix prevents users from changing a product's type when there are pending inventory transactions in their company. Previously, users could bypass this restriction in multi-company setups, which could cause data integrity issues. The fix ensures proper access controls are applied regardless of company configuration.
Original PR description
Description of the issue/feature this PR addresses: Without sudo, an user in a company can change the type even if somes not done stock.move.line exists. @amoyaux --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix corrects how the HSN (Harmonized System of Nomenclature) field displays on sales orders when your company uses multiple localizations. Previously, the HSN field would appear regardless of which localization was active. Now it only shows when relevant to the current localization, matching the behavior of other reports like purchase orders and invoices.
Original PR description
Don't show HSN value for sale.order not linked to this localization. Before this commit, if you have multi company with multi localization, you see this field whatever the current localization. It uses the same condition than other report: purchase/invoice/... Forward-Port-Of: odoo/odoo#160766
This fix resolves an issue where scanning a different product in the barcode app during picking would lose the connection to the original sales order. When creating backorders, new products weren't being properly linked to their sales orders. The fix ensures that product movements are correctly associated with their procurement groups, maintaining the relationship between picked items and customer orders.
Original PR description
Steps to reproduce: - Confirm an SO with a storable product - in barcode app open the created picking - Scan a different product confirm the picking and create a backorder Bug: the new product is not added to the SO and the original picking isn't linked the SO anymore Fix: when new moves are created in the inventory app default_picking_id is set in the context and is used in _default_group_id to set the group set the context key during the write to ensure moves are created with the correct group test: https://github.com/odoo/enterprise/pull/57408 opw-3644773 Forward-Port-Of: odoo/odoo#160596 Forward-Port-Of: odoo/odoo#157255
This fix prevents users from accidentally editing kit product quantities directly in the inventory system. Previously, when managing inventory for kit products (products made up of components), the system would allow direct editing of the kit quantity even though only component quantities should be adjustable. Now the system enforces this rule, ensuring inventory data stays consistent.
Original PR description
Steps to reproduce: - Create a storable kit product - Update on hand quantity: only the components are displayed(correct behavior) - In Inventory tab open Inventory Adjustement - Possible to edit kit quantity Bug: In the product tab when trying to update qty the kit product is replaced with its components instead but it is still Possible to edit kit quantity directly in the inventory app Fix: introduced python constraint to prevent user from directly editing the kit product qty opw-3681703 Forward-Port-Of: odoo/odoo#160787 Forward-Port-Of: odoo/odoo#157061
This update corrects how URL fields display links in the web interface. Previously, the system didn't properly detect when to add the necessary prefix to URL values, which could result in broken or incorrectly formatted links. This fix ensures that all URL fields now display and function correctly.
Original PR description
Before this commit, we didn't correctly detect when to prefix the value of an url field for the href of its link. 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 Forward-Port-Of: odoo/odoo#160623 Forward-Port-Of: odoo/odoo#160536