Daily updates from Odoo
Wednesday, April 10, 2024
16 changes · master
Enhancements to existing features
Financial report formulas will no longer silently turn division-by-zero results into zero by default, reducing the risk of misleading figures. Existing reports that intentionally used the old behavior were updated to preserve their results, while future report formulas must explicitly choose this fallback when needed.
Original PR description
In an aggregation, when a 0-division happens in a formula, the result of the formula will be set to 0. This way of handling 0-division is counter-intuitive and could potentially create errors in the reports. This commit takes the default 0-division safety off, which forces the dev to think about- and fix these issues. To enable the safety, a developer can enter 'ignore_zero_division' as a subformula on an aggregation. The 'ignore_zero_division' subformula was added to existing reports and testcases to stay consistent with earlier versions. task: 3774403
Aging reports can now use user-defined time intervals instead of being limited to fixed 30-day periods. This gives businesses more flexibility in reviewing overdue receivables and payables, while preventing invalid interval values below one.
Original PR description
This improvement expands the functionality of the ageing reports by introducing a customizable aging report based on aging intervals. Previously, the aging intervals were fixed at 30 days, but with this PR, users can now input intervals greater than one, Also for intervals less than one an error is thrown. Task-3669642
Resolved issues and error corrections
This fixes access settings for Australian payroll employee fields so they are only available to appropriate HR users. It prevents errors caused by payroll-related information appearing in the public employee profile where it should not be accessible.
Original PR description
Issues: The model hr.employee requires the group hr.group_hr_user for fields that are not accessible in the employee public profile. The new fields missed the groups. https://runbot.odoo.com/web#id=61373&view_type=form&model=runbot.build.error&menu_id=405&cids=1 Fix: Adds the missing groups on the fields `l10n_au_super_account_ids,super_account_warning` on h.employee.
This fixes an issue where items could appear in the wrong order on the preparation display when starting a database. Staff will see orders in the intended sequence, reducing confusion during preparation workflows.
Original PR description
Make the sequence ordered works in preparation display when starting a db
Grouping planning shifts by role no longer fails when an employee has no working calendar assigned. This keeps planning views usable even when employee schedule information is incomplete.
Original PR description
Steps to Reproduce:
----------
- Install the planning module.
- Navigate to the employee app.
- Create an employee without a working calendar.
- Navigate to the planning app.
- Create a shift.
- Try to group shifts by role.
Issue:
-------
When trying to group shifts by role, a traceback occurs if an employee is without
a working calendar.
Cause
-----
The traceback arises due to the inability to find work intervals for resources without
a working calendar.
Solution:
----------
If a resource has a working calendar, the system retrieves work intervals; otherwise,
it sets the intervals to 0.
task-3858539Fixed an issue that could prevent the Planning schedule from loading when viewed by role. The system now skips a work-hours calculation when the schedule is not grouped by resource, avoiding an error and allowing planners to access the view normally.
Original PR description
Before this commit, when only planning app is installed and the user goes to Planning > Schedule > By Role, a traceback is raised because the resource_id is not found inside work intervals fetched.…
Before this commit, when only planning app is installed and the user goes to Planning > Schedule > By Role, a traceback is raised because the resource_id is not found inside work intervals fetched. The reason is because `this.row.resId` is the resource id only if the first group is resource_id and not something else and so when the group by is `role_id > resource_id` the `resId` will return the role id and not the resource id. It would mean the compute work hours should not be done when the group by does not start by resource. This commit avoids computing the work hours when the progressField is not a employee, that is, when the group by does not start by resource_id. Affected version(s): master Steps to reproduce the issue: ============================ 1. Install planning app 2. Go to planning > Schedule > By Role Current Behavior: ================ A traceback is occured because a role id is not found inside work intervals per resource id. Expected Behavior: ================= The Gantt view should be loaded without any issue. runbot-61438 X-original-commit: 5831c225
Code cleanup and technical improvements
This update reorganizes internal Discuss and messaging code to make it easier for Odoo teams to maintain and test. It affects related business apps that use chatter, comments, calls, documents, signing, spreadsheets, and project communication, without introducing a new user-facing feature.
Original PR description
- move many services function to record methods - rename `Record._store` to `Record.store`, for consistency and reasurre it's fine to rely on store in code of models - replace explicit `rpcWithEnv` to `mail.rpc` service. This is slightly easier to use and maintain in code, and is more exact to how HOOT works. https://github.com/odoo/odoo/pull/160798
This update simplifies the internal code that powers discussions, comments, and related messaging features across several apps. It should make future maintenance easier and reduce complexity without changing the intended user experience.
Original PR description
Discuss code is more complicated than it should. Part of it
comes from split in arbitrary services, which are both confusing
and very verbose.
This commit removes the `mail.message` service: related features
have been moved to the appropriate model.
For example:
```js
this.env.services["mail.message"].edit(message, "new-content");
// =>
message.edit("new-content");
```
https://github.com/odoo/odoo/pull/161255This update simplifies the internal code behind Odoo discussions by moving responsibilities from separate technical services into the relevant records themselves. It should make future maintenance easier and reduce complexity without changing the day-to-day user experience.
Original PR description
Discuss code is more complicated than it should. Part of it comes from split in arbitrary services, which are both confusing and very verbose. This commit removes the `mail.persona` service: related features have been moved to the appropriate model. For example: ```js this.env.services["mail.persona"].updateGuestName(guest, newName); // => guest.updateGuestName(newName); ``` Note: persona mixes partners & guests. This method only applies to guests, hence keeping the "guest" word in method name. https://github.com/odoo/odoo/pull/161266
The Discuss code has been streamlined by moving attachment actions into the relevant data models instead of a separate service. This reduces internal complexity and makes future maintenance easier, with little expected direct impact for end users.
Original PR description
Discuss code is more complicated than it should. Part of it comes from split in arbitrary services, which are both confusing and very verbose. This commit removes the `mail.attachment` service: related features have been moved to the appropriate model. For example: ```js this.env.services["mail.attachment"].remove(attachment); // => attachment.delete(); ``` Note: remove/delete wording in service was conflicting with core model feature, e.g. "delete" means server-side deletion while "remove" is basically record.delete(). To match wording with other parts of code, their name have been inverted: - server-side deletion is "remove" - local deletion is "delete"
Miscellaneous changes
### Steps to reproduce issue: 1. In settings, activate Timesheets and Project Stages 2. Create Project with Timesheets enabled 3. In the project, create a new task in the kanban view 4. Give the task a title 5. Choose an Asignee 6. The title disappeared ### Explanation: The title field, `display_name`, is a computed field that gets its value from `name`. This compute has dependencies coming from other computed values. One of them, `allocated_hours` has a dependency to user_ids, mak
Original PR description
### Steps to reproduce issue: 1. In settings, activate Timesheets and Project Stages 2. Create Project with Timesheets enabled 3. In the project, create a new task in the kanban view 4. Give the task…
### Steps to reproduce issue: 1. In settings, activate Timesheets and Project Stages 2. Create Project with Timesheets enabled 3. In the project, create a new task in the kanban view 4. Give the task a title 5. Choose an Asignee 6. The title disappeared ### Explanation: The title field, `display_name`, is a computed field that gets its value from `name`. This compute has dependencies coming from other computed values. One of them, `allocated_hours` has a dependency to user_ids, making the whole chain trigger when a user is added to or removed from the Assignees. https://github.com/odoo/enterprise/blob/c2dde10834b1ef31fe4564a49c90c461a348b392/project_enterprise/models/project_task.py#L83-L84 ### Suggested fix: `display_name` is used in very few situations, either in the kanban view or in a dropdown menu. Those two cases do not require reactiveness from the compute method. As a matter of fact, except for the current issue, `_compute_display_name` does not seem to be called by another field's onchange. Fix in Community, Test in Enterprise opw-3823040 Forward-Port-Of: odoo/enterprise#60280 Forward-Port-Of: odoo/enterprise#59646
We are planning to upgrade the pylint version since ruff is now fully deployed. This will fix some of the issue that where not detected with the previous version Note: `self.transaction_ids` could raise, this is why we have no garantee that `existing_transactions` will be defined. But the try except does not look to manage this case, this is why it should be safe to move this line outside the try. Forward-Port-Of: odoo/enterprise#60233
Original PR description
We are planning to upgrade the pylint version since ruff is now fully deployed. This will fix some of the issue that where not detected with the previous version Note: `self.transaction_ids` could raise, this is why we have no garantee that `existing_transactions` will be defined. But the try except does not look to manage this case, this is why it should be safe to move this line outside the try. Forward-Port-Of: odoo/enterprise#60233
… the cart -> 17.0 Steps to reproduce : -> Add a rental product to your cart with a rental period -> Go to the cart -> Remove one of the date from the rental period (either pickup date or return date) Issue : -> Get this traceback Cause: -> when we remove the date from the cart we find a traceback of 'start_date'. Solution: -> Added the condition so if the we remove the start date or end date we not get the traceback. opw-3638268 Forward-Port-Of: odoo/enterprise#58667
Original PR description
… the cart -> 17.0 Steps to reproduce : -> Add a rental product to your cart with a rental period -> Go to the cart -> Remove one of the date from the rental period (either pickup date or return date) Issue : -> Get this traceback Cause: -> when we remove the date from the cart we find a traceback of 'start_date'. Solution: -> Added the condition so if the we remove the start date or end date we not get the traceback. opw-3638268 Forward-Port-Of: odoo/enterprise#58667
**Current behavior:** The `rental.schedule` model/view does not have serial number data for order lines which are constructed while the `Rental Transfers` config option is active. This prevents the view from accurately grouping by serial number. **Expected behavior:** The schedule view will correctly group the records in this gantt view. **Steps to reproduce:** 1. Create a new rental product, ensure it has the 'By Unique Serial Number' tracking option 2. Create an on hand instance of
Original PR description
**Current behavior:** The `rental.schedule` model/view does not have serial number data for order lines which are constructed while the `Rental Transfers` config option is active. This prevents the…
**Current behavior:** The `rental.schedule` model/view does not have serial number data for order lines which are constructed while the `Rental Transfers` config option is active. This prevents the view from accurately grouping by serial number. **Expected behavior:** The schedule view will correctly group the records in this gantt view. **Steps to reproduce:** 1. Create a new rental product, ensure it has the 'By Unique Serial Number' tracking option 2. Create an on hand instance of this product with a serial number 3. In Rental settings, enable the `Rental Transfers` option 3. Create a new rental order for this product, go to the `Schedule` view in the Rental app, select Group By Serial Number, observe that the new order is listed as having an undefined serial number **Cause of the issue:** When the Rental Transfers option is enabled, the wizard which normally tracks rental pickups/returns gets circumvented to instead get organized via stock. The SQL view for the schedule model only looks in the tables managed by this wizard to find lot_ids of products included in rental orders. So when we don't use the wizard, that information never makes it to the proper place. **Fix:** Union the current view's table result with another query which will select the data for the excluded records. opw-3754422 Forward-Port-Of: odoo/enterprise#58986
**Steps to reproduce:** (requires a real certificate and a real CAF) - Install Accounting and l10n_cl_edi_boletas - Switch to a Chilean company - Configure the localization settings with a real certificate and a real CAF - Create an invoice: * Customer: [a Chilean customer] (e.g. Blanco Martin & Asociados) * Document Type: (39) Boleta Electrónica * Product: [any] - Confirm the invoice - Click on "Send Now to SII" - "SII DTE status" will be "Ask For Status" and "Send Now to SII" w
Original PR description
**Steps to reproduce:** (requires a real certificate and a real CAF) - Install Accounting and l10n_cl_edi_boletas - Switch to a Chilean company - Configure the localization settings with a real…
**Steps to reproduce:** (requires a real certificate and a real CAF) - Install Accounting and l10n_cl_edi_boletas - Switch to a Chilean company - Configure the localization settings with a real certificate and a real CAF - Create an invoice: * Customer: [a Chilean customer] (e.g. Blanco Martin & Asociados) * Document Type: (39) Boleta Electrónica * Product: [any] - Confirm the invoice - Click on "Send Now to SII" - "SII DTE status" will be "Ask For Status" and "Send Now to SII" will change to "Verify on SII" - As soon as it changes to "Verify on SII", click on it - Repeat clicking on "Verify on SII" as soon as it becomes clickable **Issue:** At some point, "SII DTE status" will switch from "Ask For Status" to "Rejected", even if the invoice has not been officially rejected. And as "Verify on SII" link will not be available anymore, it will not be possible to correct the SII DTE status. **Cause:** While checking the SII result after clicking on "Verify on SII", we could receive a response with "estado: SOK" and "estadistica: []". This combination doesn't allow to determine a specific status for the SII DTE and therefore falls back on the default status that is "Rejected". **Solution:** If the SII DTE status cannot be determined, we should use "Ask For Status" as a fallback status to allow verifying it again. opw-3781373 Forward-Port-Of: odoo/enterprise#60284 Forward-Port-Of: odoo/enterprise#59523
When a register payment is made with a writeoff in foreign currency and when the user set manually an exchange difference account, don't create a write-off. Instead, 2 cases to consider: - When the payment is expressed in a foreign currency different than the invoice's one, play with the rate between amount_currency and balance and let odoo making an exchange difference accordingly. That way, the payment has no write-off and the invoice is fully paid. - When the payment is expressed in co
Original PR description
When a register payment is made with a writeoff in foreign currency and when the user set manually an exchange difference account, don't create a write-off. Instead, 2 cases to consider: - When the payment is expressed in a foreign currency different than the invoice's one, play with the rate between amount_currency and balance and let odoo making an exchange difference accordingly. That way, the payment has no write-off and the invoice is fully paid. - When the payment is expressed in company currency but the invoice has a foreign currency, force the exchange difference to use a rate that will fully paid the invoice without creating any write-off line on the payment. task_id: 3717436 Forward-Port-Of: odoo/enterprise#58511