Tuesday, September 10, 2024
37 changes · saas-17.2
Enhancements to existing features
This update modernizes the automated tests for the Project Enterprise app by moving older test cases to the newer testing approach. It helps maintain product quality and makes future changes easier to validate, without changing day-to-day user workflows.
Original PR description
Purpose of this PR: Convert all the legacy qunit testcases using `mail_test_helpers` to hoot. Part of: [3818666](https://www.odoo.com/odoo/project/1519/tasks/3818666?cids=2)
The HR module's automated tests were converted to a newer testing framework. This improves maintainability and reliability of internal quality checks without changing user-facing HR functionality.
Original PR description
This PR aims to convert QUnit tests which rely on hr/test_utils to hoot. Part of Task-3818666 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update adds basic automated checks for canned responses in the Mail app. These tests help catch permission or behavior issues earlier, reducing the risk of regressions in future updates.
Resolved issues and error corrections
Recurring products with only one subscription plan now correctly show their comparison price on the eCommerce product page. This restores the crossed-out reference price, helping shoppers see the intended discount or price comparison before buying.
Original PR description
### Steps to reproduce: - Install eCommerce and Subscription modules - Create a recurring product - Add a comparison price in the product's form - Have only one plan for the recurrence - Go to the product's page in eCommerce ### Current behavior before PR: If you set a comparison price for a recurring product that has only one plan it won't be shown at the product's page in eCommerce this starts happening after this commit https://github.com/odoo/enterprise/pull/53591/commits/325e9fa35486b1fa0c3622e93eef5eac54b22cf1 ### Desired behavior after PR is merged: We are now showing the striked price if we only have one plan for recurrency. opw-3990890
Miscellaneous changes
The stepDelay argument in the l10n_co_edi_website_sale tour tests fails when loading the js for the tours https://runbot.odoo.com/web/#id=77298&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form Forward-Port-Of: odoo/enterprise#69732
Original PR description
The stepDelay argument in the l10n_co_edi_website_sale tour tests fails when loading the js for the tours https://runbot.odoo.com/web/#id=77298&menu_id=424&cids=1&action=573&model=runbot.build.error&view_type=form Forward-Port-Of: odoo/enterprise#69732
Installing Point of Sale with demo data could fail when Barcode had already been installed because the demo tax setup lacked a matching tax group for the active company. This fix adds the required demo tax group fallback so the installation completes successfully in that scenario.
Original PR description
### Steps to reproduce: - Create a fresh db with demo data - Activate the "stock_barcode" module - Activate the "point_of_sale" module #### > Error: operation cannot be completed ### Cause of the…
### Steps to reproduce: - Create a fresh db with demo data - Activate the "stock_barcode" module - Activate the "point_of_sale" module #### > Error: operation cannot be completed ### Cause of the issue: Activating the "stock_barcode" module will create a second company. When you activate point of sale with the demo data, it will first install accounting and create a tax group for company 2 and then create the pos demo data: https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/point_of_sale/data/point_of_sale_demo.xml#L74-L78 However, during since no tax group is specified for this account.tax, it is expected to be computed here: https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/account_tax.py#L221-L222 But since no tax group was created for the current company, this computation will fail to give a result https://github.com/odoo/odoo/blob/42fa237296f9b1fa556ae310b3273f863420e659/addons/account/models/account_tax.py#L232-L235 and the transaction will be aborted. ### Fix: We create a tax group demo data that will be associated to the same company as the one for which our demo tax is created and hence provide a fall back value in case no other tax group was created. opw-4141575 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fixes how action aliases are shown in URL paths so they no longer include an unwanted underscore. The change helps keep navigation links cleaner and more consistent for users and integrations.
Original PR description
…ndercore 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
Restaurant point-of-sale order buttons now show only the most relevant product category when a product belongs to multiple categories. This avoids confusing duplicate category labels and makes order information clearer for staff.
Original PR description
Steps to reproduce : - Install pos_restaurant - Go to products - Set 2 pos_categories in a product - Open restaurant and add that product to order Issue : Both categories will be shown in order button and also not in correct sequence. Cause : Trying to show all categories and not the dominant once. Fix : Showing only the dominant once to make it more relatable. task: 3976224
This fix prevents an error from appearing in Odoo logs when users open Accounting settings with the Mexican localization installed in a replicated database setup. It adjusts when configuration view changes are applied so the settings page remains stable during testing and read-only operations.
Original PR description
To reproduce: - Launch Odoo instance with the option --db_replica_host='' - Install l10n_mx - access Settings > Accounting - You'll get the error in the log The Issue During testing, attempting to modify a field's state using the 'get_views' function, which is marked as read-only, results in a read-only error. The Fix: To resolve this, apply changes only when we are not in test mode and ensure the view is initially imported as inactive. runbot-60422 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
This commit adds an additional step when aggregating the values for sending invoice CFDI, and ensures the final result to be within the allowed maximum rounding error of `0.01`. Purpose: When creating an invoice with the following amounts: - line 1: 505.0, tax_16 - line 2: 495.0, tax_16 - line 3: 475.0, tax_16 - set tax_16.price_include to True The CFDI result of the invoice when generated using "round globally" method on either normal or global sending will be rejected by the
Original PR description
This commit adds an additional step when aggregating the values for sending invoice CFDI, and ensures the final result to be within the allowed maximum rounding error of `0.01`. Purpose: When…
This commit adds an additional step when aggregating the values for sending invoice CFDI, and ensures the final result to be within the allowed maximum rounding error of `0.01`. Purpose: When creating an invoice with the following amounts: - line 1: 505.0, tax_16 - line 2: 495.0, tax_16 - line 3: 475.0, tax_16 - set tax_16.price_include to True The CFDI result of the invoice when generated using "round globally" method on either normal or global sending will be rejected by the mexican authorities. This is caused by an inherent flaw of how Odoo calculates line amounts. The `compute_all` method in taxes rounds all the lines in cfdi_values to 2 digits precision in the final result, resulting in a loss of precision when calculating the total amounts. The mexican authorities requires us to make sure that: 1. the sum of the base/tax amounts in the lines (Conceptos) matches the total 2. the rounding of the total base and tax amount to be within 0.01 rounding error In the provided example, in Odoo, we will generate a total of 1271.54 base amount and 203.46 tax amount. This is not acceptable by the mexican government because 1271.54 * 0.16 equals 203.4464, which when compared with our result of the tax amount exceeds the maximum allowed rounding error. To fix this, we have to sacrifice our correctness and generate amounts that will have disrepancies whenever we need it (for global rounding method). We will now re-calculate the base and tax amounts in `cfdi_values` based on the total amount and generate new amounts with 6 digits precision, and apply that on each line of Conceptos. The 2 digit rounding precision limit on `Importe` and `ValorUnitario` XML will be changed to 6 digits to make sure we pass the first requirement, as the mexican authorities will also calculate their total and check if it matches our total. Due to this change, all of the test files than contain this element needs to be udpated too. task-id: 4071712 Forward-Port-Of: odoo/enterprise#68319
Current behaviour: --- Ivory Coast phone numbers aren't formatted correctly `0708151718 => 225708151718` Expected behaviour: --- `0708151718 => 2250708151718` National number leading zero should be preserved Steps to reproduce: --- ```py from ... import phone_validation as wa_phone_validation wa_phone_validation.wa_phone_format( record, number='0708151718', force_format="WHATSAPP", ) ``` Result => `'225708151718'` Should be => `'2250708151718'` NB: record has an
Original PR description
Current behaviour: --- Ivory Coast phone numbers aren't formatted correctly `0708151718 => 225708151718` Expected behaviour: --- `0708151718 => 2250708151718` National number leading zero should be…
Current behaviour:
---
Ivory Coast phone numbers aren't formatted correctly
`0708151718 => 225708151718`
Expected behaviour:
---
`0708151718 => 2250708151718`
National number leading zero should be preserved
Steps to reproduce:
---
```py
from ... import phone_validation as wa_phone_validation
wa_phone_validation.wa_phone_format(
record, number='0708151718',
force_format="WHATSAPP",
)
```
Result => `'225708151718'`
Should be => `'2250708151718'`
NB: record has an Ivory Coast `country_id`
Cause of the issue:
---
`WHATSAPP format` is country_code + national_number
But because `national_number` is an `int`, the leading zero gets removed.
Fix:
---
See [phonenumbers/phonenumber.py](https://github.com/daviddrysdale/python-phonenumbers/blob/7f60158f325ed2ee14212b71ef7e7dc2ce5f01bb/python/phonenumbers/phonenumber.py#L124 )
The `italian_leading_zero` is set True when the national number starts with a zero,
and it should be kept. (ie: Italian numbers) `number_of_leading_zeros` counts the zeros.
Taking those into account when formatting.
opw-3963124
Forward-Port-Of: odoo/enterprise#67132`portal.CustomerPortal.OPTIONAL_BILLING_FIELDS` is deprecated, we should rather use the method `_get_optional_fields` c.f. the OC-side commit Forward-Port-Of: odoo/enterprise#68679
Original PR description
`portal.CustomerPortal.OPTIONAL_BILLING_FIELDS` is deprecated, we should rather use the method `_get_optional_fields` c.f. the OC-side commit Forward-Port-Of: odoo/enterprise#68679
The employee name is cropped if too long on the appraisal form view. The field can be extended to full width to handle any name. Task: 4163637 Forward-Port-Of: odoo/enterprise#69409
Original PR description
The employee name is cropped if too long on the appraisal form view. The field can be extended to full width to handle any name. Task: 4163637 Forward-Port-Of: odoo/enterprise#69409
Versions -------- - 16.0+ Steps ----- 1. Enable Belgian localization; 2. create a public holiday; 3. have a contracted employee with CP200 salary structure; 4. make sure they get representation fees; 5. create a month-long maternity leave overlapping the holiday; 6. generate a payslip for that month. Issue ----- Employee receives representation fees, meant to compensate work expenses, despite not having worked that month. Cause ----- Representation fee calculation is curren
Original PR description
Versions -------- - 16.0+ Steps ----- 1. Enable Belgian localization; 2. create a public holiday; 3. have a contracted employee with CP200 salary structure; 4. make sure they get representation fees; 5. create a month-long maternity leave overlapping the holiday; 6. generate a payslip for that month. Issue ----- Employee receives representation fees, meant to compensate work expenses, despite not having worked that month. Cause ----- Representation fee calculation is currently based on "paid days" rather than days where the employee worked. As maternity leave is unpaid, the employee would normally not get representation fee, but because of the paid public holiday, the calculation continues as if the worker wasn't on leave. Solution -------- Check the `work_entry_type_id` of worked days, and skip representation fee calculation if all have `is_leave` set to `True`. opw-3908980 Forward-Port-Of: odoo/enterprise#69742 Forward-Port-Of: odoo/enterprise#68462
**Current behavior:** Creating an immediate transfer and attempting to allocate it for some existing document will not work- a valid document will not show up in the list of sources. **Expected behavior:** A source that logically matches the immediate transfer should be found for allocation. **Steps to reproduce:** 1. Enable the reception report setting 2. Create a delivery for some product and confirm it 3. Create a receipt transfer and create a move line (not move) for
Original PR description
**Current behavior:** Creating an immediate transfer and attempting to allocate it for some existing document will not work- a valid document will not show up in the list of sources. **Expected…
**Current behavior:**
Creating an immediate transfer and attempting to allocate it for
some existing document will not work- a valid document will not
show up in the list of sources.
**Expected behavior:**
A source that logically matches the immediate transfer should
be found for allocation.
**Steps to reproduce:**
1. Enable the reception report setting
2. Create a delivery for some product and confirm it
3. Create a receipt transfer and create a move line (not move)
for the same amount of the product in the delivery
4. Validate the picking, click the `Allocation` smart button ->
See that the delivery is not listed
**Cause of the issue:**
After the quantity field changes on stock move/move lines, in
`ReceptionReport::_get_report_values()` a move that is created
for an immediate transfer will have a `product_qty == 0`. This
means it is never added as a dict key which is later used to
search for moves belonging to allocation sources.
**Fix:**
Use `move.quantity` when `move.product_qty == 0` to gather valid
out documents when creating the report data.
opw-4075871
Forward-Port-Of: odoo/odoo#177545This commit will add some document types but also changed a bit the way we manage document type. We now let the possibility to the user to choose the document type he wants thanks to a manyToOne field to a new model. In this commit, we will also add the italian payment method needed for the edi. For that we added a selection field that can be filled with the payment method of the payment or by manually choosing a value. In the journal of bank, we can add some new payment method, by defau
Original PR description
This commit will add some document types but also changed a bit the way we manage document type. We now let the possibility to the user to choose the document type he wants thanks to a manyToOne field to a new model. In this commit, we will also add the italian payment method needed for the edi. For that we added a selection field that can be filled with the payment method of the payment or by manually choosing a value. In the journal of bank, we can add some new payment method, by default the italian payment method will be MP05. In case of partial payment we choose to take the payment method of the first one. task-3770458 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#171795
Scenario: - install im_livechat - create a new user with a user that has base.group_erp_manager (Administration > Access Rights) => Access Error because user doesn't have write access to res.users.settings record. Why: res.users.settings model requires base.group_system to be able to write on records of other users, but the res.users method _inverse_livechat_username and _inverse_livechat_lang_ids are writing on it with current users. Fix: Use the return value of `res.users.settings()
Original PR description
Scenario: - install im_livechat - create a new user with a user that has base.group_erp_manager (Administration > Access Rights) => Access Error because user doesn't have write access to res.users.settings record. Why: res.users.settings model requires base.group_system to be able to write on records of other users, but the res.users method _inverse_livechat_username and _inverse_livechat_lang_ids are writing on it with current users. Fix: Use the return value of `res.users.settings()._find_or_create_for_user` for writing since they are returned in superuser mode. opw-4157859 Forward-Port-Of: odoo/odoo#179412
Specification: When creating a percent pie widget in the list view using Studio, the field's name has been added after percent pie, which is not user-friendly. Expected behavior: The duplicate label should not be visible in the list view. Task-3942207 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#179102
Original PR description
Specification: When creating a percent pie widget in the list view using Studio, the field's name has been added after percent pie, which is not user-friendly. Expected behavior: The duplicate label should not be visible in the list view. Task-3942207 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#179102
IoT Box image build was failing due to missing `libffi-dev` pkg. In addition to that, the previously moved `odoo.conf` was inaccessible due to incorrect access rights. This commit fixes these two problems. Forward-Port-Of: odoo/odoo#179535
Original PR description
IoT Box image build was failing due to missing `libffi-dev` pkg. In addition to that, the previously moved `odoo.conf` was inaccessible due to incorrect access rights. This commit fixes these two problems. Forward-Port-Of: odoo/odoo#179535
We currently save all configurations (db url, enterprise code, token, ...) in different text files. Now we store them all in the already existing file (`odoo.conf`), easy to write and load from python and bash. We also moved the `odoo.conf` file to `/home/pi` on the physical IoT Box, to avoid overwriting it while checking out a new branch. Based on PR from Olivier Monnom (mool): [https://github.com/odoo/odoo/pull/145365](https://github.com/odoo/odoo/pull/145365) Task: 2093535 Forward-
Original PR description
We currently save all configurations (db url, enterprise code, token, ...) in different text files. Now we store them all in the already existing file (`odoo.conf`), easy to write and load from python and bash. We also moved the `odoo.conf` file to `/home/pi` on the physical IoT Box, to avoid overwriting it while checking out a new branch. Based on PR from Olivier Monnom (mool): [https://github.com/odoo/odoo/pull/145365](https://github.com/odoo/odoo/pull/145365) Task: 2093535 Forward-Port-Of: odoo/odoo#173866
Problem: When searching for a reference in contacts, the search checks for an exact match. However, the expected behavior is to use `ilike` to allow partial matches. Steps to reproduce: - Add a reference to any contact (e.g., crutest). - In the list of contacts, search for cru. - No contact will appear. opw-4133302 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#179678 Forward-Port-Of: odoo/odoo#177864
Original PR description
Problem: When searching for a reference in contacts, the search checks for an exact match. However, the expected behavior is to use `ilike` to allow partial matches. Steps to reproduce: - Add a reference to any contact (e.g., crutest). - In the list of contacts, search for cru. - No contact will appear. opw-4133302 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#179678 Forward-Port-Of: odoo/odoo#177864
Category tags names are used directly as selectors. Adding spaces to the names leads to tracebacks. Reproduce --- - Install website_event - Create new event category with spaces in it - Open mobile view of all events - Select the category collapsible -> BUG opw-4009122 Forward-Port-Of: odoo/odoo#178850
Original PR description
Category tags names are used directly as selectors. Adding spaces to the names leads to tracebacks. Reproduce --- - Install website_event - Create new event category with spaces in it - Open mobile view of all events - Select the category collapsible -> BUG opw-4009122 Forward-Port-Of: odoo/odoo#178850
- install website_profile - open /profile/edit - BUG: see content overflow in mobile opw-4123897 Forward-Port-Of: odoo/odoo#179324
Original PR description
- install website_profile - open /profile/edit - BUG: see content overflow in mobile opw-4123897 Forward-Port-Of: odoo/odoo#179324
**Current behavior:** Having a product produced via kit bom with FIFO & automated costing method and valuation in a sale order with delivery via dropship: When the orders and transfers are completed and the sale order is invoiced, the stock output and expense account on the invoice will have a credit and dedit (respectively) which is too high (the degree is proportional to the `product_qty` of each move in the dropship transfer). **Expected behavior:** The account entry lines should be a
Original PR description
**Current behavior:** Having a product produced via kit bom with FIFO & automated costing method and valuation in a sale order with delivery via dropship: When the orders and transfers are completed…
**Current behavior:** Having a product produced via kit bom with FIFO & automated costing method and valuation in a sale order with delivery via dropship: When the orders and transfers are completed and the sale order is invoiced, the stock output and expense account on the invoice will have a credit and dedit (respectively) which is too high (the degree is proportional to the `product_qty` of each move in the dropship transfer). **Expected behavior:** The account entry lines should be accurate to the cost of the kit components. **Steps to reproduce:** 1. Create a kit_product such that: - It has FIFO cost method and automated valuation - Has a component in a kit bom, also with FIFO and automated valuation as well as a vendor with non-zero price 2. Create a sale order for 2 of the kit product and set the SOL route to dropship 3. Confirm the sale order, purchase order, and validate the dropship transfer 4. Create an invoice for the sale order and confirm/post it 5. Observe that the stock output and expense accounts have a credit and debit (respectively) for 2x the correct amount **Cause of the issue:** The `product_qty` of each move in the dropship is errantly multiplied with the result of `_compute_average_price()`- this qty has already been taken into account. **Fix:** Remove this piece of the calculation. opw-4050777 Forward-Port-Of: odoo/odoo#178976 Forward-Port-Of: odoo/odoo#176296
Since [1], the `MANDATORY_BILLING_FIELDS` are now returned through the method `/portal._get_mandatory_fields`: https://github.com/odoo/odoo/blob/b454a060a41961b7e0c9cc1ee6ec77b5cca1ec75/addons/portal/controllers/portal.py#L421-L423 Where `MANDATORY_BILLING_FIELDS` is a list defined on the class: https://github.com/odoo/odoo/blob/b454a060a41961b7e0c9cc1ee6ec77b5cca1ec75/addons/portal/controllers/portal.py#L134-L136 This is a problem: the value is an object, so if the list is modified during
Original PR description
Since [1], the `MANDATORY_BILLING_FIELDS` are now returned through the method `/portal._get_mandatory_fields`:…
Since [1], the `MANDATORY_BILLING_FIELDS` are now returned through the method `/portal._get_mandatory_fields`: https://github.com/odoo/odoo/blob/b454a060a41961b7e0c9cc1ee6ec77b5cca1ec75/addons/portal/controllers/portal.py#L421-L423 Where `MANDATORY_BILLING_FIELDS` is a list defined on the class: https://github.com/odoo/odoo/blob/b454a060a41961b7e0c9cc1ee6ec77b5cca1ec75/addons/portal/controllers/portal.py#L134-L136 This is a problem: the value is an object, so if the list is modified during a call, the method will then return that modified list instead of the initial one. For instance, in `l10n_ec_website_sale`, we add some values to that list: https://github.com/odoo/odoo/blob/10b7c27a4fc873c6220d63a0686f484e92ae906b/addons/l10n_ec_website_sale/controllers/portal.py#L14-L17 Then, if we call again `_get_mandatory_fields` with a company that is not EC, we will still have `l10n_latam_identification_type_id` and `vat` in the list of mandatory fields. That is incorrect. Looking at builds on runbot, some of them failed because of that error. This is the case with the FW of [2] on 17.4 which is blocked because of the above issue. Indeed, this commit contains a tour that checkouts a cart with an EC company. And, in 17.4, this flow leads to a call of `_get_mandatory_fields`. As explained, we will therefore add the EC mandatory fields. So, if [2] is part of the code, and if we try to run this: `--test-tags=.test_checkout_address_ec,.test_qr_code_receipt_mx` Where the first test comes from [2] and the second one is an existing test in the code, it will fail: the first test will add some values in `MANDATORY_BILLING_FIELDS`. Then, during the second test, at some point we also check the mandatory fields: the method will return the modified list (i.e., with the EC fields), and we will not have any value for these unexpected fields -> the test will fail [1] 9b9b0ee4c2d8a8a66e5e0456acbb780e5d8d6456 [2] 732b4fbbf3009769708f9c9cba57609d22f2a570 Forward-Port-Of: odoo/odoo#177349
When an invoice is linked to a sale order or more, the ReceiverTransactionReference tag should be included in the Factura-E XML per invoice line with the value of the Customer Reference field of the Sale Order linked to that line. This commit handles this. task-4134422 Forward-Port-Of: odoo/odoo#178360
Original PR description
When an invoice is linked to a sale order or more, the ReceiverTransactionReference tag should be included in the Factura-E XML per invoice line with the value of the Customer Reference field of the Sale Order linked to that line. This commit handles this. task-4134422 Forward-Port-Of: odoo/odoo#178360
Currently, when applying two discounts (from loyalty programs) that are applied on specific products, the second discount value does not match with the setup of the reward. Steps to reproduce: ------------------- * Go to the **Point of Sale** App * Create a new product, P -> Price 100$, no tax applied * Under **Products** select **Discount & loyalty** * Create a new loyalty program * Rule 10 points per $ spent * Reward 1: 10$ on P for 10 points * Reward 2: 50$ on P for 40 points
Original PR description
Currently, when applying two discounts (from loyalty programs) that are applied on specific products, the second discount value does not match with the setup of the reward. Steps to reproduce:…
Currently, when applying two discounts (from loyalty programs) that are applied on specific products, the second discount value does not match with the setup of the reward. Steps to reproduce: ------------------- * Go to the **Point of Sale** App * Create a new product, P -> Price 100$, no tax applied * Under **Products** select **Discount & loyalty** * Create a new loyalty program * Rule 10 points per $ spent * Reward 1: 10$ on P for 10 points * Reward 2: 50$ on P for 40 points * Open shop session * Add P to the order * Add reward 1 * Add reward 2 > Observation: The first reward is 10$ but the second is 55$ Why the fix: ------------ We will use the example from the given steps to explain what happens. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1376-L1377 On the first line of the above `discountable` and `discountablePerTax` will be 100. On the second line `discountable` will be 90 as the order total is 90, as the discount is counted here. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1417 Here we have `masDiscount` being 50 (`reward.discount`). Thus we end up with `discountFactor = min(1, 0.555)`. This factor is later on used to set the price of the discount line. The price is set up as follow. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1426 Where entry one corresponds to the value of `discountablePerTax` which is 100. Thus the discount is valued at `0.555 * 100 = 55.5$`. To solve this we make `discountable` and `discountablePerTax` account for the discounts that aleady apply on the same product. We then look at what happens in the function `_getDiscountableOnSpecific` as in our case it corresponds to `getDiscountable`. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1250-L1251 As this comment says we don't want to discount more than what is available. In our case only 90$ are available since we have already applied the 10$ discount. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1269-L1273 We see that when we scan through the order lines, only discount from the same reward as the one we are trying to apply are counted. In short, if we were trying to apply another 10$ discount instead of the 50, then the line would be counted. But since the 10$ and 50$ discounts apply on the same product, they should both be counted. We want to add more discount lines to `linesToDisount` because at the end, it is used compute `discountable` and `discountablePerTax`. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1331-L1341 We want to add the discount lines that applies to at least one product of the current reward. But we also need to check if that common product is on the order. If we imagine reward 1 applied on P1, reward 2 applied on P1 and P2 but we only have P2 in the order then reward 1 should not count when applying reward 2. We filter on the `reward_type` to exclude lines that are related to free products rewards. With the current change there is a difference in behaviors when the discount is a percentage or a fixed amount. Since we now count the discounts at the end, we can remove this part of the code as it would count twice the discounts that are percentages. https://github.com/odoo/odoo/blob/e01df041b9428cf14cb150bdb0803c6f5ff2d80f/addons/pos_loyalty/static/src/js/Loyalty.js#L1298-L1309 opw-4083557 Forward-Port-Of: odoo/odoo#179379 Forward-Port-Of: odoo/odoo#178352
Prior to this commit, clicking on an optional product within the product info popup would fail to locate the optional product due to product template filtering applied to product variants. This commit resolves the issue by applying product template filtering exclusively for variants, ensuring optional products are correctly displayed from the product info popup. opw-4097824 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo
Original PR description
Prior to this commit, clicking on an optional product within the product info popup would fail to locate the optional product due to product template filtering applied to product variants. This commit resolves the issue by applying product template filtering exclusively for variants, ensuring optional products are correctly displayed from the product info popup. opw-4097824 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#176168
### Steps to reproduce: - Go to Inventory > Configutation > Products > Barcode Nomenclatures - Click on Default Nomenclature > Add a line with the invalid barcode Pattern: "****" and put that one on the top of the list - Open a POS session > click on the list icon on the right corner - Debug window > enter any barcode and scan #### > Odoo Error: Invalid regular expression "****" ### Cause of the issue: The pattern field of the barcode.rule model that we created does not lead to a
Original PR description
### Steps to reproduce: - Go to Inventory > Configutation > Products > Barcode Nomenclatures - Click on Default Nomenclature > Add a line with the invalid barcode Pattern: "****" and put that one on the top of the list - Open a POS session > click on the list icon on the right corner - Debug window > enter any barcode and scan #### > Odoo Error: Invalid regular expression "****" ### Cause of the issue: The pattern field of the barcode.rule model that we created does not lead to a valid regular expression but is used as such by the String.match calls done in the "barcode_parser": https://github.com/odoo/odoo/blob/28871371c39bcc164e167842cf7212ce05f49a51/addons/barcodes/static/src/js/barcode_parser.js#L124-L130 opw-4100030 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#179473 Forward-Port-Of: odoo/odoo#178096
**Steps to reproduce:** 1- Install POS and POS restaurant 2- Activate self ordering 3- Create a self order from the mobile menu 4- Create another order from the Shop POS **Current behavior before PR:** There is a conflict happening in order numbers between Self order and other orders where at some point we might have two orders with the same number. This is happening because when adding the order from Shop we get the sequence number from the JS side in Order class https://github.com
Original PR description
**Steps to reproduce:** 1- Install POS and POS restaurant 2- Activate self ordering 3- Create a self order from the mobile menu 4- Create another order from the Shop POS **Current behavior before…
**Steps to reproduce:** 1- Install POS and POS restaurant 2- Activate self ordering 3- Create a self order from the mobile menu 4- Create another order from the Shop POS **Current behavior before PR:** There is a conflict happening in order numbers between Self order and other orders where at some point we might have two orders with the same number. This is happening because when adding the order from Shop we get the sequence number from the JS side in Order class https://github.com/odoo/odoo/blob/d82ffde0b316c52f726c247bf6f3d38e2e73e405/addons/point_of_sale/static/src/app/store/models.js#L1383 but in case of self order. We get it from ir_sequence https://github.com/odoo/odoo/blob/d82ffde0b316c52f726c247bf6f3d38e2e73e405/addons/pos_self_order/controllers/orders.py#L19 So we don't have a shared sequence between them. **Desired behavior after PR is merged:** We are now creating another sequence for self-order and as agreed with the PO we will have 'S' before the order number if the order is self-order opw-3809595 Forward-Port-Of: odoo/odoo#162119
**Current behavior:** Having some product with FIFO cost method, if you use it as a component in an MO, confirm and produce all, then unlock the MO and adjust the component quantity to be smaller than originally entered, the standard price of the product will be set to zero. **Expected behavior:** This operation should not affect the standard price of the product. **Steps to reproduce:** 1. Create a product with FIFO cost method and real time valuation 2. Create a purchase
Original PR description
**Current behavior:** Having some product with FIFO cost method, if you use it as a component in an MO, confirm and produce all, then unlock the MO and adjust the component quantity to be smaller…
**Current behavior:**
Having some product with FIFO cost method, if you use it as a
component in an MO, confirm and produce all, then unlock the MO
and adjust the component quantity to be smaller than originally
entered, the standard price of the product will be set to zero.
**Expected behavior:**
This operation should not affect the standard price of the
product.
**Steps to reproduce:**
1. Create a product with FIFO cost method and real time
valuation
2. Create a purchase order for 10 of the fifo product, set the
price unit on the order line to 100
3. Confirm the order and receive the product
4. Create a manufacturing order for 1 of some other product, and
set the components to be 100 of the fifo product
5. Confirm the MO, consume the fifo product and produce all
6. Unlock the order and set the quantity of components consumed
to 1 (from 100)
7. Observe that the standard price of fifo product is now 0
**Cause of the issue:**
A move for an MrpProduction record has a price unit == 0. Commit
https://github.com/odoo/odoo/commit/1fb4d356b5115a82dbbb004efe2e26917021b339 forces use of this when a move's picking type is
manufacturing, however it should be a narrower condition to only
do so when the move corresponds to the finished moves of a
manufacturing order.
**Fix:**
Moves for components of a production should not be able to
modify the `standard_price` of the moved product- only the final
product's cost should be able to change based on the value of
such a move.
Use a product's `standard_price` field when creating SVLs for
moves corresponding to raw production moves.
opw-4134037
Forward-Port-Of: odoo/odoo#178015When a custom postgresql function is used (`ODOO_NOTIFY_FUNCTION` environment variable is set), testing to listen to imbus should be skipped --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178986
Original PR description
When a custom postgresql function is used (`ODOO_NOTIFY_FUNCTION` environment variable is set), testing to listen to imbus should be skipped --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178986
When you made a downpayment on an order that contains different products with different unique tax combination, each invoice line would show that it's linked to all the sale order lines. Steps to reproduce: ------------------- * Create some taxes T1 T2 and T3 * Create an order with 3 lines and put one tax on each line * Open the PoS and make a downpayment for the order * Pay and invoice the order > Observation: Each line in the invoice show that it is applying the downpayment to the co
Original PR description
When you made a downpayment on an order that contains different products with different unique tax combination, each invoice line would show that it's linked to all the sale order lines. Steps to reproduce: ------------------- * Create some taxes T1 T2 and T3 * Create an order with 3 lines and put one tax on each line * Open the PoS and make a downpayment for the order * Pay and invoice the order > Observation: Each line in the invoice show that it is applying the downpayment to the complete sale order Why the fix: ------------ We make sure to only show the sale order line that have the same tax combination opw-4089408 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178061
Steps to reproduce ================== - Use Epiphany (a webkit based browser, like Safari) - Add `time.sleep(3)` inside `action_get_share_url` to simulate a slow network as it isn't possible inside the epiphany devtools - Go to dashboard - Click on Share => NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Cause of the issue ================== The delay between the user click
Original PR description
Steps to reproduce ================== - Use Epiphany (a webkit based browser, like Safari) - Add `time.sleep(3)` inside `action_get_share_url` to simulate a slow network as it isn't possible inside the epiphany devtools - Go to dashboard - Click on Share => NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Cause of the issue ================== The delay between the user click and the actual copy is to slow for the trused event to be recognized as the origin of the copy. It is thus not allowed. Note that it also fails in Chrome if the document is out of focus in the meantime. Solution ======== Wrap the copy in a try catch. If it fails, the user can always use the copy button. opw-4144551 Forward-Port-Of: odoo/odoo#178852
Steps to reproduce: - Have two Companies A and B - Create an Analytic Account (AA) for Company A - In B (A multiselected), create an invoice: company=Company B Set the AA analytic Distribution - Unselect company A and try to enter the invoice Issue: Access error Solution: After discussion with PO tsb, children companies need to have access to analytic account (and analytic related stuff) from parent opw-3764627 Forward-Port-Of: odoo/odoo#179282
Original PR description
Steps to reproduce: - Have two Companies A and B - Create an Analytic Account (AA) for Company A - In B (A multiselected), create an invoice: company=Company B Set the AA analytic Distribution - Unselect company A and try to enter the invoice Issue: Access error Solution: After discussion with PO tsb, children companies need to have access to analytic account (and analytic related stuff) from parent opw-3764627 Forward-Port-Of: odoo/odoo#179282
Problem: The account tax report was displaying "Matla" instead of "Malta" Purpose: Fix the type to stay consistent with naming conventions opw-4134520 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178110
Original PR description
Problem: The account tax report was displaying "Matla" instead of "Malta" Purpose: Fix the type to stay consistent with naming conventions opw-4134520 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#178110
Currently, a traceback is occurring when the user tries to download multiple e-Faktur at a time. To reproduce this issue: 1) Install `l10n_id_efaktur` 2) Select multiple customer invoices from an accounting 3) Try to `Download e-Faktur` from actions Error:- ``` ValueError: Expected singleton: account.move(65, 57,) ``` This is because when the user selects multiple invoices, the `self` contains multiple recordsets. Which leads to a traceback when `l10n_id_need_kode_transaksi` is
Original PR description
Currently, a traceback is occurring when the user tries to download multiple e-Faktur at a time. To reproduce this issue: 1) Install `l10n_id_efaktur` 2) Select multiple customer invoices from an accounting 3) Try to `Download e-Faktur` from actions Error:- ``` ValueError: Expected singleton: account.move(65, 57,) ``` This is because when the user selects multiple invoices, the `self` contains multiple recordsets. Which leads to a traceback when `l10n_id_need_kode_transaksi` is accessing from self. https://github.com/odoo/odoo/blob/4f044aade6e2a461c854899a8854474e3b22b6d5/addons/l10n_id_efaktur/models/account_move.py#L134-L139 Already a loop is there in that method, so by just changing self with record we can resolve this issue. sentry-5809438159 Forward-Port-Of: odoo/odoo#179597