Thursday, January 23, 2025
19 changes · saas-17.4
Enhancements to existing features
PDF exports of the journal report no longer add AR, AP, or G prefixes to account codes. This restores the previous presentation, making exported reports easier to read and consistent with expected account code formatting.
Original PR description
The goal of this commit is to remove the AR, AP and G prefix when exporting the journal report to a PDF. This was first introduced here: https://github.com/odoo/enterprise/commit/d023d914dce1b23bf321252fb844c780e831f003 We now want to revert back that idea task-4453514
Resolved issues and error corrections
Paid bill installments are no longer included in the late bills count on the accounting dashboard. This helps finance teams see a more accurate view of overdue supplier bills and avoid unnecessary follow-up on items that are already settled.
Original PR description
**[FIX] account: Account Journal Late Bills Count** This fix mitigates an issue when a line of a Bill is paid but appears in the late Bills count in the dashboard. **Steps to reproduce:** 1. Create a payment term to pay in installemts. 2. Create a bill an X amount back in the past to have one installment as late. 3 - Pay the late installment **Issue**: The paid installment will still be counted as late in the dashboard. **Fix**: filter out line with residual amount different than zero. _opw-4327227_ --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Before this commit, when a new res.user is created after signing in with auth_ldap, there was no email on the linked res.partner, which may cause issues in modules such as helpdesk, where partner email is used to find related tickets. res.users created through the form view will trigger the onchange which sets the 'email' = 'login', which does not happen when creating a user directly through the ORM. This commit adds 'email' as a key which is returned by the method _map_ldap_attributes, wh
Original PR description
Before this commit, when a new res.user is created after signing in with auth_ldap, there was no email on the linked res.partner, which may cause issues in modules such as helpdesk, where partner email is used to find related tickets. res.users created through the form view will trigger the onchange which sets the 'email' = 'login', which does not happen when creating a user directly through the ORM. This commit adds 'email' as a key which is returned by the method _map_ldap_attributes, which is used to create new partners with the correct email associated with the res.user login. opw-4378487 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193495
When users add a timesheet line and choose a task before choosing a project, the related project is now filled in automatically. This prevents missing project information and reduces manual correction when logging time linked to helpdesk work.
Original PR description
### Steps to reproduce: - Install helpdesk_sale_timesheet module - Go to Timesheets and click on 'Add a line' - Set a task while the project is empty - Notice the project is not automatically filled with the task's project ### Cause: This is happening because while changing the task it trigger the computation of the helpdesk_ticket_id where it checks if something changed and if not we are removing the project_id from the computation tree. https://github.com/odoo/enterprise/blob/f53841d756c532a95fccc15aca986143dfb53337/helpdesk_timesheet/models/analytic.py#L54-L60 ### Fix: Checking if the record is not created yet we won't remove the project_id from the computation tree to make sure it will get computed and auto-populate opw-4478579 opw-4457347
Adds a configuration that can be used to mitigate PostgreSQL transactional errors with long-living connections and the `LISTEN/NOTIFY`[^1] functionality by re-establishing the database connection periodically. In the case that a connection outlives the transaction wraparound[^2] mechanism of postgres, the `LISTEN/NOTIFY` internal queue might contain references to transactions that have already been deleted by the system's (or a manual) `VACUUM`[^3] as it has its own transaction validit
Original PR description
Adds a configuration that can be used to mitigate PostgreSQL transactional errors with long-living connections and the `LISTEN/NOTIFY`[^1] functionality by re-establishing the database connection…
Adds a configuration that can be used to mitigate PostgreSQL
transactional errors with long-living connections and the
`LISTEN/NOTIFY`[^1] functionality by re-establishing the database
connection periodically.
In the case that a connection outlives the transaction wraparound[^2]
mechanism of postgres, the `LISTEN/NOTIFY` internal queue might contain
references to transactions that have already been deleted by the
system's (or a manual) `VACUUM`[^3] as it has its own transaction
validity mechanisms (roughly comparing transaction ids).
This can be reproduced by:
- Triggering a wraparound _AND_ cleaning of pg_xact between the cron's
`LISTEN` + `COMMIT` and its recyling.
- Having done at least one `NOTIFY` during that time period (?).
- Try to `LISTEN` to the same channel on the same database (transcation
id must be < than the first connection's transaction id).
The following is an example error message:
```
ERROR database odoo.service.server: Worker (3194772) Exception occurred, exiting...
Traceback (most recent call last):
File "/home/user/odoo/service/server.py", line 1089, in run
self.start()
File "/home/user/odoo/service/server.py", line 1235, in start
self.dbcursor.commit()
File "/home/user/odoo/sql_db.py", line 480, in commit
result = self._cnx.commit()
^^^^^^^^^^^^^^^^^^
psycopg2.errors.UndefinedFile: could not access status of transaction 1194816979
DETAIL: Could not open file "pg_xact/0473": No such file or directory.
```
[LISTEN/NOTIFY code](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c)
[Connection being kept](https://github.com/postgres/postgres/blob/REL_16_STABLE/src/backend/commands/async.c#L2167-L2191)
[See more](https://www.postgresql.org/message-id/flat/VE1PR03MB531295B1BDCFE422441B15FD92499%40VE1PR03MB5312.eurprd03.prod.outlook.com#7e36d1fdca921b5292e92c7017984ffa)
[^1]: https://www.postgresql.org/docs/current/sql-notify.html
[^2]: https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
[^3]: https://www.postgresql.org/docs/17/sql-vacuum.html
Forward-Port-Of: odoo/odoo#194742
Forward-Port-Of: odoo/odoo#194141This PR addresses the layout issue in the sidebar of the portal, where a preview of the customer's invoice is displayed. Before this PR, users encountered a broken layout for large invoice amounts, making it difficult to read the total. This issue is resolved in this PR by adding a rules for the `h2` and `span` fields ensuring proper wrapping for better readability. Steps to reproduce: - Login as admin. - Go to Website app. - Navigate to "My account" at my/home url. - Click on "
Original PR description
This PR addresses the layout issue in the sidebar of the portal, where a preview of the customer's invoice is displayed. Before this PR, users encountered a broken layout for large invoice amounts, making it difficult to read the total. This issue is resolved in this PR by adding a rules for the `h2` and `span` fields ensuring proper wrapping for better readability. Steps to reproduce: - Login as admin. - Go to Website app. - Navigate to "My account" at my/home url. - Click on "My invoices" or navigate to my/invoices url. - Click on one invoice in order to see its preview. - Via the browser tools, edit the amount of on the left sidebar and insert a very big number. task-4435472 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192769
Steps to Reproduce: • Install the Time Off app. • Create a new user and corresponding employee without any group in Time Off. • Create a new time off request with a start date < today's date. • Attempt to change the date, which results in a validation error. Issue: - Users are unable to modify time off requests, even if they are not yet approved. Fix: - Added a check to ensure that modifications are allowed for time off requests that are not in an approved state. task-4236572
Original PR description
Steps to Reproduce: • Install the Time Off app. • Create a new user and corresponding employee without any group in Time Off. • Create a new time off request with a start date < today's date. • Attempt to change the date, which results in a validation error. Issue: - Users are unable to modify time off requests, even if they are not yet approved. Fix: - Added a check to ensure that modifications are allowed for time off requests that are not in an approved state. task-4236572 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194718 Forward-Port-Of: odoo/odoo#190944
**Steps to reproduce:** 1) Select the QR Codes option in settings (IN Company) 2) Do not enter an upi id in the company profile. 3) Go to invoice and preview/print the invoice. 4) Show that QR code without upi id and upi logos visible. **Cause:** - The condition of the upi id is not properly set to hide the block if upi is not set. **Fix:** - With this PR, the upi QR code and upi logos will not be visible if the upi id is not set. **task**-4426634 Forward-Port-Of: odoo/odoo#19206
Original PR description
**Steps to reproduce:** 1) Select the QR Codes option in settings (IN Company) 2) Do not enter an upi id in the company profile. 3) Go to invoice and preview/print the invoice. 4) Show that QR code without upi id and upi logos visible. **Cause:** - The condition of the upi id is not properly set to hide the block if upi is not set. **Fix:** - With this PR, the upi QR code and upi logos will not be visible if the upi id is not set. **task**-4426634 Forward-Port-Of: odoo/odoo#192068
We update quote detection for gmail and outlook: - gmail has simple wrapper divs with explicit classes - outlook has a mix of div ids and simple pattern-based quoting (everything under "<hr><div id="divRplyFwdMsg"/> seems to be considered a quote) Previously gmail just used blockquote, which still works but does not capture "On xx:xx:xx X <X@gmail.com> wrote:" headers, which are caught for outlook. Previously outlook had a wrapper div around divRplyFwdMsg which would set data-o-mail-quot
Original PR description
We update quote detection for gmail and outlook: - gmail has simple wrapper divs with explicit classes - outlook has a mix of div ids and simple pattern-based quoting (everything under "<hr><div id="divRplyFwdMsg"/> seems to be considered a quote) Previously gmail just used blockquote, which still works but does not capture "On xx:xx:xx X <X@gmail.com> wrote:" headers, which are caught for outlook. Previously outlook had a wrapper div around divRplyFwdMsg which would set data-o-mail-quote-container on it, and propagate to children. However it seems that outer div was either removed or is not always present, a heuristic is thus needed. task-4381505 Forward-Port-Of: odoo/odoo#194615 Forward-Port-Of: odoo/odoo#192875
This commit add few data on the report_invoice for Mauritius localization. task-4379202 Forward-Port-Of: odoo/odoo#190723
Original PR description
This commit add few data on the report_invoice for Mauritius localization. task-4379202 Forward-Port-Of: odoo/odoo#190723
Our "supported" method filtering detected printers had a condition introduced in v17 which was too strict and filtering out the STAR printers, so they were never detected anymore. This PR fixes this issue related PR: #174436 Forward-Port-Of: odoo/odoo#190367
Original PR description
Our "supported" method filtering detected printers had a condition introduced in v17 which was too strict and filtering out the STAR printers, so they were never detected anymore. This PR fixes this issue related PR: #174436 Forward-Port-Of: odoo/odoo#190367
Before this commit: =================== - The purchase tour was failing because the tour's JavaScript used an incorrect class selector (targeting 'partner_id'), which prevented it from locating the intended DOM element. Consequently, the sequence of actions was interrupted, causing the tour to break midway. After this commit: =================== - The issue has been resolved by updating the tour to use the correct and unique class selector. This ensures the tour accurately tar
Original PR description
Before this commit: =================== - The purchase tour was failing because the tour's JavaScript used an incorrect class selector (targeting 'partner_id'), which prevented it from locating the intended DOM element. Consequently, the sequence of actions was interrupted, causing the tour to break midway. After this commit: =================== - The issue has been resolved by updating the tour to use the correct and unique class selector. This ensures the tour accurately targets the intended element, allowing it to proceed without interruptions. As a result, the purchase tour runs successfully and achieves its intended purpose. TaskId: 4268662 Forward-Port-Of: odoo/odoo#194562 Forward-Port-Of: odoo/odoo#184735
- add `alert alert-warning` as classes instead of adding style color to unify the warning visual Task: 4432816 Forward-Port-Of: odoo/enterprise#77596 Forward-Port-Of: odoo/enterprise#77161
Original PR description
- add `alert alert-warning` as classes instead of adding style color to unify the warning visual Task: 4432816 Forward-Port-Of: odoo/enterprise#77596 Forward-Port-Of: odoo/enterprise#77161
Before this commit, `_compute_past_shift` method will compute the `is_past` but also set `request_to_switch` field to False when the shift is in the past and `request_to_switch` was truely. The problem is the `_compute_past_shift` could be only called to read `is_past` field and so the cursor is sometimes in readonly to only allow SQL queries to fetch data. This commit makes sure the `_compute_past_shift` method will only alter `is_past` field and alter `request_to_switch` inside the met
Original PR description
Before this commit, `_compute_past_shift` method will compute the `is_past` but also set `request_to_switch` field to False when the shift is in the past and `request_to_switch` was truely. The problem is the `_compute_past_shift` could be only called to read `is_past` field and so the cursor is sometimes in readonly to only allow SQL queries to fetch data. This commit makes sure the `_compute_past_shift` method will only alter `is_past` field and alter `request_to_switch` inside the method that could be called when `request_to_switch` is truly for the shift contains in self. A cron is not added to make sure the request_to_switch for the shifts in the past will be set to False because the actual code is sufficient since we usually check if the shift is in the past before allowing the action or displaying the button. runbot-66162 task-4276516 Forward-Port-Of: odoo/enterprise#68031
# Issue Account Manager permission is required to access the payment journal. # Expected In previous and later versions of Odoo this permission was given by ‘account.group_account_user’. # FIX This PR removes XPATH because original groups of the [Base View](https://github.com/odoo/odoo/blob/16.0/addons/account/views/account_payment_view.xml#L234) are capable to see Journal Entries/Items. Removing `account.group_account_readonly` via account_accountant module inheritance is unnecessary
Original PR description
# Issue Account Manager permission is required to access the payment journal. # Expected In previous and later versions of Odoo this permission was given by ‘account.group_account_user’. # FIX This…
# Issue Account Manager permission is required to access the payment journal. # Expected In previous and later versions of Odoo this permission was given by ‘account.group_account_user’. # FIX This PR removes XPATH because original groups of the [Base View](https://github.com/odoo/odoo/blob/16.0/addons/account/views/account_payment_view.xml#L234) are capable to see Journal Entries/Items. Removing `account.group_account_readonly` via account_accountant module inheritance is unnecessary and it's more restrictive. If some restriction wants to be applied, should be done in Base View. # Additional Context/Explanation This PR was done 3 months ago https://github.com/odoo/enterprise/commit/06e95b281dc000e5f3904b6051fe81afe8db3989 on v18, but the XPATH overrides the original group removing the `account.group_account_readonly`, which has enough permissions to see Journal Entries (even with a Menu Item). Reasoned with @hupo-odoo on https://github.com/odoo/enterprise/pull/76802#issuecomment-2586509116 that we need to get rid of the xpath instead of backport the functionality. ## Explaining briefly involved groups: - `account.group_account_invoice`: You can see payments (with menu) and invoices, but you can't see journal entries on a menu. - `account.group_account_readonly`: You can see Journal Entries/Items menu and Payments. - `account.group_account_user`: Inherits from `account.group_account_readonly`. - `account.group_account_manager`: Inherits from `account.group_account_user`. # Available Forward Ports ## v17: account_accountant xpath: https://github.com/odoo/enterprise/blame/17.0/account_accountant/views/account_payment_views.xml#L8-L10 base view: https://github.com/odoo/odoo/blob/17.0/addons/account/views/account_payment_view.xml#L242 ## v18 account_accountant xpath: https://github.com/odoo/enterprise/blame/18.0/account_accountant/views/account_payment_views.xml#L8-L10 base view: https://github.com/odoo/odoo/blob/18.0/addons/account/views/account_payment_view.xml#L232 --- MT-8088 @moduon @edlopen @hupo-odoo @yajo @rafaelbn please review if you want :) OPW-4465140 Forward-Port-Of: odoo/enterprise#77129
…footer Before this commit, when in the report editor, trying to add a field in the footer, the main doc's fields were proposed. This was wrong because header and footer are generic views that can treat any record at once. They just set an internal variable for the company of the record, which should be the only available model to add fields from. After this commit, it is not possible to add fields from anything else than the "company" variable opw-4471868 Forward-Port-Of: odoo/ente
Original PR description
…footer Before this commit, when in the report editor, trying to add a field in the footer, the main doc's fields were proposed. This was wrong because header and footer are generic views that can treat any record at once. They just set an internal variable for the company of the record, which should be the only available model to add fields from. After this commit, it is not possible to add fields from anything else than the "company" variable opw-4471868 Forward-Port-Of: odoo/enterprise#77500 Forward-Port-Of: odoo/enterprise#77234
The uninstallation of this test module, which is a standard step during upgrades, requires the removal of the test product `product_fire_insurance`. This product is referenced by sale orders and invoices and deferred invoices created dynamically and have no xmlids, blocking the removal of the record. This commits adds the xmlids to the dynamically created orders and moves so they can be removed as well during the module uninstallation. The target sale orders are those created via 'copy' and whe
Original PR description
The uninstallation of this test module, which is a standard step during upgrades, requires the removal of the test product `product_fire_insurance`. This product is referenced by sale orders and invoices and deferred invoices created dynamically and have no xmlids, blocking the removal of the record. This commits adds the xmlids to the dynamically created orders and moves so they can be removed as well during the module uninstallation. The target sale orders are those created via 'copy' and when doing upsell and renew for subscriptions. The target moves are the regular invoices for the sale orders and their deferred moves. Forward-Port-Of: odoo/enterprise#77195 Forward-Port-Of: odoo/enterprise#76813
Steps to reproduce: ----- - Create a FSM task - Add products - Mark as done - Create invoice - Duplicate the task Issue: ----- The newly created task is linked to the invoice of the duplicated task. This comportment is not intended. Fix: ---- Creation of the copy method so the sale_order_id and the sale_line_id get set to false when duplicating a record. opw-4393596 Forward-Port-Of: odoo/enterprise#76547
Original PR description
Steps to reproduce: ----- - Create a FSM task - Add products - Mark as done - Create invoice - Duplicate the task Issue: ----- The newly created task is linked to the invoice of the duplicated task. This comportment is not intended. Fix: ---- Creation of the copy method so the sale_order_id and the sale_line_id get set to false when duplicating a record. opw-4393596 Forward-Port-Of: odoo/enterprise#76547
**Steps to reproduce:** - Install Accounting - Go to "Accounting / Configuration / Management / Asset Models" - Create an asset model **Issue:** Upon save, the following UserError is raised: "You cannot add or remove bills when the asset is already running or closed." **Cause:** A check has been added to prevent adding bills to a running asset. The check is excluding draft assets but not asset models that are assets in "model" state. **Issue:** Exclude asset models from the chec
Original PR description
**Steps to reproduce:** - Install Accounting - Go to "Accounting / Configuration / Management / Asset Models" - Create an asset model **Issue:** Upon save, the following UserError is raised: "You cannot add or remove bills when the asset is already running or closed." **Cause:** A check has been added to prevent adding bills to a running asset. The check is excluding draft assets but not asset models that are assets in "model" state. **Issue:** Exclude asset models from the check. opw-4479698 Forward-Port-Of: odoo/enterprise#77472