Purpose
=======
Traceback when following these steps:
- Install MRP
- Load French translations
- Set language to French
- Activate 'work orders' on MRP configuration
Error: The field 'sel_groups_9_10_1' doesn't exist.
This is because the only selection groups field on the res_users view
that doesn't have a transitive closure (the user's type Internal/Portal/Public)
is ordered by name.
1: Internal User
9: Portal
10: Public
becomes
9: Portail
10: Public
1: Utilisateur Interne
which lead to the traceback.
We should retrieve these groups ordered by 'id' to avoid the issue.
Due to fccfd36 and 4ba7fbb the translations were only imported, considering the
.pot as the reference.
During import or a manual csv or po file, there is no pot file.
Add tests with Klingon and Dothraki
Fixes#27044
By default, the `set_value` method doesn't do anything, and is expected
to be overridden. However, `ir.default`, groups and
`ir.config_parameter` are set BEFORE `set_value` is actually called.
This is an issue when it is necessary to retrieve one of these values
before the save, for example in order to compare the value before and
after.
We move the setting of the various values directly in the `set_value`.
This way, it becomes possible to interact with the values before any
modification is performed. On the other hand, the existing logic remains
unchanged.
opw-1882068
When no `base.module_category_user_type` Application is found, the group
view was generated with the domain `[('', '!=', <int>)]`, which is will
fail view validation.
This situation happen during database migration or if the module category
is deleted.
In the first attempt at #26134, the pot_targets was cleared after creating
the pot_rows object.
Since the rows not present in the pot_targets are now skipped, clearing the pot
should not be done.
Still use a temporary list pot_rows to avoid modifying the list we are iterating
on.
Update the .po test file to match the new file format
Closes#26881
cherry-pick of 428fbd0381 that was reverted at 737ba55e1e as it was making
tests fail
The following commit will correct the tests
This commit only reverts the revert
'account_accountant' is only defined in enterprise.
Before this commit, many of us forgot to manually install it
before running main_flow_tour in enterprise.
Plus, it was difficult to know that a required module is missing
when a step failed. The error was not clear.
Now, the post hook will check if this module exist (it's the case in
enterprise) and will install it.
The override of fields_get adds "virtual" fields corresponding to
groups.
If for example we make "res.users" have inherit "mail.thread", we get
these "virtual" field as if they had "track_visibility", since we do a
"fields_get" with fields having track_visibility expecting to only get
back "track_visibility" ones.
So the system would then fail trying to track visibility on fields like
"in_group_5" and for example a res.users could not be created anymore.
With this fix, we fix the fields_get so it respect the fields we ask of
it.
fixes#22332
opw-1878654
closes#22338closes#26705
Co-authored-by: Wolfgang Pichler <wpichler@callino.at>
When bundle contains both, sass and less, the unlink on old_attachments
will be called twice and thus results in MissingError.
This commit closes#26110
- When a tracked field is modified, a mail.message is created.
When create is called its tries to fill missing values with "default
values".
It first tries to find the default values in the context, which may
occurs.
For example, modifying a tracked field on a subtask will add a key
"default_parent_id" in the context, which is the parent_id of the project.task.
Create will try to use "default_parent_id" for the mail.message
parent_id field, which make the SQL Request invalid.
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.
But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:
- loading quickly two times the /web route
- for each recompute the assets
=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).
With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.
So instead of a "500 Internal Server Error" page and in log:
bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
ERROR: could not serialize access due to concurrent update
"GET /web HTTP/1.1" 200 -
"GET /web HTTP/1.1" 500 -
... big traceback ...
load could not load template
we would get the requested page without error and:
bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
ERROR: could not serialize access due to concurrent update
"GET /web HTTP/1.1" 200 -
SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
"GET /web HTTP/1.1" 200 -
As a side node, the issue was exacerbated in some instances:
- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
more quickly" option may load a page two times. for example:
-> an URL is entered in address bar
-> a prediction request to it is started URL
-> go to this page (Enter) when that request is not already resolved
-> the prediction request is cancelled and a new request is started
[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ
note: 10.0 backport of 11.0 #26778
opw-1849167
closes#26785
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.
But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:
- loading quickly two times the /web route
- for each recompute the assets
=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).
With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.
So instead of a "500 Internal Server Error" page and in log:
bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
ERROR: could not serialize access due to concurrent update
"GET /web HTTP/1.1" 200 -
"GET /web HTTP/1.1" 500 -
... big traceback ...
load could not load template
we would get the requested page without error and:
bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
ERROR: could not serialize access due to concurrent update
"GET /web HTTP/1.1" 200 -
SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
"GET /web HTTP/1.1" 200 -
As a side node, the issue was exacerbated in some instances:
- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
more quickly" option may load a page two times. for example:
-> an URL is entered in address bar
-> a prediction request to it is started URL
-> go to this page (Enter) when that request is not already resolved
-> the prediction request is cancelled and a new request is started
[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ
opw-1849167
closes#26778