Daily updates from Odoo
Saturday, November 16, 2024
31 changes · 18.0
New functionality added to Odoo
This pull request adds a packaged web theme module to the Odoo addons. It may change the look and feel of the Odoo web interface for users who install or enable this theme.
Original PR description
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
Adds support for the UK Construction Industry Scheme, allowing businesses to apply the required subcontractor deduction rates and prepare the monthly CIS return. It also adds HMRC connectivity so eligible companies can send CIS reports directly from Odoo, reducing manual reporting work and compliance risk.
Original PR description
When a company is employing partner for construction work a special report mechanism is needed. A Subcontractor is a partner that will do construction work and invoice the Contractor. Construction Industry Scheme add deductions for labour cost on the invoice. The deducted amount must be paid and reported by the contractor through a monthly return. For more informations about CIS, see: https://www.gov.uk/what-is-the-construction-industry-scheme This commit adds: - 6 new taxes for deductions 0, 20, 30% in sales and purchase - A CIS report inherited from the tax report - A way to directly send the report to hmrc. This imply a call to IAP - New fields on res.company and res.partner for the HMRC API related: https://github.com/odoo/iap-apps/pull/842 task:3851467
Enhancements to existing features
Discuss channel avatars now load much faster for employees, especially on large databases. This reduces delays when users first open conversations or see channel images, improving the overall responsiveness of the messaging experience.
Original PR description
## Description Following d6c6351c7f0b241578121d459943fdf2b305571e, the `ir.rule` related to discuss channels got more elaborated, with more subqueries. When loading an `avatar_128`, in an override of…
## Description Following d6c6351c7f0b241578121d459943fdf2b305571e, the `ir.rule` related to discuss channels got more elaborated, with more subqueries. When loading an `avatar_128`, in an override of `_find_record_check_access`, a repetitive domain with an `any` operator on the same left leaf. This repetitive domain + the new `ir.rule` lead to a bad postgres plan, leading to a perf regression. ## Fix We add an `auto_join=True` on `parent_channel_id` to avoid doing an additional nested sub-query coming from the `ir.rule`. This change is safe, as the comodel is the same model as the current one, and an user that has access to a subchannel, should probably already have access to its parent channel. The other improvement is an optimistic early `super()` call, which should not raise any issue for internal employees, who already should have access to the avatar. In case of an access violation, we fallback on the previous behaviour. ## Benchmark On a large database, loading an `avatar_128`, cache disabled in browser (simulating a first load) for an internal non-privileged user. | | Timings | |----------------------|-----------| | Before | 300~400ms | | `auto_join=True` | 20~25ms | | + `super()` shortcut | 13~23ms | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Point of Sale bank payment methods must now have an outstanding account selected during configuration. This helps ensure payments are properly tracked and reduces accounting setup errors.
Original PR description
in this commit: ============ Made it mandatory to select an outstanding account while configuring the `bank` payment method in pos. Task - 4281382 Related PR: odoo/upgrade#6728
This pull request updates the MuK web theme package for Odoo 18. The business impact is unclear from the provided description, but it appears to refresh or replace a theme add-on package used for the user interface.
Original PR description
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
This update adds coverage for command-line configuration handling and cleans up related test settings. It helps ensure configuration behavior stays reliable during future changes, with no direct impact on day-to-day users.
Merging account records now also updates saved default values used by company-specific settings. This prevents errors when users open product categories after merged accounts have replaced old records in a multi-company setup.
Original PR description
When merging records that are related to company-dependent fields, we update the company_dependent fields referring the merged records but they are `null` if the user has never set them. Therefore, we need to update the `ir_default` table, which stores the default values. Steps: - Install stock_accountant - Install the CoA on both companies - Select both companies in company selector - Go to charts of accounts and merge 'Stock Valuation accounts' - Go to any Product Category for both companies, we get an error whith one of the companies because we're trying to access a record that has been deleted during the merge opw-4245539
Repair orders that create purchase orders now show the related purchase order immediately, even while it is still in draft. This helps users track purchasing for repair work more reliably and avoids missing links in the repair workflow.
Original PR description
Steps to reproduce the issue: 1. Install the Repair and Purchase modules 2. Activate multi-steps routes 3. Unarchive the MTO route 4. Change the trigger action for the associated rule to 5. Create a…
Steps to reproduce the issue: 1. Install the Repair and Purchase modules 2. Activate multi-steps routes 3. Unarchive the MTO route 4. Change the trigger action for the associated rule to 5. Create a product with the MTO route enabled 6. Create a Repair Order with the line type and include the product 7. Confirm the Repair Order Explanation: A Purchase Order will be created to handle the repair; However, the smart button does not appear at the top of the page. This happens because we are using the wrong linkage from repair to purchase. The current linkage is via , and this field is set when the purchase order confirmed. We need the link to be established when the Purchase Order is in draft state. The fix is to use instead. This commit introduces a minor fix in : -> Ensuring the correct rule is used by relying on instead of searching by name. 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
The Barcode app now shows lot and serial number fields only when they are relevant during manufacturing operations. This prevents confusing empty fields when no product is selected and ensures by-product lines created with a manufacturing order can still capture the needed lot information.
Original PR description
This commit fixes two issues with the `lot_id` field in the move line form view in the Barcode app for the manufacturing operations. 1. The `lot_id` field was displayed when no product was selected. 2. The `lot_id` field was not displayed for by-product lines created at the creation of the MO. The first issue was there because the compute fields to determine if we want to hide `lot_id` and/or `lot_name` were false by default. The second issue was there because those fields depend of the line's picking code which depends of the line's picking type which depend of the line's `production_id`. The issue is by-product lines has no `production_id` set.
This fixes an issue in restaurant PoS where an order item intentionally excluded from the preparation display could reappear after adding another product. The display now tracks individual order lines instead of product types, so kitchen staff see only the items that should actually be prepared.
Original PR description
In the PoS restaurant if you marked a line as skipChange not to send it on the preparation display, then add the same product to the order and send it to the preparation display. At this point…
In the PoS restaurant if you marked a line as skipChange not to send it on the preparation display, then add the same product to the order and send it to the preparation display. At this point everything would be correct, only one of the product would be one the pdis. But if you add another different product and send it to the pdis, it would also bring back the one that was marked as skip change. Steps to reproduce: ------------------- * Setup a preparation display for a PoS restaurant * Open PoS and add product A to the order * Double click on the order line to mark it as skip change * Add the same product to the order and click on the order button * At this point the preparation display should only show one product A * Add another different product B to the order * Click on the order button > Observation: The preparation display shows the product B and a second product A Why the fix: ------------ Instead of filtering based on the product we filter directly based on the line UUID that is unique and should avoid any further errors opw-4322597
The Documents app now opens the "Shared With Me" folder much faster by removing a redundant permission check from the search. This reduces waiting time for users accessing shared documents, improving day-to-day productivity.
Original PR description
Bug === The "Shared With Me" folder is really slow on next.odoo.com. We used "user_permission != none" in the domain, but it's already added by the access rules, and so, that part is computed too much time in SQL. The web_search_read query, on my personal account takes (build of 4 November) - 3600ms before the change - 490ms after the change Task-4307300
Document shortcuts now stay aligned with their target document when access or company ownership changes, preventing users from hitting errors when opening folders. This keeps the Documents app more reliable in shared and multi-company setups without adding costly permission checks.
Original PR description
Commit 1: [FIX] documents: avoid crashes on inaccessible targets Reproduce: 1. Create a shortcut for a document you are shared access to. Say it ends up in My Drive 2. Remove your access to the…
Commit 1: [FIX] documents: avoid crashes on inaccessible targets Reproduce: 1. Create a shortcut for a document you are shared access to. Say it ends up in My Drive 2. Remove your access to the shortcut's target 3. Go to the folder/section (My Drive) where you have the shortcut 4. Experience an Access Error Usually, access rights of a document and its shortcuts is synchronized, so a user can see/edit both or none. This is not the case with ownership as a user can create a shortcut to a document they don't own. If they are allowed to view a shortcut they own when they don't have access to the target anymore, the webclient crashes on loading target data (e.g. to show previews). We tested changing the domain of ownership-related access in user_permission, but it is very costly performance-wise, so this is our best approach in stable as it affects writes but not all reads. Commit 2: Reproduce: 1. Enable Company 1 and 2 2. Create a document with Company 1 3. Create a shortcut for the document. 4. Change document's company to Company 2 6. Only enable Company 1 4. Experience an Access Error See previous commit. Syncing company_id with shortcuts allows to avoid this. A test is included. Task-4236268
Features or functions removed from Odoo
A leftover internal method was removed from the HTML editor after a recent cleanup of the editor framework. This reduces outdated code and helps keep the editor easier to maintain, with no expected impact on day-to-day users.
Original PR description
The handleCommand method was removed from Plugin in a recent API refactor [1] but, due to an oversight, this one was forgotten. [1]: https://github.com/odoo/odoo/commit/9aebe936fea2f260d85581062d84860dfcea6c3c
Miscellaneous changes
The issue: When a manufacturing order has a quantity to produce whose decimal accuracy has several digits, in Done status, the fields qty_producing and product_qty overlap. How to reproduce the issue: -Enable debug mode -navigate to Settings > Technical > Database Structure > Decimal Accuracy: Select Stock Weight and set '8' to Digits -Create a product whose UOM is g, add a weight in Logistics and select manufacturing in Routes -Create a Manufacturing Order, select the product, confirm the
Original PR description
The issue: When a manufacturing order has a quantity to produce whose decimal accuracy has several digits, in Done status, the fields qty_producing and product_qty overlap. How to reproduce the issue: -Enable debug mode -navigate to Settings > Technical > Database Structure > Decimal Accuracy: Select Stock Weight and set '8' to Digits -Create a product whose UOM is g, add a weight in Logistics and select manufacturing in Routes -Create a Manufacturing Order, select the product, confirm the Mo, and click on Produce all opw-4237620 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#183072
Before this commit, the welcome page was using "Guest" as the default name, regardless of what the name was. Forward-Port-Of: odoo/odoo#187005 Forward-Port-Of: odoo/odoo#186759
Original PR description
Before this commit, the welcome page was using "Guest" as the default name, regardless of what the name was. Forward-Port-Of: odoo/odoo#187005 Forward-Port-Of: odoo/odoo#186759
If user wanted to filter products by more than one attribute, after going to the next page, second attribute filter was deleted. opw-4191891 Forward-Port-Of: odoo/odoo#187107
Original PR description
If user wanted to filter products by more than one attribute, after going to the next page, second attribute filter was deleted. opw-4191891 Forward-Port-Of: odoo/odoo#187107
Follow-up of https://github.com/odoo/odoo/pull/185583 PR above fixed an issue that results in a traceback when posting a message with `@`mention in multi-company. This happens because a message post with `@`mention notifies the recipients of new message in their inbox, but the computing of this notification was made in the context of the recipient but with `allowed_company_ids` of the person that sends the message. If the recipient does not have access to the `allowed_company_ids` of the send
Original PR description
Follow-up of https://github.com/odoo/odoo/pull/185583 PR above fixed an issue that results in a traceback when posting a message with `@`mention in multi-company. This happens because a message post…
Follow-up of https://github.com/odoo/odoo/pull/185583
PR above fixed an issue that results in a traceback when posting a message with `@`mention in multi-company. This happens because a message post with `@`mention notifies the recipients of new message in their inbox, but the computing of this notification was made in the context of the recipient but with `allowed_company_ids` of the person that sends the message. If the recipient does not have access to the `allowed_company_ids` of the sender then this leads to the crash that PR above fixes.
The PR fixed it by removing the `allowed_company_ids` from the context, with `allowed_company_ids=None`. However, some code inspect presence of `ctx.allowed_company_ids` with the following code:
```py
len(self.env.context.get('allowed_company_ids', [])) <= 1
```
Due to `allowed_company_ids` being present as `None`, code attempts to `len(None)` which is invalid thus it crashes.
This commit fixes the issue by passing `[]` as allowed_company_ids. This is semantically the same as passing no `allowed_company_ids` but it prevents crash from the pattern above.
opw-4231529
Forward-Port-Of: odoo/odoo#187393The UBL file could contain SO or PO information if the invoice is linked to one. The MyInvois platform does not support this information and return a validation error if it is provided. This fix will update the template in order to remove this information from the file. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187367 Forward-Port-Of: odoo/odoo#187342
Original PR description
The UBL file could contain SO or PO information if the invoice is linked to one. The MyInvois platform does not support this information and return a validation error if it is provided. This fix will update the template in order to remove this information from the file. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187367 Forward-Port-Of: odoo/odoo#187342
When applying a global discount on an order that contains lines using tax group, the tax amount was always ignored by the discount. Steps to reproduce: ------------------- * Create a tax group with 2 taxes included in price (e.g 15% and 5%) * Create a product with a price of 120€, the price without tax should be 99.38€ * Open PoS and add the product * Add a global discount of 10% > Observation: As all the taxes are included in price the discount should be 12€ (10% of 120) but it is not
Original PR description
When applying a global discount on an order that contains lines using tax group, the tax amount was always ignored by the discount. Steps to reproduce: ------------------- * Create a tax group with 2 taxes included in price (e.g 15% and 5%) * Create a product with a price of 120€, the price without tax should be 99.38€ * Open PoS and add the product * Add a global discount of 10% > Observation: As all the taxes are included in price the discount should be 12€ (10% of 120) but it is not Why the fix: ------------ We now get the base by getting the total with tax of the line and substracting the tax amount that comes from that that are not included in price opw-4289157 Forward-Port-Of: odoo/odoo#186629
Current behaviour: --- When being on the kanban view of "my activities", the new button is visible but doesn't do anything. Expected behaviour: --- The button shouldn't be visible, because you shouldn't be able to create activities in the kanban view. Steps to reproduce: --- 1. Install contacts 2. Go to contacts 3. Click on the clock in the upper right 4. Click on "View all activities" 5. Switch to kanban view 6. Click on "New" 7. Nothing happens Fix: --- Disabled the "new
Original PR description
Current behaviour: --- When being on the kanban view of "my activities", the new button is visible but doesn't do anything. Expected behaviour: --- The button shouldn't be visible, because you shouldn't be able to create activities in the kanban view. Steps to reproduce: --- 1. Install contacts 2. Go to contacts 3. Click on the clock in the upper right 4. Click on "View all activities" 5. Switch to kanban view 6. Click on "New" 7. Nothing happens Fix: --- Disabled the "new" button opw-4210619 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#184942
Steps to reproduce: [point_of_sale] - activate "Generate a code on ticket" option in PoS settings. - have a PoS session in GMT-6 and create an order after 6pm local time. - go to /pos/ticket, enter the order information and the date that appears on the ticket - ** No sale order found ** Cause The `date_order` of the sale order is stored in UTC while the date displayed on the ticket is in local time. Change This commit makes the search domain bigger to account for orders made in diff
Original PR description
Steps to reproduce: [point_of_sale] - activate "Generate a code on ticket" option in PoS settings. - have a PoS session in GMT-6 and create an order after 6pm local time. - go to /pos/ticket, enter the order information and the date that appears on the ticket - ** No sale order found ** Cause The `date_order` of the sale order is stored in UTC while the date displayed on the ticket is in local time. Change This commit makes the search domain bigger to account for orders made in different timezones. opw-4311152 Forward-Port-Of: odoo/odoo#187075 Forward-Port-Of: odoo/odoo#186770
### Steps to reproduce: - Install "l10n_ch" and switch to the Swiss company - In the Accounting settings activate the QRcodes on invoices - Change the name of the Swiss company - Create an invoice - The old company name is still displayed next to the QR code ### Cause: The field displayed is the field `account_holder_name` which is not updated when changing the company name. Solution: As the field `account_holder_name` is not supposed to be shown anymore in 18.0, we can display dire
Original PR description
### Steps to reproduce: - Install "l10n_ch" and switch to the Swiss company - In the Accounting settings activate the QRcodes on invoices - Change the name of the Swiss company - Create an invoice - The old company name is still displayed next to the QR code ### Cause: The field displayed is the field `account_holder_name` which is not updated when changing the company name. Solution: As the field `account_holder_name` is not supposed to be shown anymore in 18.0, we can display directly the partner name. opw-4273688 Forward-Port-Of: odoo/odoo#186479
Steps to reproduce the issue: ============================= - Set the company of the website to one that uses (euro) currency. - Open the website editor - Drag a banner block and a products carousel block under it - Set the last template to the products block (last one in the list) - Try to edit the title of the banner block - One of two keystrokes are reverted Origin of the issue: ==================== When we added content, we do historyStep which calls sanitize on the target (the
Original PR description
Steps to reproduce the issue: ============================= - Set the company of the website to one that uses (euro) currency. - Open the website editor - Drag a banner block and a products carousel block under it - Set the last template to the products block (last one in the list) - Try to edit the title of the banner block - One of two keystrokes are reverted Origin of the issue: ==================== When we added content, we do historyStep which calls sanitize on the target (the editable), which will sanitize the non editable elements inside it and have `oe_unremovable`. observerApply now will mark this._toRollback as true so in the next keystroke it will revert the changes and so on... Solution: ========= We should not unwrap content for `oe_currency_value` spans opw-4252743 Forward-Port-Of: odoo/odoo#185995
Steps to reproduce: - Enable Analytic Accounting and Anglo-Saxon Accounting in the settings - Create a storable product - Set inventory valuation to Automated on the product's category - Add a cost to the product - Create an invoice with the product and add an analytic distribution - When the invoice is confirmed, the distribution is also applied to the CoGS line. For example, in an invoice where the product’s sale price equals its cost, the account plan will show a balance
Original PR description
Steps to reproduce:
- Enable Analytic Accounting and Anglo-Saxon Accounting in the settings
- Create a storable product
- Set inventory valuation to Automated on the product's category
- Add a cost to the product
- Create an invoice with the product and add an analytic distribution
- When the invoice is confirmed, the distribution is also applied to the CoGS line.
For example, in an invoice where the product’s sale price equals its cost, the account plan will show a balance of 0 (debit = credit).
After this fix, the account plan will show a balance of 10.
Task 2008567 led to the commit https://github.com/odoo/odoo/commit/3590efa47849be09e694e7755ec640f41cb14313, which removed the analytic distribution from the stock interim account. However, the expense line was not modified accordingly.
opw-4177695
Forward-Port-Of: odoo/odoo#183066Adds a corporate signature for Codeforward B.V. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187182
Original PR description
Adds a corporate signature for Codeforward B.V. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#187182
When using ship later with 3 steps delivery and receipt, all the steps would always be done again even when the product is already available Steps to reproduce: ------------------- * Create a product A with any vendor * Setup 3 steps receipt and delivery in your warehouse * Create a sale order for product A * Receiving steps and purchase order will be created * Validate the purchase order and all the receiving steps so that there is 1 quantity in the warehouse * Open PoS, settle the or
Original PR description
When using ship later with 3 steps delivery and receipt, all the steps would always be done again even when the product is already available Steps to reproduce: ------------------- * Create a product…
When using ship later with 3 steps delivery and receipt, all the steps would always be done again even when the product is already available Steps to reproduce: ------------------- * Create a product A with any vendor * Setup 3 steps receipt and delivery in your warehouse * Create a sale order for product A * Receiving steps and purchase order will be created * Validate the purchase order and all the receiving steps so that there is 1 quantity in the warehouse * Open PoS, settle the order and ship it later > Observation: In the PoS order you will see that all receiving steps have been created again, and a new purchase order has been created too Why the fix: ------------ The error was happening because the quantity of the original sale order was still reserved. So when creating the new delivery order there was no quantity available and the whole receiving process was required again. We now make sure to free the quantity before creating the delivery order opw-4092298 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#186484 Forward-Port-Of: odoo/odoo#185469
It defeats the purpose to use `SQL` with f-strings. We observed that if there is an uppercase letter in field names we get an error. Steps to reproduce: 1. Install account_reports 2. Add a manual field `x_M` to `account.move.line` 3. Open Profit and Loss report 4. Group by Analytic. Error (edited to reduce space): ``` 2024-11-13 11:12:53,437 1855548 ERROR test_17.4 odoo.sql_db: bad query: -- Create a temporary table, dropping not null constraints because we're not filling
Original PR description
It defeats the purpose to use `SQL` with f-strings. We observed that if there is an uppercase letter in field names we get an error. Steps to reproduce: 1. Install account_reports 2. Add a manual…
It defeats the purpose to use `SQL` with f-strings. We observed that if there is an uppercase letter in field names we get an error. Steps to reproduce:
1. Install account_reports
2. Add a manual field `x_M` to `account.move.line`
3. Open Profit and Loss report
4. Group by Analytic.
Error (edited to reduce space):
```
2024-11-13 11:12:53,437 1855548 ERROR test_17.4 odoo.sql_db: bad query:
-- Create a temporary table, dropping not null constraints because we're not filling those columns
CREATE TEMPORARY TABLE IF NOT EXISTS analytic_temp_account_move_line () inherits (account_move_line) ON COMMIT DROP;
ALTER TABLE analytic_temp_account_move_line NO INHERIT account_move_line;
ALTER TABLE analytic_temp_account_move_line DROP CONSTRAINT IF EXISTS account_move_line_check_amount_currency_balance_sign;
ALTER TABLE analytic_temp_account_move_line ALTER COLUMN move_id DROP NOT NULL;
ALTER TABLE analytic_temp_account_move_line ALTER COLUMN currency_id DROP NOT NULL;
INSERT INTO analytic_temp_account_move_line (...)
SELECT account_move_line.company_id AS "account_move_line.company_id",... to_jsonb(UNNEST(ARRAY[account_analytic_line.account_id, x_plan2_id, x_plan3_id])) AS "account_move_line.analytic_distribution", ... account_move_line.x_M AS "account_move_line.x_M", ...
FROM account_analytic_line
LEFT JOIN account_move_line
ON account_analytic_line.move_line_id = account_move_line.id
WHERE
account_analytic_line.general_account_id IS NOT NULL;
-- Create a supporting index to avoid seq.scans
CREATE INDEX IF NOT EXISTS analytic_temp_account_move_line__composite_idx ON analytic_temp_account_move_line (analytic_distribution, journal_id, date, company_id);
-- Update statistics for correct planning
ANALYZE analytic_temp_account_move_line
ERROR: column account_move_line.x_m does not exist
LINE 10: ... AS "account_move_line.discount_amount_currency", account_mo...
^
HINT: Perhaps you meant to reference the column "account_move_line.x_M".
```
After this patch the same query is:
```
-- Create a temporary table, dropping not null constraints because we're not filling those columns
CREATE TEMPORARY TABLE IF NOT EXISTS analytic_temp_account_move_line () inherits (account_move_line) ON COMMIT DROP;
ALTER TABLE analytic_temp_account_move_line NO INHERIT account_move_line;
ALTER TABLE analytic_temp_account_move_line DROP CONSTRAINT IF EXISTS account_move_line_check_amount_currency_balance_sign;
ALTER TABLE analytic_temp_account_move_line ALTER COLUMN move_id DROP NOT NULL;
ALTER TABLE analytic_temp_account_move_line ALTER COLUMN currency_id DROP NOT NULL;
INSERT INTO analytic_temp_account_move_line (...)
SELECT "account_move_line"."company_id" AS "account_move_line.company_id", ... "account_move_line"."x_M" AS "account_move_line.x_M", ... to_jsonb(UNNEST(ARRAY["account_analytic_line"."account_id", "account_analytic_line"."x_plan2_id", "account_analytic_line"."x_plan3_id"])) AS "account_move_line.analytic_distribution", ...
FROM account_analytic_line
LEFT JOIN account_move_line
ON account_analytic_line.move_line_id = account_move_line.id
WHERE
account_analytic_line.general_account_id IS NOT NULL;
-- Create a supporting index to avoid seq.scans
CREATE INDEX IF NOT EXISTS analytic_temp_account_move_line__composite_idx ON analytic_temp_account_move_line (analytic_distribution, journal_id, date, company_id);
-- Update statistics for correct planning
ANALYZE analytic_temp_account_move_line
```
A similar issue can be triggered if we add a manual field `x_plan2_id` to `account.move.line`:
```
ERROR: column reference "x_plan2_id" is ambiguous
LINE 10: ...nb(UNNEST(ARRAY[account_analytic_line.account_id, x_plan2_id...
```
Both issues are fixed here.
This was observed during upgrades. Mainly due to studio fields being generated with uppercase letters. Still, as shown above, it also fails for manual fields.
Forward-Port-Of: odoo/enterprise#73735### Steps to reproduce: - In the settings Enable Multi-steps route - Create a product FP with a BOM: - 1 component: 1 x COMP (tracked by SN) - 1 operation: "Register SN on COMP" - Add an instruction on your op: - type: "Register consumed component" - Product To Register: COMP - Put 2 SN for COMP: - SN01 in Stock/Shelf1 - SN02 in Stock/Shelf2 - Create and confirm an MO for 1 Unit of FP > SN01 is reserved on the COMP raw move. - Go to the shopfloor > "Register SN o
Original PR description
### Steps to reproduce: - In the settings Enable Multi-steps route - Create a product FP with a BOM: - 1 component: 1 x COMP (tracked by SN) - 1 operation: "Register SN on COMP" - Add an instruction…
### Steps to reproduce:
- In the settings Enable Multi-steps route
- Create a product FP with a BOM:
- 1 component: 1 x COMP (tracked by SN)
- 1 operation: "Register SN on COMP"
- Add an instruction on your op:
- type: "Register consumed component"
- Product To Register: COMP
- Put 2 SN for COMP:
- SN01 in Stock/Shelf1
- SN02 in Stock/Shelf2
- Create and confirm an MO for 1 Unit of FP
> SN01 is reserved on the COMP raw move.
- Go to the shopfloor > "Register SN on COMP"
- Change the SN of the COMP from SN01 to SN02
#### > Go back to the MO the incorrect location was used
### Cause of the issue:
While the lot is correctly updated by the action here: https://github.com/odoo/enterprise/blob/e90cf74be3945d1f1256d398ca9c4b61bc35ed08/mrp_workorder/models/quality.py#L485-L507 The associated quant is not set and hence the move location_id, package, ... are not updated with it.
### Fix:
We take advantage of the `quant_id` dummy field of the `stock.move.line` to update the info to write thanks to the write override: https://github.com/odoo/odoo/blob/09cac8b9e6d2db46dadece0442a8a947a49c9de7/addons/stock/models/stock_move_line.py#L85 https://github.com/odoo/odoo/blob/09cac8b9e6d2db46dadece0442a8a947a49c9de7/addons/stock/models/stock_move_line.py#L399-L400 https://github.com/odoo/odoo/blob/09cac8b9e6d2db46dadece0442a8a947a49c9de7/addons/stock/models/stock_move_line.py#L911-L920
### Note:
Unfortunately, the Dialog opened when clicking on the the quality check from the shopfloor:
https://github.com/odoo/enterprise/blob/34ab94cdcc49f4ade66953874a03f2988b2b4317/mrp_workorder/static/src/mrp_display/dialog/mrp_quality_check_confirmation_dialog.js#L12
is not embedded in a form view so that the onchange:
https://github.com/odoo/odoo/blob/366676cafdce00d55823c6daf41452b0c2373e4d/addons/stock/models/stock_move_line.py#L185-L192
is not triggered by our change of "lot_id".
opw-4149941
---
Forward-Port-Of: odoo/enterprise#73685
Forward-Port-Of: odoo/enterprise#72816Before this commit, the buttons "Add By-Product" and "Validate" are both visible when the user is in a by-product move line form view from the Barcode app. This should not happen. Forward-Port-Of: odoo/enterprise#73242
Original PR description
Before this commit, the buttons "Add By-Product" and "Validate" are both visible when the user is in a by-product move line form view from the Barcode app. This should not happen. Forward-Port-Of: odoo/enterprise#73242
1. Set up Avatax on the current company 2. In Settings > Sales > Quotations& Orders active 'Lock Confirmed Sales' 3. Create a SO with fiscal position 'Automatic Tax Mapping (AvaTax)' 4. Add a partner and product having avatax category defined 5. Compute taxes 6. Confirm order, it will be automatically locked 7. Click "Send by Email" Issue: Action will be blocked by User Error ``` It is forbidden to modify the following fields in a locked order ``` This occurs because when sending
Original PR description
1. Set up Avatax on the current company 2. In Settings > Sales > Quotations& Orders active 'Lock Confirmed Sales' 3. Create a SO with fiscal position 'Automatic Tax Mapping (AvaTax)' 4. Add a partner and product having avatax category defined 5. Compute taxes 6. Confirm order, it will be automatically locked 7. Click "Send by Email" Issue: Action will be blocked by User Error ``` It is forbidden to modify the following fields in a locked order ``` This occurs because when sending by email we recompute external taxes, but it should not be the case for locked orders It also occurs on the web shop when finalizing the payment opw-4261396 Forward-Port-Of: odoo/enterprise#73846 Forward-Port-Of: odoo/enterprise#73505
For the PFA (prime de fin d'année), the unpredictable leaves should be considered as paid. Task: 4331164 Forward-Port-Of: odoo/enterprise#73721
Original PR description
For the PFA (prime de fin d'année), the unpredictable leaves should be considered as paid. Task: 4331164 Forward-Port-Of: odoo/enterprise#73721