Tuesday, October 10, 2023
60 changes · master
New functionality added to Odoo
Odoo now includes New Zealand English as a selectable language. This helps New Zealand users get locale settings that better match their region instead of relying on United States English defaults.
Original PR description
To avoid using the default en_US (which has different locale settings)
Enhancements to existing features
Removes outdated support code from the mail module's test helpers because the newer interface environment now covers that need. This is an internal cleanup that reduces maintenance overhead without changing day-to-day user behavior.
Original PR description
As the comment says: > This function must be removed when the WOWL env will be available in > the form_renderer. This code seems not needed anymore. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
This fixes an issue where pages with a search panel would automatically jump back to the top. Users now get consistent scrolling behavior whether or not a search panel is shown, making navigation less disruptive.
Original PR description
Before this commit, if a view contained a searchPanel the scrollbar went at the top automatically; now the behavior of the scrollbar in a view with or without a searchPanel is the same. task : 3503894 with help of @Arcasias --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Features or functions removed from Odoo
This change removes a little-used duplicate text escaping function and makes the standard escaping behavior more complete. It helps keep web and mail-related code simpler while maintaining safer handling of quotes in displayed values.
Original PR description
In https://github.com/odoo/odoo/commit/a6fea376bb2e75f2ca617811f41d83768c078f85, escapeHTML was introduced to replace the corresponding
underscore.js function. It is very similar to the widely used escape
function, except it additionally escapes single (') and double (")
quotes.
The additional escaping is not generally harmful, and is necessary to
safely inject values into attributes. As escapeHTML is almost unused,
remove it and update escape to include quotes.
taskId : 3522892Code cleanup and technical improvements
This change reorganizes the drag-and-drop building blocks so they no longer depend on one specific front-end framework. It makes the same behavior easier to use in more areas of Odoo, including places where that framework is not available, with little expected visible change for users.
Original PR description
This commit removes Owl hooks from the draggable hook builder file and introduces a new parameter attribute (`setupHooks`) to specify which functions must be used to set up, update and tear down the draggable hook. This has been done to allow the draggable hook builder function to be used in environments where Owl is not available. Enterprise: https://github.com/odoo/enterprise/pull/47693 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
## Issue Reading on the field `tasks_ids` of the `sale.order` model in some context can be slow, leading to really slow creation and duplication of tasks on a medium sized database. ## Analysis After creation of a task, when the ORM flushes the model, it recomputes all the inverse dependencies that needs to be recomputed. Currently `task_ids` doesn't implement a `search` routine on the field, so `task_ids` needs to be recomputed for *all* sales orders, since we don't know which sales order
Original PR description
## Issue Reading on the field `tasks_ids` of the `sale.order` model in some context can be slow, leading to really slow creation and duplication of tasks on a medium sized database. ## Analysis After…
## Issue
Reading on the field `tasks_ids` of the `sale.order` model in some context can be slow, leading to really slow creation and duplication of tasks on a medium sized database.
## Analysis
After creation of a task, when the ORM flushes the model, it recomputes all the inverse dependencies that needs to be recomputed.
Currently `task_ids` doesn't implement a `search` routine on the field, so `task_ids` needs to be recomputed for *all* sales orders, since we don't know which sales order needs computation. So for *all* sales orders, we trigger the compute `_compute_tasks_ids`, which is badly implemented using the general performance anti-pattern
```py
for record in records:
field = self.env['model'].search(domain)
```
which makes 1 query per record that we are computing.
## Solution
Correct the implementation of `_compute_tasks_ids`, which now uses a `_read_group` instead so we do 1 query for the whole recordset. And implement the `search` on the non-stored `tasks_ids` field, which speeds up the context of re-computations. This allows the ORM to know for which sales order the field `task_ids` needs re-computation.
## Results
In the context a mid-size database (less than 10k records for the concerned models)
Task creation/duplication:
| | Before | After |
|-------------|--------|-------|
| Time | 1 min | 1 sec |
| Query count | 40k | 300 |
## Reference
opw-3445565
Forward-Port-Of: odoo/odoo#137542
Forward-Port-Of: odoo/odoo#136255Automatic transfer entries are now created only when there are actual lines for the selected period. This prevents empty accounting entries from being generated, reducing cleanup work and keeping records clearer.
Original PR description
before this commit, if there is no lines in the period the move is created with empty lines after this commit, move is created only when the lines exists in the period.
This update removes unused styling rules from the Accounting reports interface to reduce the size of the generated CSS. The change should help pages load a bit more efficiently without changing visible functionality for users.
Original PR description
`@extend` should be used with care : they are a powerful tool, but can lead to nasty overgeneration of SCSS selectors. Also these rules doesn't look to be used anyway 🤷 Example (uncompressed): - fresh database with only account_accountant (and its dependencies) installed: CSS bundle goes from 1923KB to 1702KB (gain 221KB) - runbot all: CSS bundle goes from 2664KB to 2388KB (gain 276KB) task-3546717
An unused field was removed from the Planning analysis report model after it was no longer shown or used in the interface. This keeps the reporting code cleaner without changing what users see or how they work.
Original PR description
Field overlap_slot_count of model planning.analysis.report was previously removed from the view where it was used by https://github.com/odoo/enterprise/pull/42117. The field has now no more use and should be removed from the model.
Duplicated appraisal plans now automatically include "(copy)" at the end of their name. This makes it easier for users to tell original plans apart from copies and manage appraisal planning without confusion.
Original PR description
This commit introduces a feature that automatically appends "(copy)" to the end of the plan name whenever it is duplicated. This change enhances clarity and separates the original plan from its duplicates, simplifying management and tracking. task:3544642
This update adjusts several Odoo Enterprise screens so they no longer rely on outdated context fields. It helps keep these modules compatible with platform changes and reduces the risk of future view-related issues.
Original PR description
This commit is the counterpart of https://github.com/odoo/odoo/pull/136665 where keys active_id, active_ids and active_model have been deprecated from the evaluation context. This commit thus adapts archs to stop using them.
This update adjusts how mentions are styled in Mail so they no longer unintentionally alter button styling elsewhere on the website. It also slightly improves mention readability by refining text and background contrast in light and dark themes.
Original PR description
Follow-up of https://github.com/odoo/odoo/pull/132701 `@extend` was used to reuse classnames intended for styling, such as `.btn`. However, this has the side-effect to increase specificity on these…
Follow-up of https://github.com/odoo/odoo/pull/132701 `@extend` was used to reuse classnames intended for styling, such as `.btn`. However, this has the side-effect to increase specificity on these classnames, which results in breaking style on the website where the specificity on `.btn` must not change. This commit fixes the issue by using a mixin rather than `@extend`. Since using these mixins are not equivalent, we took the opportunity to slightly improve the constrast of text color and background. Before/After (white)   Before/After (dark)  
This fixes a duplicated barcode test that was causing some nightly validation builds to fail. The change helps keep automated checks stable so releases and module updates are not delayed by a false test issue.
Original PR description
Task: 3290154 The nightly was failing during some single module build (website_sale, account, ...) https://runbot.odoo.com/web#id=25090&view_type=form&model=runbot.build.error&menu_id=405&cids=1 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The restaurant appointment floor screen now shows appointment names consistently, regardless of whether the appointment was created online or in the back office. This avoids confusing or incorrect labels for staff managing restaurant bookings.
Original PR description
Previously, an operation was done to retrieve the appointment name. This operation was needed because when the appointment was created in the front end, a prefix was added to it. The issue is that this prefix was not added when the appointment was created in the back end. The solution to remove the prefix from the appointment name will be done by the team that is responsible of the Event module.
This update removes an outdated internal bridge that was only still routing a small set of legacy service calls. It simplifies the web foundation and related modules without introducing expected changes for end users.
Original PR description
This service was used to redirect legacy service requests to the wowl service infrastructure. It has been incrementally simplified with the codebase getting converted. It now only allows to redirect calls to the effect service, which doesn't seem useful anymore. This commit thus removes it. Part of task~3439226 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
This change simplifies how Odoo loads assets used in website and mass mailing preview features. It supports ongoing cleanup of the asset system while preserving the mobile preview experience for users.
Original PR description
In this commit, we remove three usages of the getBundle function from @web/core/assets.js. The final goal is to remove it totally to simplify the understanding of assets's API. To replace the use of getBundle in mobile preview dialog, an xml template has been created on the server side and then called by http requests. During the request, we retrieve the list of assets (server side getbundle) to inject these into the xml template. taskId : 3266441
This change removes leftover styling for a date picker library that is no longer used. It keeps the codebase cleaner and reduces the chance of obsolete frontend customizations affecting future maintenance.
Original PR description
The tempusdominus library has been removed by [1]. This commit removes scss customizations of the library that have been forgotten. [1] 910897fc97d87b08f01627094ec8c159f5267628 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
This change removes dark mode styling that was only needed for an old date picker library. Since that library is no longer used, removing the extra styling keeps the web interface code cleaner without changing business workflows.
Original PR description
The tempusdominus library has been removed by [1]. This commit removes the dark mode override for the tempusdominus picker. [1] odoo/odoo@910897fc97d87b08f01627094ec8c159f5267628
The Gantt view’s drag-and-drop helper has been reorganized so it no longer depends directly on a specific interface framework. This keeps the scheduling experience unchanged for users while making the feature easier to maintain and align with related platform updates.
Original PR description
This commit is the follow-up of its community counterpart with the same name. It adds the Owl setup hooks as default hooks of the Gantt draggable helper hooks. Community: https://github.com/odoo/odoo/pull/136116
An unused background service related to opening the home menu has been removed because the older code path that depended on it no longer exists. This simplifies the enterprise web client internals with no expected change for end users.
Original PR description
This service is no longer useful as there's no legacy code triggering events to open the home menu anymore. Part of task~3439226
This update reworks internal drag-and-drop behavior so it can be reused in more parts of the system, including areas that do not rely on the same interface framework. It helps keep web tools such as the home menu, Gantt views, and Studio editing more flexible and easier to maintain without changing core business workflows.
This SIRET is valid according to `stdnum` but does not correspond to any existing company. Forward-Port-Of: odoo/odoo#137971
Original PR description
This SIRET is valid according to `stdnum` but does not correspond to any existing company. Forward-Port-Of: odoo/odoo#137971
CLA signature update for trungtuan88 Forward-Port-Of: odoo/odoo#137951
Original PR description
CLA signature update for trungtuan88 Forward-Port-Of: odoo/odoo#137951
CLA signature update for PallaviSrivastavaa Forward-Port-Of: odoo/odoo#137959
Original PR description
CLA signature update for PallaviSrivastavaa Forward-Port-Of: odoo/odoo#137959
This traceback arises when the user changes the `end_date` without the `employee` value, while creating a new `Work Entry`. To reproduce this issue: 1) Install `hr_work_entry_contract` 2) Open `payroll` and create a new `Work Entry` 3) Select `Work Entry Type` as `Unpaid` and change the `To` date Error:- ``` KeyError: False File "odoo/http.py", line 2134, in __call__ response = request._serve_db() File "odoo/http.py", line 1710, in _serve_db return service_model
Original PR description
This traceback arises when the user changes the `end_date` without the `employee` value, while creating a new `Work Entry`. To reproduce this issue: 1) Install `hr_work_entry_contract` 2) Open…
This traceback arises when the user changes the `end_date` without the `employee` value,
while creating a new `Work Entry`.
To reproduce this issue:
1) Install `hr_work_entry_contract`
2) Open `payroll` and create a new `Work Entry`
3) Select `Work Entry Type` as `Unpaid` and change the `To` date
Error:-
```
KeyError: False
File "odoo/http.py", line 2134, in __call__
response = request._serve_db()
File "odoo/http.py", line 1710, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1737, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1938, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 191, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 717, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 30, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "odoo/models.py", line 6781, in onchange
todo = [
File "odoo/models.py", line 6784, in <listcomp>
if name not in done and snapshot0.has_changed(name)
File "odoo/models.py", line 6584, in has_changed
return self[name] != record[name]
File "odoo/models.py", line 6211, in __getitem__
return self._fields[key].__get__(self, type(self))
File "odoo/fields.py", line 1157, in __get__
self.recompute(record)
File "odoo/fields.py", line 1367, in recompute
apply_except_missing(self.compute_value, recs)
File "odoo/fields.py", line 1340, in apply_except_missing
func(records)
File "odoo/fields.py", line 1389, in compute_value
records._compute_field_value(self)
File "odoo/models.py", line 4553, in _compute_field_value
fields.determine(field.compute, self)
File "odoo/fields.py", line 101, in determine
return needle(*args)
File "addons/hr_work_entry/models/hr_work_entry.py", line 84, in _compute_duration
durations = self._get_duration_batch()
File "home/odoo/src/enterprise/saas-16.4/hr_work_entry_contract_planning/models/hr_work_entry.py", line 46, in _get_duration_batch
res.update(super(HrWorkEntry, super_we)._get_duration_batch())
File "addons/hr_work_entry_contract/models/hr_work_entry.py", line 119, in _get_duration_batch
result[work_entry.id] = mapped_contract_data[(date_start, date_stop)][calendar][employee.id]['hours']
```
On the `_get_duration_batch` method when the user is not given employee value,
there will be no `contract_id` as it is getting value from `employee_id`.
It leads to the above traceback as `result[work_entry.id]` is getting value through `employee.id`.
See:- https://github.com/odoo/odoo/blob/a277faa2ffab7559fcbad95fcc1e8fd6a26d756b/addons/hr_work_entry_contract/models/hr_work_entry.py#L110-L112
Will resolve this issue by calculating duration without employee
sentry-4514970596
Forward-Port-Of: odoo/odoo#137699This commit removes the organizer's name in the mail template when booking an appointment scheduled based on resources. Task-3458881 Forward-Port-Of: odoo/odoo#133288
Original PR description
This commit removes the organizer's name in the mail template when booking an appointment scheduled based on resources. Task-3458881 Forward-Port-Of: odoo/odoo#133288
Install auth_oauth and via the /web/login, click the "Log in using Odoo.com" button. You are redirected on odoo.com which ask you for your odoo.com login and password. When the login form on odoo.com is submited, you are redirected back on your local database. The problem is that, in case a new account was created on-the-fly, then the login fails with a cryptic error. The actual error is that `request.env.user._is_internal` fails because `user` is an empty recordset where it should had been t
Original PR description
Install auth_oauth and via the /web/login, click the "Log in using Odoo.com" button. You are redirected on odoo.com which ask you for your odoo.com login and password. When the login form on odoo.com…
Install auth_oauth and via the /web/login, click the "Log in using Odoo.com" button. You are redirected on odoo.com which ask you for your odoo.com login and password. When the login form on odoo.com is submited, you are redirected back on your local database. The problem is that, in case a new account was created on-the-fly, then the login fails with a cryptic error. The actual error is that `request.env.user._is_internal` fails because `user` is an empty recordset where it should had been the just-authenticated user. The problem is an inconsistent transaction state between the cursor of the request, the cursor used with `auth_oauth` (which created a new user) and the cursor used with `authenticate` (which authenticated the new user). Yes, there are 3 cursors. The newly created user just isn't present in the transaction of the request's cursor. Here is the lifetime of the 3 cursors: * request.env.cr, it begins when the http request enters Odoo, it is commited when a http response exits Odoo. * /auth_oauth/signin, it begins roughly at the beginning of the controller, it is commited once after the user is created (so before the authenticate transaction begins but AFTER the request transaction begun), it is commited again when the controller exits. * authenticate, begins when authenticate is called, is commited when it returns. Because the request transaction started before, it cannot access user created by /auth_oauth/signin. Because the route is `auth='none'`, if system administrators append the `auth_oauth` module via `--load` (cli) or `server_wide_modules` (odoorc) then the controller can be accessed without database. This is the reason for the explicit registry/cursor/environment inside this controller, we needed to make sure we are connected to a database, we cannot rely on request. The new approach used in this work is to benefit from `ensure_db()`, the function that is used by various web `auth='none'` controllers such as /web and /web/login. It makes sure that the database we want to connect to is already present on the request, otherwise it repeats the request but this time connecting it to the database. Using this approach we can have a `auth='none'` controller whose request.env is guaranteed to be connected on the right database. We can avoid to create explicit new registry/cursor/environment within the controller and just use request's ones. Because the /auth_oauth/signin controller now simply use the request transaction, the above point: > Because the request transaction started before, it cannot access user > created by /auth_oauth/signin. just doesn't stand anymore as the user is created within the same transaction. The extra `cr.commit()` must still be present for `authenticate` to see the newly created user. opw-3421701 Forward-Port-Of: odoo/odoo#137579
**Steps:** - Open Helpdesk - Enable the 'forum' feature on a helpdesk team - Open the help webpage - Search for something - Traceback appears **Issue:** - When we search for something, we get a traceback instead of search results. **Cause:** - In the template, we do not get the value of create_uid.id as we are trying to compute it from post_id. **Fix:** - Instead of computing the value from post_id, we need to compute it from post hence we will obtain the values by writing post.
Original PR description
**Steps:** - Open Helpdesk - Enable the 'forum' feature on a helpdesk team - Open the help webpage - Search for something - Traceback appears **Issue:** - When we search for something, we get a traceback instead of search results. **Cause:** - In the template, we do not get the value of create_uid.id as we are trying to compute it from post_id. **Fix:** - Instead of computing the value from post_id, we need to compute it from post hence we will obtain the values by writing post.create_uid.id **Task:** 3461563 Forward-Port-Of: odoo/odoo#132821
When we have all `crm.stage` records set to "fold in pipeline", the compute method for stage_id returns None. This means that when we create a lead in the form view and the stage is unset, we get a TypeError traceback as we are trying to access a property of null. This commit aims to fix this behavior so that it reflects the behavior of the kanban view. If the stage is not set, the lead will be created in the "None" stage. opw-3512966 Forward-Port-Of: odoo/odoo#137389 Forward-Port-Of: odo
Original PR description
When we have all `crm.stage` records set to "fold in pipeline", the compute method for stage_id returns None. This means that when we create a lead in the form view and the stage is unset, we get a TypeError traceback as we are trying to access a property of null. This commit aims to fix this behavior so that it reflects the behavior of the kanban view. If the stage is not set, the lead will be created in the "None" stage. opw-3512966 Forward-Port-Of: odoo/odoo#137389 Forward-Port-Of: odoo/odoo#136800
The commit https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa introduced a way to update the useragent used to request openstreetmap nominatim service. It was introduced as a bad fix to prevent an erroneous blacklist from the service. Once the blacklist has been removed, this fix was not necessary anymore. It also allows to abuse the free service which is against the osmfoundation policy. The best solution would be to decrease the amount of request. The Google Place
Original PR description
The commit https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa introduced a way to update the useragent used to request openstreetmap nominatim service. It was introduced as a bad fix to prevent an erroneous blacklist from the service. Once the blacklist has been removed, this fix was not necessary anymore. It also allows to abuse the free service which is against the osmfoundation policy. The best solution would be to decrease the amount of request. The Google Place Map service is also available to avoid using the openstreetmap service with large database. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#137886
Step to reproduce: - Install `Elearning` module - Go to any course and a content as document - Upload a PDF with more than 1 page - Go to the website and click on the course then on the content with the document - Go to last page and click on next button (should display suggested slides page) - Click on previous button Issue: Page displayed is not the last one, but the one before. Cause: When clicking on the previous button, the current page is still the la
Original PR description
Step to reproduce: - Install `Elearning` module - Go to any course and a content as document - Upload a PDF with more than 1 page - Go to the website and click on the course then on the content with the document - Go to last page and click on next button (should display suggested slides page) - Click on previous button Issue: Page displayed is not the last one, but the one before. Cause: When clicking on the previous button, the current page is still the last page (just with the suggested slides page on top of it as overlay), and therefore will decrease it to the page number before last page (nb last page - 1). Solution: When clicking on previous button, if we are on the suggested slides page (by checking if overlay is not hidden since no attribute is set on `EmbeddedViewer` to know if we are on that page), hide it. opw-3482712 Forward-Port-Of: odoo/odoo#135326
- Step: - Install project app - Activated Task Dependencies - Create project and task - Add sub-task - Click sub-task action - Issue: In the commit below we have passed the default_project reference so we get the current project stage. Fix: we pass 'subtask_action' context to subtask action and we checked that context in _read_group_stage_ids method if subtask_action context is found then we will not fetch project's stages. Side effect of this commit-https:/
Original PR description
- Step: - Install project app - Activated Task Dependencies - Create project and task - Add sub-task - Click sub-task action - Issue: In the commit below we have passed the default_project reference so we get the current project stage. Fix: we pass 'subtask_action' context to subtask action and we checked that context in _read_group_stage_ids method if subtask_action context is found then we will not fetch project's stages. Side effect of this commit-https://github.com/odoo/odoo/commit/23cf9318084c8a00f37ffcefefa3e056583d2d77 task-3390279 Forward-Port-Of: odoo/odoo#137977 Forward-Port-Of: odoo/odoo#129046
Description of the issue/feature this commit addresses: When opening a view with the quick filters available with a domain which returns no data, a message shows up saying that no filter is available for the data that has been retrieved and tells the user that updating the filters will allow him to display more records and maybe make the quick filter available. This message is displayed in a way which is not so great for user experience as it is written in a very thin column making the text b
Original PR description
Description of the issue/feature this commit addresses: When opening a view with the quick filters available with a domain which returns no data, a message shows up saying that no filter is available…
Description of the issue/feature this commit addresses: When opening a view with the quick filters available with a domain which returns no data, a message shows up saying that no filter is available for the data that has been retrieved and tells the user that updating the filters will allow him to display more records and maybe make the quick filter available. This message is displayed in a way which is not so great for user experience as it is written in a very thin column making the text being written one word per line. The example used to point out that problem is using the mexican localization, going in the accounting app, in the tax report and clicking on any value equals to zero. Desired behavior after the commit is merged : This commit replaces that message with a "All" button like it would be if the domain had returned data and some filters were available. Only this time, no filter is available under the button as there is still no data to filter. Adding this fix, there is no messy message showing up in the quick filters column when the query was not able to retrieve any data with the given domain. task-3462024 Enterprise PR : https://github.com/odoo/enterprise/pull/46422 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#133358
Before this commit, diagnosing websocket handshake error was cumbersome since the only information available was the return code of the initial HTTP request (400). The HTTP stack does not log `werkzeug.exceptions.HTTPException` and derivated classes. This commit adds a log in order to provide more insight about what went wrong. Forward-Port-Of: odoo/odoo#137972
Original PR description
Before this commit, diagnosing websocket handshake error was cumbersome since the only information available was the return code of the initial HTTP request (400). The HTTP stack does not log `werkzeug.exceptions.HTTPException` and derivated classes. This commit adds a log in order to provide more insight about what went wrong. Forward-Port-Of: odoo/odoo#137972
Avoid line breaks in monetary amounts. Steps to reproduce: * Either set the language to Swedish or enter dev mode and set the thousands separator to a space * Refresh the client * Create a purchase order * Create an order line, with taxes (important) for a total amount over a thousand * The total amount will now be broken up into two lines opw-3482329 Forward-Port-Of: odoo/odoo#136643
Original PR description
Avoid line breaks in monetary amounts. Steps to reproduce: * Either set the language to Swedish or enter dev mode and set the thousands separator to a space * Refresh the client * Create a purchase order * Create an order line, with taxes (important) for a total amount over a thousand * The total amount will now be broken up into two lines opw-3482329 Forward-Port-Of: odoo/odoo#136643
Before this commit: On applying background or on remove background color, strange padding is added on the text. After this commit: Now, padding is not added when background is colored is applied or background color is removed. task-3237693 Forward-Port-Of: odoo/odoo#138080 Forward-Port-Of: odoo/odoo#124394
Original PR description
Before this commit: On applying background or on remove background color, strange padding is added on the text. After this commit: Now, padding is not added when background is colored is applied or background color is removed. task-3237693 Forward-Port-Of: odoo/odoo#138080 Forward-Port-Of: odoo/odoo#124394
Current behavior: If you delete the default tip product, then activate tips in the PoS config you will be blocked by a warning message saying that the tip product is not set even if you set it. To fix this we only check if the tip product exist if the tips are activated. Steps to reproduce: -Delete Tip Product -Open PoS config -Activate tips -Try to save, you will be blocked by a warning message -If you try to turn off the tips, you will be blocked by the same warning
Original PR description
Current behavior: If you delete the default tip product, then activate tips in the PoS config you will be blocked by a warning message saying that the tip product is not set even if you set it. To fix this we only check if the tip product exist if the tips are activated. Steps to reproduce: -Delete Tip Product -Open PoS config -Activate tips -Try to save, you will be blocked by a warning message -If you try to turn off the tips, you will be blocked by the same warning message opw-3519123 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#137554
With this [commit](https://github.com/odoo/odoo/commit/adb8ec875c9b4e299147c46dc60a87fd26fff91f), we created a new 'Analytic Reporting' menuitem. But no `search_view_id` was specified, so it was falling back on the one from `hr_timesheet` (when installed), which we don't want. This commit fixes that by forcing the use of the one defined in `analytic`. task-3463639 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#135338
Original PR description
With this [commit](https://github.com/odoo/odoo/commit/adb8ec875c9b4e299147c46dc60a87fd26fff91f), we created a new 'Analytic Reporting' menuitem. But no `search_view_id` was specified, so it was falling back on the one from `hr_timesheet` (when installed), which we don't want. This commit fixes that by forcing the use of the one defined in `analytic`. task-3463639 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#135338
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 Forward-Port-Of: odoo/odoo#138068
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 Forward-Port-Of: odoo/odoo#138068
#### [REV] core: remove ORM `display_name` fallback This reverts commit 4573ca0c83eb63785016f4389a5157efb21fa9a4. Because now, `display_name` is implicitly on every form (last breadcrumb item). Then it will be queried by `onchange` calls. When we create a new record, `_rec_name` can be `False` and the display_name will be a technical one: '<model_name>,<NewId0x...>' which is uglier than the previous situation showing 'New'. #### [FIX] web: take in account `false` as a valid `display_n
Original PR description
#### [REV] core: remove ORM `display_name` fallback This reverts commit 4573ca0c83eb63785016f4389a5157efb21fa9a4. Because now, `display_name` is implicitly on every form (last breadcrumb item). Then…
#### [REV] core: remove ORM `display_name` fallback
This reverts commit 4573ca0c83eb63785016f4389a5157efb21fa9a4.
Because now, `display_name` is implicitly on every form (last breadcrumb item). Then it will be queried by `onchange` calls. When we create a new record, `_rec_name` can be `False` and the display_name will be a technical one:
'<model_name>,<NewId0x...>' which is uglier than the previous situation showing 'New'.
#### [FIX] web: take in account `false` as a valid `display_name`
The previous commit reverts the ORM fallback of `display_name`. Then the `display_name` can legitimately be `False` again. But the `Many2one` and `Many2XAutocomplete` components don't handle this case (and generate a traceback see task-3424154).
This commit adds the same fallback ('Unnamed record') for these two problematic components; one when the name_search returns `False` as `display_name` (autocomplete for Many2Xfields) and another when we read the many2one `display_name`. This name is not user friendly, but for the business model it shouldn't happen anyway. It is also better than the empty string which is confusing with no value. Note that there is already a fallback for `display_name` that is used in the broadcrumb
(https://github.com/odoo/odoo/blob/50b2a24f22cb470bcc1a9befe677cf794211d7b2/addons/web/static/src/views/form/form_controller.js#L282).
#### [FIX] web: display_name "New" fallback should only target new record.
There is a fallback in the control panel
(https://github.com/odoo/odoo/blob/c22cb6bbadd38ecb050f6d4dc14672868beda20b/addons/web/static/src/search/control_panel/control_panel.xml#L137)
if the display_name of the record is empty.
But it is never actually used because there is another
fallback in the form_controller ("New"). This latter fallback
should only be used for new records, not for existing ones.
## Alternative fix
The other way is to have a nice fallback in the `_compute_display_name`
(ORM side, see https://github.com/odoo/odoo/pull/133923). Unfortunately,
the performance cost is not small (each `display_name` should be
context-dependent and may generate extra queries to be computed) and the
model name (`_description`) is not meant to be user friendly. Instead,
a simpler solution is to have fallbacks on the JS side for each case.
Forward-Port-Of: odoo/odoo#137098similar to https://github.com/odoo/odoo/pull/87440 Forward-Port-Of: odoo/odoo#137960
Original PR description
similar to https://github.com/odoo/odoo/pull/87440 Forward-Port-Of: odoo/odoo#137960
Issue: ====== We have a delivery order created by a sale order by another user. A user with administrator access to inventory and sale : own documents only ,can't deliver products of that sale order without backorder , it shows access error. Steps to reproduce the error: ============================= - Create another user with admin access for inventory and own documents for sale. - Create a sale order with the current user. - Change now for the inventory admin and deliver some of the
Original PR description
Issue: ====== We have a delivery order created by a sale order by another user. A user with administrator access to inventory and sale : own documents only ,can't deliver products of that sale order without backorder , it shows access error. Steps to reproduce the error: ============================= - Create another user with admin access for inventory and own documents for sale. - Create a sale order with the current user. - Change now for the inventory admin and deliver some of the products and click on no-backorder. - Access error will show. Origin of the issue: ==================== The admin user should be able to deliver the products but when creating no backorder he needs to write on the sale_order. Solution: ========= Added `sudo` to the function that logs in the sale_order. opw-3380566 Forward-Port-Of: odoo/odoo#135872
Before this commit: In the `mailings` when we enable the A/B testing and click on the "Create an Alternative" button, the "Send final on" field doesn't copy to the new mailing. Reason: The related field are copy `false` by default. After this Commit: Now it will copy the "Send final on" into a new mailing Task: 3465887 Forward-Port-Of: odoo/odoo#137999 Forward-Port-Of: odoo/odoo#136406
Original PR description
Before this commit: In the `mailings` when we enable the A/B testing and click on the "Create an Alternative" button, the "Send final on" field doesn't copy to the new mailing. Reason: The related field are copy `false` by default. After this Commit: Now it will copy the "Send final on" into a new mailing Task: 3465887 Forward-Port-Of: odoo/odoo#137999 Forward-Port-Of: odoo/odoo#136406
__Current behavior before commit:__ When changing the `display_type` of an attribute in the website editor, the page is reloaded. However the template `website_sale.product` is contained in a `t-cache` on "pricelist,product". This means that the template will not be rendered again when the page is reloaded. Thus, the change will not appear for the user. __Description of the fix:__ Flush the cache from the `ir.qweb` model when the attribute display type is edited. This way the template `webs
Original PR description
__Current behavior before commit:__ When changing the `display_type` of an attribute in the website editor, the page is reloaded. However the template `website_sale.product` is contained in a `t-cache` on "pricelist,product". This means that the template will not be rendered again when the page is reloaded. Thus, the change will not appear for the user. __Description of the fix:__ Flush the cache from the `ir.qweb` model when the attribute display type is edited. This way the template `website_sale.product` will be refreshed. __Steps to reproduce the issue on runbot:__ - Go on the website product page of *Customizable Desk* - Open the website editor - Click on the Legs attribute values - Under the **Block** section, change the **Display Type** The page is reloaded but the display type stays the same ([Video][1]) opw-3495159 opw-3493820 [1]: https://drive.google.com/file/d/142VP4prnHskfa7uFoEkadsoQfQVO-uyW/view Forward-Port-Of: odoo/odoo#135349
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#138075
Original PR description
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#138075
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#137874 Forward-Port-Of: odoo/odoo#137603
Original PR description
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#137874 Forward-Port-Of: odoo/odoo#137603
**Description of the issue/feature this PR addresses:** It may happen that there is no company in env. Then the SQL query in `_get_multi` fails. It can happen for e.g. when running tests at install. **Current behavior before PR:** SQL query fails when `self.env.company.id == False` ``` 2023-10-06 12:59:24,382 767 ERROR odoo odoo.sql_db: bad query: SELECT substr(p.res_id, 13)::integer, r.id FROM ir_property p LEFT JOIN stock_locatio
Original PR description
**Description of the issue/feature this PR addresses:** It may happen that there is no company in env. Then the SQL query in `_get_multi` fails. It can happen for e.g. when running tests at install.…
**Description of the issue/feature this PR addresses:**
It may happen that there is no company in env. Then the SQL query in `_get_multi` fails. It can happen for e.g. when running tests at install.
**Current behavior before PR:**
SQL query fails when `self.env.company.id == False`
```
2023-10-06 12:59:24,382 767 ERROR odoo odoo.sql_db: bad query:
SELECT substr(p.res_id, 13)::integer, r.id
FROM ir_property p
LEFT JOIN stock_location r ON substr(p.value_reference, 16)::integer=r.id
WHERE p.fields_id=5862
AND (p.company_id=false OR p.company_id IS NULL)
AND (p.res_id IN ('res.partner,48') OR p.res_id IS NULL)
ORDER BY p.company_id NULLS FIRST
ERROR: operator does not exist: integer = boolean
LINE 6: AND (p.company_id=false OR p.company_id ...
```
**Desired behavior after PR is merged:**
Success of this SQL query.
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#137997Current behavior: When you link a printer to the sales detail report. The report will contains no order. This happens because we are trying to assign docids to the session_id. Steps to reproduce: - Install pos_iot - Link a printer from the demo iot to the sales_detail report (go in settings > reporting > reports) - Do some orders on the PoS, and close it - Go in the backend, and print the sales detail report - You will see that the report is empty (You can put a breakpoint in `get_sale_
Original PR description
Current behavior: When you link a printer to the sales detail report. The report will contains no order. This happens because we are trying to assign docids to the session_id. Steps to reproduce: - Install pos_iot - Link a printer from the demo iot to the sales_detail report (go in settings > reporting > reports) - Do some orders on the PoS, and close it - Go in the backend, and print the sales detail report - You will see that the report is empty (You can put a breakpoint in `get_sale_details` method to see that it will be empty) opw-3247196 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#138100 Forward-Port-Of: odoo/odoo#137446
### Steps - Create a new event. - Choose any template (training, conference,...). - Create new registration ticket for this event. - Create a new quotation. - Add 2 lines for "Event registration" product, and select each time the event and ticket created above. - Click on "Confirm". ### Issue 4 registrations lines are created and 3 attendees. ### Reason In ``RegistrationEditor.default_get()``, we match each sale order line with existing registrations in the sale order having the sa
Original PR description
### Steps - Create a new event. - Choose any template (training, conference,...). - Create new registration ticket for this event. - Create a new quotation. - Add 2 lines for "Event registration" product, and select each time the event and ticket created above. - Click on "Confirm". ### Issue 4 registrations lines are created and 3 attendees. ### Reason In ``RegistrationEditor.default_get()``, we match each sale order line with existing registrations in the sale order having the same ``event_ticket_id`` without assuming we can have multiple sale order lines with the same ``event_ticket_id``. That leads to [number_of_sol] * [number_of_ticket] registrations. To solve it, we just add an additional check for the ``sale_order_line_id`` to have a perfect match. opw-3495415 Forward-Port-Of: odoo/odoo#138111 Forward-Port-Of: odoo/odoo#138028
Before this commit, when using a loyalty reward with points, it is possible to give partial rewards. This commit prevents partial rewards. Example: - Rule: Grant 1 point per product bought; - Reward: 1.5$ per point in exchange of 2 points (3$) Before this commit, if you buy 3 products, you get 4.5$ by using 3 points. After, you only use 2 points and get 3$ (no partial reward). task-3300880 Forward-Port-Of: odoo/odoo#136982
Original PR description
Before this commit, when using a loyalty reward with points, it is possible to give partial rewards. This commit prevents partial rewards. Example: - Rule: Grant 1 point per product bought; - Reward: 1.5$ per point in exchange of 2 points (3$) Before this commit, if you buy 3 products, you get 4.5$ by using 3 points. After, you only use 2 points and get 3$ (no partial reward). task-3300880 Forward-Port-Of: odoo/odoo#136982
Ticket Adhoc: 65383 Task Latam: 1099 Description of the issue/feature this PR addresses: It is necessary in the account report invoice to show invoices grouped by partner_shipping_id. But if the invoice doesn´t have partner_shipping_id it is necessary to group by partner_id. Current behavior before PR: Account report invoice show invoices grouped by partner_shipping_id. Desired behavior after PR is merged: Account report invoice to show invoices grouped by partner_shipping_id but if
Original PR description
Ticket Adhoc: 65383 Task Latam: 1099 Description of the issue/feature this PR addresses: It is necessary in the account report invoice to show invoices grouped by partner_shipping_id. But if the invoice doesn´t have partner_shipping_id it is necessary to group by partner_id. Current behavior before PR: Account report invoice show invoices grouped by partner_shipping_id. Desired behavior after PR is merged: Account report invoice to show invoices grouped by partner_shipping_id but if the invoice doesn´t have partner_shipping_id it is necessary to group by partner_id. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#135931
This commit https://github.com/odoo/enterprise/pull/47021 removed the `updateOption` and `saveSessionOptions` part when it shouldn't. Forward-Port-Of: odoo/enterprise#48696
Original PR description
This commit https://github.com/odoo/enterprise/pull/47021 removed the `updateOption` and `saveSessionOptions` part when it shouldn't. Forward-Port-Of: odoo/enterprise#48696
The `XSD_INFO` was incorrect and not referrenced correctly, causing the validation to be skipped. Forward-Port-Of: odoo/enterprise#48604
Original PR description
The `XSD_INFO` was incorrect and not referrenced correctly, causing the validation to be skipped. Forward-Port-Of: odoo/enterprise#48604
This PR contains two commits each of which fixes a different unwanted behavior. --- 1. The account_reports module's commit fixes a bug happening in the reports. When unfolding a report which contains lines which have children but are not foldable, the unfolding process would not unfold those lines as they are not unfoldable and it would result in the report missing all the subsections and lines under that one. This is fixed by modifying the unfolding process of such lines. M
Original PR description
This PR contains two commits each of which fixes a different unwanted behavior. --- 1. The account_reports module's commit fixes a bug happening in the reports. When unfolding a report which contains…
This PR contains two commits each of which fixes a different unwanted behavior.
---
1. The account_reports module's commit fixes a bug happening in the reports. When unfolding a report which contains lines which have children but are not foldable, the unfolding process would not unfold those lines as they are not unfoldable and it would result in the report missing all the subsections and lines under that one.
This is fixed by modifying the unfolding process of such lines.
More information about that change can be found in the first commit's message.
---
2. The l10n_lt module's commit fixes a behavior happening in the Lithuanian BS and P&L. In those reports, the first lines of each section are not properly styled. This is due to them having the wrong hierarchy level assigned.
This is fixed by forcing the assignment of the right hierarchy level to the lines that are concerned.
More information about that change can be found in the second commit's message.
---
task-3462024
Community PR : https://github.com/odoo/odoo/pull/133358
---
I confirm I have signed the CLA and read the PR guidelines at [www.odoo.com/submit-pr](http://www.odoo.com/submit-pr)
Forward-Port-Of: odoo/enterprise#46422Depending on the filters applied on the intrastat report, different reports should be added to the XML export. Different companies have different reporting obligations when it comes to intrastat reports in Belgium. This largely depends on the total value of goods exchanged, but is specified by the government, and is largely unknown to us. Only the reports relevant to a particular company should be included in the XML export. Including a report for which the company has no obligation results i
Original PR description
Depending on the filters applied on the intrastat report, different reports should be added to the XML export. Different companies have different reporting obligations when it comes to intrastat reports in Belgium. This largely depends on the total value of goods exchanged, but is specified by the government, and is largely unknown to us. Only the reports relevant to a particular company should be included in the XML export. Including a report for which the company has no obligation results in an error while uploading. Our way of solving this is by having the XML contain only the reports which the current filters allow. The relevant filters in this case are "arrivals" and "dispatches", and "extended" (vs "standard"). Tests have been added to ensure the export format of the l10n_be_intrastat report is correct. task-id: 3501515 Forward-Port-Of: odoo/enterprise#48097 Forward-Port-Of: odoo/enterprise#47322
https://github.com/odoo/enterprise/pull/43103 refactored the sign template edition page to use the common PDF manipulation logic that all other iframe components used. However, during this refactoring, the deleteSignItem overwrite from SignTemplateIframe was calling super before adding the id of the deleted sign item to the array of deleted sign items. This caused the code to save the template before saving the id of the deleted item. This commit changes the order of the super call and the array
Original PR description
https://github.com/odoo/enterprise/pull/43103 refactored the sign template edition page to use the common PDF manipulation logic that all other iframe components used. However, during this refactoring, the deleteSignItem overwrite from SignTemplateIframe was calling super before adding the id of the deleted sign item to the array of deleted sign items. This caused the code to save the template before saving the id of the deleted item. This commit changes the order of the super call and the array assignment to fix the behavior. task-3489667 Forward-Port-Of: odoo/enterprise#47729
Before this commit: -When cancelling appointment based on resource it includes organizer name in mail template, which has nothing to do with that. -In portal view of user, default filter is 'upcoming'. After this commit: -Organizer's name is excluded from the mail template when cancelling a resource-based appointment. -Default filter is set to 'all' in portal view for appointment. Task-3458881 Forward-Port-Of: odoo/enterprise#46380
Original PR description
Before this commit: -When cancelling appointment based on resource it includes organizer name in mail template, which has nothing to do with that. -In portal view of user, default filter is 'upcoming'. After this commit: -Organizer's name is excluded from the mail template when cancelling a resource-based appointment. -Default filter is set to 'all' in portal view for appointment. Task-3458881 Forward-Port-Of: odoo/enterprise#46380
The aim of this commit is to correct the formula from the reports allowing users (and Odoo) to create accounts that is not part of the CoA aside of the existing accounts and make sure those are correctly included in the reports. Context: During the reworking of the CoA we were a bit too fast and we wrote the accounts numbers writen from the official spreadsheet. Before this commit: Accounts created by the OSS feature wouldn't appear in the CoA. After this commit: Those accounts appea
Original PR description
The aim of this commit is to correct the formula from the reports allowing users (and Odoo) to create accounts that is not part of the CoA aside of the existing accounts and make sure those are correctly included in the reports. Context: During the reworking of the CoA we were a bit too fast and we wrote the accounts numbers writen from the official spreadsheet. Before this commit: Accounts created by the OSS feature wouldn't appear in the CoA. After this commit: Those accounts appears in the CoA task-id: 3060790 Forward-Port-Of: odoo/enterprise#48569
Projects that have timesheets sold should be billable. This fixes staging failure of PR: [@odoo#137166](https://github.com/odoo/odoo/pull/137166) Forward-Port-Of: odoo/enterprise#48383 Forward-Port-Of: odoo/enterprise#48240
Original PR description
Projects that have timesheets sold should be billable. This fixes staging failure of PR: [@odoo#137166](https://github.com/odoo/odoo/pull/137166) Forward-Port-Of: odoo/enterprise#48383 Forward-Port-Of: odoo/enterprise#48240
When a normal user requests an appraisal, it will translate the QWeb template to an email form within `request_appraisal.py`, however, since the href is created as `t-att-t-att-href` instead of `t-att-href`, it still believes there is code within the template and throws a permission error in `_compile_directives`: `This rendering mode prohibits the use of directives.` For admin users this doesn't matter, but if a user doesn't have the `Mail Template Editor` group, they will get an access err
Original PR description
When a normal user requests an appraisal, it will translate the QWeb template to an email form within `request_appraisal.py`, however, since the href is created as `t-att-t-att-href` instead of `t-att-href`, it still believes there is code within the template and throws a permission error in `_compile_directives`: `This rendering mode prohibits the use of directives.` For admin users this doesn't matter, but if a user doesn't have the `Mail Template Editor` group, they will get an access error when sending the email: `Only users belonging to the "Mail Template Editor" group can modify dynamic templates.` By making these normal t-att-hrefs the issue is fixed. Forward-Port-Of: odoo/enterprise#48508