Tuesday, February 23, 2021
25 changes · master
New functionality added to Odoo
Odoo gains a new background job system so time-consuming actions can run outside the normal web request flow. This improves responsiveness for users during heavy exports, stock calculations, and other jobs, while providing status notifications and download links when results are ready.
Original PR description
## Why is it needed Odoo historically only supports two ways of processing tasks. Sporadic HTTP request and periodic CRON tasks. The former is the preferred way to exchange information with the web…
## Why is it needed Odoo historically only supports two ways of processing tasks. Sporadic HTTP request and periodic CRON tasks. The former is the preferred way to exchange information with the web application while the later is used to perform some regular background batch operations. Several models need to create sporadic background tasks assured to be processed as soon as possible. The current strategy of doing so is to save the task in some kind of queue later processed by a CRON. This strategy lacks reactivity due to low frequency of CRON calls. e.g. (e)mail or marketing "send/start now" button, payment transactions. Another strategy used by the stock app to compute the procurement is to start the processing in a new thread. Another problem comes when the user call and very resource-demanding endpoint via a HTTP request. HTTP requests are limited in time to prevent worker starvation (i.e. when no worker is available to process new requests), in some extreme circumstances legitimate requests are discarded because they timeout. In order to prevent starvation, it is necessary to process those very resource-demanding requests independently from the HTTP request. Extreme circumstances include among others huge import/export (several billion records). ## Asynchronous server tasks We introduce a new API to schedule and process asynchronous tasks with optional web notification. Tasks are classic model method call on record sets, the difference is that the call is not performed by the current worker but rather enqueued to be processes asap by a brand new "async" worker. Tasks are securely process in their own transaction meaning they are either completely executed or not executed at all. Tasks that are cancelled due to a server crash or a forced shutdown are left enqueued for the next run. Scheduling a task is done via the `env['ir.async'].call` method. The first argument is a Odoo model method bound to a record set, the later are positional and keyword arguments to perform the call with. People use to the python standard libraries `functools.partial`, `threading.Thread` and `multiprocessing.Process` functions will acknowledge a similar signature. ## User notification Using `call_notify` instead of `call` triggers web notifications. Notifications are send to the current user on task creation, processing and termination. A new systray menu has been added so the user can keep track of all those background tasks. Upon termination, the user is notified with the result (or an error if the task failed). The result is by example an `ir.actions` the user can execute by clicking the item in the systray. The result is kept up to three days server side. One can start an heavy export the Friday evening and gather the result the next Monday morning.
Enhancements to existing features
The point of sale Epson printer integration no longer relies on a bundled external ePOS library. Instead, it communicates directly with the printer web server, reducing dependency overhead while keeping receipt and restaurant printing workflows supported.
Original PR description
Remove minified ePOS library and replace it with direct calls to the web server of the printer. TaskID: 2417429 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
The mail app will no longer show messages for notifications that are intended for other parts of Odoo. This keeps the browser console cleaner and helps teams focus on relevant issues without changing user-facing behavior.
Original PR description
The `mail` module logs bus notifications it does not handle. However, some notifications are not meant to be handled by `mail` and it's perfectly fine. e.g. spreadsheet collaboration notifications https://github.com/odoo/enterprise/pull/16137 This commit removes the log to avoid useless noise in the console. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Steps: - Login as an admin user - On a fresh branch install event_crm - Give a "test" user access rights of "Own Document only" in the "Sales" app, nothing in "Events" - Assign any lead to "test" user - Login as "test" user and try to access your own leads Bug: Error: While parsing modifiers for button: for modifier "invisible": Unknown field registration_count in domain Explanation: The button `event_registration_action_from_lead` tries to access event registrations even if th
Original PR description
Steps: - Login as an admin user - On a fresh branch install event_crm - Give a "test" user access rights of "Own Document only" in the "Sales" app, nothing in "Events" - Assign any lead to "test" user - Login as "test" user and try to access your own leads Bug: Error: While parsing modifiers for button: for modifier "invisible": Unknown field registration_count in domain Explanation: The button `event_registration_action_from_lead` tries to access event registrations even if the user doesn't have access to events. opw:2462127 Forward-Port-Of: odoo/odoo#66425
Recruitment analysis can now be grouped by candidate stage, making it easier to compare pipeline progress across the hiring process. This helps teams understand where candidates are concentrated and identify stages that may need attention.
Original PR description
This will allow the user to group the values by stage in the recruitment analysis dashboard. Task-2455237
This update makes a small internal fix to how invoice extraction decides whether send or resend options should be shown. It improves code consistency and helps reduce the chance of issues in that invoice workflow, with no expected change to everyday user behavior.
Original PR description
…ulti Previously, this function was getting the record by argument. It is now an api.multi as it is cleaner.
Commit e5ab8cf missed a use case. Steps to reproduce: - Activiate "Packages" setting in Inventory - Configure an operation type to "Move Entire Packages" - Create a "Planned Transfer" picking with that operation type and add a package to be moved - Turn off "Move Entire Packages" and try set the destination package of the move line to nothing (False). Expected result: Move line has no destination package + package level is deleted as expected. Another bug will still exist
Original PR description
Commit e5ab8cf missed a use case. Steps to reproduce: - Activiate "Packages" setting in Inventory - Configure an operation type to "Move Entire Packages" - Create a "Planned Transfer" picking with…
Commit e5ab8cf missed a use case. Steps to reproduce: - Activiate "Packages" setting in Inventory - Configure an operation type to "Move Entire Packages" - Create a "Planned Transfer" picking with that operation type and add a package to be moved - Turn off "Move Entire Packages" and try set the destination package of the move line to nothing (False). Expected result: Move line has no destination package + package level is deleted as expected. Another bug will still exist due to the design of package_level where if in addition to the above use case, if a different package is used instead of deleting it and "Move Entire Packages" is reactived => final package shown in the Detailed Operations will show all move lines as being part of the same package even though they are not. Data appears to be correct in the database otherwise and a reasonable fix doesn't seem feasible for now so we leave this bug as is. Related to Task: 2418907 fixes: odoo/odoo#66542 fixes: odoo/odoo#66517 Forward-Port-Of: odoo/odoo#66556
Scenario: - go to /slides and start editing the page - change the position of background banner - save => traceback Why: The code for pan tool duplicates the target element in an overlay. In the given use case, it means a node with .o_editable class is created that will cause an error when saving because the code expect the cloned element to be an editor (in `RTEWidget.save()`) but it is not (and is eg. missing `.data('options')`). opw-2427560 Forward-Port-Of: odoo/odoo#66639
Original PR description
Scenario:
- go to /slides and start editing the page
- change the position of background banner
- save
=> traceback
Why:
The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).
opw-2427560
Forward-Port-Of: odoo/odoo#66639The executing function for FieldCommand should return boolean value to indicate whether the value changed for triggering the re-computation. Forward-Port-Of: odoo/odoo#66648
Original PR description
The executing function for FieldCommand should return boolean value to indicate whether the value changed for triggering the re-computation. Forward-Port-Of: odoo/odoo#66648
Instead of using weird ad-hoc mock-like things. Forward-Port-Of: odoo/odoo#66649 Forward-Port-Of: odoo/odoo#66437
Original PR description
Instead of using weird ad-hoc mock-like things. Forward-Port-Of: odoo/odoo#66649 Forward-Port-Of: odoo/odoo#66437
…order Description of the issue/feature this PR addresses: Solve backorder launch when it should not. Current behavior before PR: Do a transfer in two steps with several move lines (e.g.: Vendors => Input => Stock). In the first picking, set quantity = 0 on a single line. Transfer it and say 'No backorder'. In the second picking, set all quantities (you have two move lines confirmed and one canceled). Validate the transfer. The backorder wizard is launched. It should not. D
Original PR description
…order Description of the issue/feature this PR addresses: Solve backorder launch when it should not. Current behavior before PR: Do a transfer in two steps with several move lines (e.g.: Vendors =>…
…order Description of the issue/feature this PR addresses: Solve backorder launch when it should not. Current behavior before PR: Do a transfer in two steps with several move lines (e.g.: Vendors => Input => Stock). In the first picking, set quantity = 0 on a single line. Transfer it and say 'No backorder'. In the second picking, set all quantities (you have two move lines confirmed and one canceled). Validate the transfer. The backorder wizard is launched. It should not. Desired behavior after PR is merged: Do a transfer in two steps with several move lines (e.g.: Vendors => Input => Stock). In the first picking, set quantity = 0 on a single line. Transfer it and say 'No backorder'. In the second picking, set all quantities (you have two move lines confirmed and one canceled). Validate the transfer. The backorder wizard is not launched -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66272 Forward-Port-Of: odoo/odoo#66122
The `mail` module logs bus notifications it does not handle. However, some notifications are not meant to be handled by `mail` and it's perfectly fine. This commit removes the log to avoid useless noise in the console. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66661
Original PR description
The `mail` module logs bus notifications it does not handle. However, some notifications are not meant to be handled by `mail` and it's perfectly fine. This commit removes the log to avoid useless noise in the console. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66661
This commit unpins a livechat channel initiated by an admin when it's closed and no message has been sent task-id: 2276571 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66178
Original PR description
This commit unpins a livechat channel initiated by an admin when it's closed and no message has been sent task-id: 2276571 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66178
If a field is sanitized, a6e2b484e2 would hide the video button because the video does not show in backend. It is better for the consistency but if the field appear in frontend, the video would still show so we prevent something that worked (but is very not user friendly when editing in backend). This changeset go back to the previous behavior (keeping the code simplification), at one point there should be a fix so at least when editing we see the video (currently we see an empty div in given c
Original PR description
If a field is sanitized, a6e2b484e2 would hide the video button because the video does not show in backend. It is better for the consistency but if the field appear in frontend, the video would still show so we prevent something that worked (but is very not user friendly when editing in backend). This changeset go back to the previous behavior (keeping the code simplification), at one point there should be a fix so at least when editing we see the video (currently we see an empty div in given conditions). opw-2463746 Forward-Port-Of: odoo/odoo#66434
Issue - Install Inventory module - Go to Inventory -> Reporting -> Inventory Valuation - Click on "Inventory At Date" button - Select any date The datetime in breadcrumb is displayed in UTC. Solution Display datetime in current user timezone. opw-2464744 Forward-Port-Of: odoo/odoo#66533
Original PR description
Issue - Install Inventory module - Go to Inventory -> Reporting -> Inventory Valuation - Click on "Inventory At Date" button - Select any date The datetime in breadcrumb is displayed in UTC. Solution Display datetime in current user timezone. opw-2464744 Forward-Port-Of: odoo/odoo#66533
To reproduce: 1. Activate pos_hr feature. 2. Authorize an employee with pin. 3. Open a pos session and login with that employee. 4. [BUG] The popup to input pin is broken. This is because of the 'minus' button. In this commit, we make sure to hide the 'minus' button when the popup is used to ask for pin. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66688
Original PR description
To reproduce: 1. Activate pos_hr feature. 2. Authorize an employee with pin. 3. Open a pos session and login with that employee. 4. [BUG] The popup to input pin is broken. This is because of the 'minus' button. In this commit, we make sure to hide the 'minus' button when the popup is used to ask for pin. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#66688
Before this commit, the SOL in the helpdesk ticket is visible only if the use_helpdesk_sale_timesheet=True and the partner is defined and at least a timesheet is defined in this ticket. The last condition has been removed because we added it when the sale_line_id is not stored in this model but is no longer the case now. This commit removes this last condition since this condition is no longer usefull and now this field will be visible is the use_helpdesk_sale_timesheet=True and the p
Original PR description
Before this commit, the SOL in the helpdesk ticket is visible only if the use_helpdesk_sale_timesheet=True and the partner is defined and at least a timesheet is defined in this ticket. The last condition has been removed because we added it when the sale_line_id is not stored in this model but is no longer the case now. This commit removes this last condition since this condition is no longer usefull and now this field will be visible is the use_helpdesk_sale_timesheet=True and the partner is defined in the ticket. Forward-Port-Of: odoo/enterprise#16527
In the documents settings, you can select a workspace for the accounting. If you are in a multi-company, if a workspace is assigned to a company, it is not available in the list of workspace, even if you are in that company. opw:2452512 Forward-Port-Of: odoo/enterprise#16484
Original PR description
In the documents settings, you can select a workspace for the accounting. If you are in a multi-company, if a workspace is assigned to a company, it is not available in the list of workspace, even if you are in that company. opw:2452512 Forward-Port-Of: odoo/enterprise#16484
Forward-Port-Of: odoo/enterprise#16474
Original PR description
Forward-Port-Of: odoo/enterprise#16474
This commit adds the `id` field to the debug mode list view to facilitate debugging. Forward-Port-Of: odoo/enterprise#16483
Original PR description
This commit adds the `id` field to the debug mode list view to facilitate debugging. Forward-Port-Of: odoo/enterprise#16483
In some structured communications, we are expecting float values when parsing the communication (example: volume for transaction type fuel in communication 113). But this data is not always filled in, and we should not crash in that case but rather just set a default 0 value to allow the import of CODA statements. opw-2463827 Forward-Port-Of: odoo/enterprise#16519
Original PR description
In some structured communications, we are expecting float values when parsing the communication (example: volume for transaction type fuel in communication 113). But this data is not always filled in, and we should not crash in that case but rather just set a default 0 value to allow the import of CODA statements. opw-2463827 Forward-Port-Of: odoo/enterprise#16519
Forward-Port-Of: odoo/enterprise#16556
Original PR description
Forward-Port-Of: odoo/enterprise#16556
- While running the cron to update the status of an invoice on the OCR cron. We never commit, meaning we hold locks during the cron run time. This can be blocking for people working on invoices that are marked as locked and have to wait until the cron has finished running. Forward-Port-Of: odoo/enterprise#16572 Forward-Port-Of: odoo/enterprise#16509
Original PR description
- While running the cron to update the status of an invoice on the OCR cron. We never commit, meaning we hold locks during the cron run time. This can be blocking for people working on invoices that are marked as locked and have to wait until the cron has finished running. Forward-Port-Of: odoo/enterprise#16572 Forward-Port-Of: odoo/enterprise#16509
Neither server, no browser cannot handle unlimited number of lines at the same time. On server side it leads to series of heavy sql requests. On client side, browser will eat all the memory on trying to render all of those lines. This also prevents loading reconciled lines ids to browser. Size of the batches can be customized via System Parameter ``account.reconcile.batch`` Details: * ``action_bank_reconcile_bank_statements`` is used on clicking `[Reconcile]` button in ``account.ba
Original PR description
Neither server, no browser cannot handle unlimited number of lines at the same time. On server side it leads to series of heavy sql requests. On client side, browser will eat all the memory on trying to render all of those lines. This also prevents loading reconciled lines ids to browser. Size of the batches can be customized via System Parameter ``account.reconcile.batch`` Details: * ``action_bank_reconcile_bank_statements`` is used on clicking `[Reconcile]` button in ``account.bank.statement`` form * ``action_open_reconcile`` is used on clicking `[Reconcile]` for a journal in Account Dashboard --- PR to v13: https://github.com/odoo/odoo/pull/65789 opw-2424992 opw-2344807 Forward-Port-Of: odoo/enterprise#16491
Depending on the user's location, the date format that is chosen may return the wrong date. If you want to format a date as of January 1, 2021. The formatting returns "2020-01-01". To fix this bug, we have to replace "YYYY" by "yyyy". **See also:** https://github.com/python-babel/babel/issues/419 Forward-Port-Of: odoo/enterprise#16558
Original PR description
Depending on the user's location, the date format that is chosen may return the wrong date. If you want to format a date as of January 1, 2021. The formatting returns "2020-01-01". To fix this bug, we have to replace "YYYY" by "yyyy". **See also:** https://github.com/python-babel/babel/issues/419 Forward-Port-Of: odoo/enterprise#16558