Daily updates from Odoo
Thursday, November 21, 2024
8 changes · 17.0
Enhancements to existing features
This update enhances the Odoo Amazon connector by making it more adaptable. Developers can now easily customize and extend the module's functionality to better suit their specific needs. This improves the overall flexibility and integration capabilities of the Amazon sales process within Odoo.
Original PR description
Add some hooks and tweaks to improve the experience to customize/improve on top of this module. Info: @wt-io-it
Resolved issues and error corrections
This update fixes an issue preventing users from duplicating resource bookings (like tennis courts) within the Appointments module. Previously, a validation error would occur, blocking the duplication process. This change ensures users can now successfully duplicate existing bookings, streamlining appointment scheduling.
Original PR description
Current behaviour: --- When trying to duplicate a resource booking containing a resource, you get a Validation Error for a missing field. Expected behaviour: --- Ability to duplicate a resource…
Current behaviour: --- When trying to duplicate a resource booking containing a resource, you get a Validation Error for a missing field. Expected behaviour: --- Ability to duplicate a resource booking Steps to reproduce: --- 1. Go to Appointments 2. Select a resource appointments (ie. Tennis Court) 3. Click on new (To make a new resource booking) 4. Set a name, attendee, AND resource (ie. Court 1) 5. Go to list view, and open newly made booking 6. Click on the cog > Duplicate 7. Validation Error Cause of the issue: --- Caused by: https://github.com/odoo/enterprise/commit/064e0da976edd7ef501e4fb33d4d579eaab85a3d When duplicating a calendar.event, at the field appointment_resource_ids, the relation table appointment_booking_line is used on the fields calendar_event_id and appointment_resource_id. However, the model appointment_booking_line has another required field capacity_reserved. So when inserting into the table: https://github.com/odoo/odoo/blob/b64a507697381fd7bb205f4a2b2217322d31811a/odoo/fields.py#L4945 Only the two specified columns/fields are set, but not the third required field capacity_reserved. Which causes a SQL error "violates not-null constraint" opw-4187159
This update corrects a dependency issue within the Odoo Enterprise HR Payroll module. A previous error was discovered regarding the connection between payroll and attendance modules, leading to problems during automated testing (runbot). This change ensures accurate payroll calculations and test results.
Original PR description
Introduced in https://github.com/odoo/enterprise/pull/73469 I made a mistake when checking module dependencies, `work_entry_source` attendance is not available in `hr_payroll`, the attendance module is separate. This move is needed to fix errors in runbot. opw-4266880
This update corrects an error in the Cash Basis reporting module that was causing incorrect amounts to be displayed for certain sales transactions. The issue stemmed from a flawed SQL query that wasn't properly handling multiple receivable accounts within a single payment. The fix ensures accurate reporting by adjusting the calculation of cash basis amounts.
Original PR description
**Steps to reproduce:** - Install Accounting and Point of Sale - Open a "Point of Sale" session - Create a POS order and pay it by bank - Create another POS order and pay it by Customer Account -…
**Steps to reproduce:** - Install Accounting and Point of Sale - Open a "Point of Sale" session - Create a POS order and pay it by bank - Create another POS order and pay it by Customer Account - Close POS session - Go to Accounting - Open Bank journal - Create a statement line and reconcile it with the POS payment - Go to "Accounting / Reporting / Audit Reports / General Ledger" - Check the amount of the POS orders in the following journals: * [101300] Account Receivable (PoS) * [121000] Account Receivable * [400000] Product Sales - Check "Cash Basis Method" in the options - Check again the amount of the POS orders in the same journals **Issue 1:** The amount for "[121000] Account Receivable" is present but it shouldn't because no payment has been done for it yet. **Extra steps:** - Create another statement line and reconcile it with the POS customer account payment - Check again the amount of the POS orders in the same journals **Issue 2:** The amount of the POS orders is double the original amount. **Issue 3:** If a partial payment is made for one line, the report has incorrect values. **Cause:** To retrieve the cash basis lines, a complex SQL query is executed. Let's take the following entries: - Invoice: | account | debit | credit | | ----------- | -------- | -------- | | Account Receivable 1 | 100 | 0 | | Account Receivable 2 | 200 | 0 | | Product Sales | 0 | 300 | - Payments: | account | debit | credit | | ---------------- | ------------ | ----------- | | Bank | 50 | 0 | | Account Receivable 1 | 0 | 50 | | account | debit | credit | | ------------ | ---------------- | ----------- | | Bank | 200 | 0 | | Account Receivable 2 | 0 | 200| A SELECT is executed to compute and get the percentage of the paid amount of each receivable/payable account by move, generating a temporary "table" as followed: | move_id | matched_percentage| | ------------------|---------------------------------| | 1 | 0.5 (50% paid for Account Receivable 1)| | 1 | 1.0 (100% paid for Account Receivable 2)| This table is then joined to account_move_line table on move_id where matched_percentage is applied to the amounts. Issues 1 and 2 are due to the fact that it was assumed that each account move would only contain 1 receivable/payable account, which is not the case here. As account_id is not present in the temporary table, it is not possible to identify to which account a line of that table refers to. As there is only a JOIN ON move_id when joining with account_move_line table, each aml from a move is taken into account even when it shouldn't. In this example, they are taken into account twice because the 2 entries have the same move_id. Issue 3 is coming from the fact that the WHOLE amount of "Product Sales" is computed with matched_percentage each time. For example, these 2 lines are computed from the tempory table for "Product Sales": * Product Sales = 300 * 0.5 = 150 (for Account Receivable 1) * Product Sales = 300 * 1.0 = 300 (for Account Receivable 2) The amount for "Product Sales" sums to 450, which is not correct. It should be 250. **Solution for issues 1 and 2:** Get account_id and join account_move_line table on it. An exception should be done for "Product Sales" when joining account_move_line table because it is not a receivable/payable account and the temporay table only contains receivable/payable accounts. **Solution for issue 3:** Compute a ratio for "Product Sales" for each receivable account. Its amount is 100 for "Account Receivable 1" and 200 for "Account Receivable 2" So its ratio should be: * 100 / 300 = 0.33 (for Account Receivable 1) * 100 / 300 = 0.66 (for Account Receivable 2) By applying this ratio, the correct amounts are computed for "Product Sales": * Product Sales = 300 * 0.5 * 0.33 = 50 (for Account Receivable 1) * Product Sales = 300 * 1.0 * 0.66 = 200 (for Account Receivable 2) opw-4224136 Forward-Port-Of: odoo/enterprise#73593
This update fixes an issue where profitability reports for subscription projects weren't accurately reflecting invoiced amounts when using custom analytic plans. The change ensures the system correctly identifies the appropriate analytic account data, leading to more precise revenue reporting. This improves the accuracy of financial insights for subscription-based projects.
Original PR description
### Steps to reproduce: - Create a new project and set it to be billable. - Set an analytic account on it - On the analytic account, set a plan that is not the default plan - Create a sale order for…
### Steps to reproduce:
- Create a new project and set it to be billable.
- Set an analytic account on it
- On the analytic account, set a plan that is not the default plan
- Create a sale order for a subscription product with this analytic account and confirm it.
- Create an invoice and confirm it.
- Go to the project and click on Status Updates
- Notice that the revenues show 0 in “Invoiced” even though we have invoiced the product
- If we change the plan on the analytic account, we will be able to see the invoiced amount on the profitability report
### Current behavior before PR:
When setting analytic account with different analytic plan than the default one the analytic account value will be stored in x_plan{plan_id}_id field when creating the analytic account line record. https://github.com/odoo/odoo/blob/39029710bbce55889c6b951fc423c1254e05ff22/addons/account/models/account_move_line.py#L3092
https://github.com/odoo/odoo/blob/17.0/addons/analytic/models/analytic_plan.py#L106:L122
So when fetching the profitability data for a project we are just checking the account_id field.
https://github.com/odoo/enterprise/blob/17.0/project_sale_subscription/models/project.py#L111:L115
### Desired behavior after PR is merged:
We are now using the same method of _column_name() to know which field should we use in the domain whether it is 'account_id' or 'x_plan{plan_id}_id'
opw-4137931This update reduces the size of spreadsheet thumbnails, resulting in faster loading times and reduced storage usage. While image quality was slightly decreased, the thumbnails are so small that the visual impact is negligible. This change focuses on optimizing performance and resource efficiency.
Original PR description
This commit drastically reduces the spreadsheet thumbnails size. Go to CRM lead and insert the pivot in a spreadsheet: The size of the thumbnail: | Description | Size | |-----------------------|--------| | Before | 107Kb | | After quality=0.5 | 7.8Kb | | After quality=0 | 2.9Kb | Image quality is indeed reduced, but the thumbnails are always displayed so small that it doesn't really make any difference to the naked eye. Note: I'm not backporting this fix to 16.0 because the code changed and webp was not supported at the time (even though we could use jpeg) Task: 4337496
This update adds the picking name as a reference number to UPS shipments. This enhancement allows for more precise tracking of deliveries within Odoo, aligning with shipping best practices and providing better visibility for our customers. It resolves an internal task (opw-3930816) to improve the accuracy of UPS shipment data.
Original PR description
Add the picking name as a reference number on ups shipment. [opw-3930816](https://www.odoo.com/odoo/project/49/tasks/3930816) Forward-Port-Of: odoo/enterprise#67303
This update fixes a bug that prevented users from editing locked sales orders with automatic tax calculations (AvaTax). The system attempted to recompute taxes after confirmation, leading to an error. This change ensures users can correctly preview and manage these orders without encountering this issue.
Original PR description
An error will raise when users try to open a locked SO where taxes are automatically computed Set up Avatax on the current company In Settings > Sales > Quotations& Orders active 'Lock Confirmed Sales' Create a SO with fiscal position 'Automatic Tax Mapping (AvaTax)' Add a partner and product having avatax category defined Compute taxes Confirm order, it will be automatically locked - With only sale_external_tax installed: Click "Preview" - With sale_subscription_external_tax installed: Click "Confirm" Issue: Action will be blocked by User Error ``` It is forbidden to modify the following fields in a locked order ``` This occurs because the system attempt to recompute external taxes after confirming the sale order, which has been locked, so the action will be blocked opw-4261396