The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.
Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.
This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
When using sudo, the administrator is logged as deleting the action.
For audit reason, log the correct user.
To avoid access rights errors, only group system can delete the action.
An ir.attachment record can be served as a request's reponse if:
- a request triggers a 404
- the ir.attachment record has its url field matching the url of
the failed and is of binary type
Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.
This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.
As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.
As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.
[1] 61065b6d04
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
The token field is a technical data that the other users are not able to use.
It may be confusing for users to see token on the user interface.
Still show it to administrator for debug reasons.
The dateutil package uses lazy import to selectively expose its
features: `parser`, `relativedelta`, `rrule`, `tz`.
Depending on installed modules and order of initialization, there was no
guarantee that a given feature was already loaded during the preparation
of the action context.
This patch ensures that we always preload the feature set we need, and
only that feature set. This way we have a consistent `dateutil` lib in
the action context at all times.
When using sudo, the administrator is logged as deleting the action.
For audit reason, log the correct user.
To avoid access rights errors, only group system can delete the action.
An ir.attachment record can be served as a request's reponse if:
- a request triggers a 404
- the ir.attachment record has its url field matching the url of
the failed and is of binary type
Following rev[1], portal users have the right to create these kind of
records, and it is a security concern.
This patch restrict the ability to create and write on the ir.attachment
records that may be served through the dispatch's exception mechanism to
settings users.
As the asset bundles files are served through the use of these special
ir.attachment, we make sure to retrieve only ir.attachment records
created by the superuser in the `get_attachment` method.
As website administrators often need to play with these special
ir.attachment, we also let to this group the permission to manage them.
[1] 61065b6d04
Make sure building reports using local resources are disabled.
This avoids get different report result based on the system if the
given resources are or not present (e.g. custom style)
Before this commit, the discount on a so line was always brought to zero when changing the price
After this commit, we do this only when the pricelist is supposed to compute the discount
OPW 1867262
closes#25851
The POS uses a DomCache for various UI elements to avoid re-rendering
elements that are the same as the last render. One such cached UI
element is an entry in the client list.
When a partner is edited in the POS frontend the POS will write this
to the backend and then it will load all updated res.partner
records (new write_date > previously loaded most recent write_date).
To render the newly updated information *and* to ensure any other
partner edited (through backend or because it's a child contact) is
updated just clear the whole cache.
Fixes#13856
Facing the following cases, only the database admin can merge res_partners:
1. The email addresses are different.
2. The origin contact(s) is (are) linked to some account move lines.
This commit adds a kwarg in the merge function. This argument allows to skip the two tests.
So they can be bypassed when overloading the function (depending of the current user access
rights for instance) in order to merge partners even if they have different email addresses
or with account move lines on the origin one.
It can also be called programatically and bypass the checks.
This commit also makes the merge wizard correct any inconsistence in the
allowed companies/currency company of the merged contacts and the
related user(s).
Closes#24376
In LESS, 'fadeOut' function is used to make a color more transparent.
In SCSS, that function is called 'fade-out'.
Closes https://github.com/odoo/odoo/pull/25233
Before this commit, the user could lost some unsaved changes in a record when
posting a message in the chatter.
This is due to reloading the data on the record, which is necessary because
a `message_post` may make some changes on the record [1].
With this commit, a dialog will warn the user that the record will be reloaded
in the following cases:
a) posting a message in the basic composer that will reload the record
b) opening the full-composer when the record is dirty
Indeed, any operation after opening the full-composer will always refresh the
record (even closing the dialog).
Known issues:
- a record is not considered as dirty if we only make changes in its
description from a pad.
> the content of the pad will be erased without any warning...
[1] https://github.com/odoo-dev/odoo/commit/803d5cf04835fcf8e7ddb143e1ab140408beef93
opw-1825005
Revision on b09f0c99
The intent of the previous commit was to no drop records in a list
on discard in the following cases:
- when they have been created from a `default_get`
- when they have been created from an `onchange` that result
from a `default_get`
Before the commit above, the kind of records that were abandoned
in those cases are stated as invalid, which happens when a record
has a required field that is empty.
The case of an `onchange` that is not involved in a `default_get`
was not considered in the fixes above. In fact, this is the intent
behaviour in most cases. However, if the items in the list are
created from such an `onchange`, we should not drop them.
This commit fixes the bug where records in a list that are created
from an `onchange` are wrongly abandoned. Here is the new logic to
abandon a record on discard in a list:
- the record that is marked as "do not abandon" should not be
abandoned;
- a record that is registered as a "not new addition" in the
list should not be dropped;
- a record that is registered as a "new addition" in the list,
and has been updated afterwards, should not be dropped;
- a record that is not new should not be dropped;
opw-806650
Avoid to crash the client web with setValue(false).
false.match, false.split, false.length... will not works.
Before this commit, _render call the setValue after comparing '' !== false
Before this commit, if you add 2 times the same item quickly, that raise concurrent update.
With side effect: quotation rollbacked and new one created, or if no concurrent
update 2 times the same product in the cart.
Now we avoid that the user click a second time on "Add to cart" before the end of the
first click which add or move the product to the cart.
Related to #24853
When removing Odoo Debian package, the directory /var/lib/odoo is also
removed. This directory could contain important data like filestore or
custom modules.
With this commit, this directory is preserved on removal and deleted
when the purge command is issued with a Debian package manager.
Fixes#22138
- post process the attributes in widget html value
(except if: data-no-post-process)
- apply cdn for python qweb widget image
- apply cdn for background-image (blog e.g.)
- use cdn for asset files
Now cdn is used (even if not public user) except if:
- debug mode
- editor
- translator
External library added in asset now appear only one time.
Before this commit, t-js='false' and t-css='false' was returning remains
Incoming email servers have an action_id field holding a server action to
run on newly created records. It comes from old implementation of mail
gateways in Odoo. Since then mail gateway has evolved. Incoming mail servers
are not linked to a unique model anymore. With aliases and automatic thread
creation mails can create records in various models.
As the server action is bound to a given model it causes issues. Either
we have to give back the result of the mail gateway processing to ensure
models match. Either we have to limit action_id to records created
using the "default model behavior" of incoming mail servers.
We choose to remove this field. Same result can be achieved with an
automated action running on create trigger. If exactly the same
behavior is intended the following rules should be applied
* add automated action with model linked to the one you want to
update depending on alias configuration and work flow;
* set trigger to create;
* set action as python;
* if it is necessary to be linked to the mail gateway, check in
record message_ids that there is a message with message_type
being 'email' meaning it has received an incoming email;
Using that heuristic migrating existing fetchmail action to server actions
should be quite straightforward and will give more flexibility.
This commit is linked to task ID 58641. Closes#23621 .
Refactoring of qweb to call _post_processing_att for each nodes. This
change remove the crappy ovewrite in website module. The website overwrite
only the _post_processing_att to add the cdn parameters.
The static node (without t- attributes) can stay static (remove overwrite
of _is_static_node), the cdn is applied at the compile time for this
nodes instead of at the running time like the dynamic node.
When manually registering a time on a Work Order, an error is raised
because of an incorrect value for `workcenter_id`.
The field is added in the view.
opw-1851766