This will allow to remove AND/OR mix in identifying fields of composer
suggestion view.
Part of task-2741982
closesodoo/odoo#94999
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, subtemplates in kanban did not share the same
ViewCompiler instance, thus losing the aggregation of the dropdowns.
Now, a single ViewCompiler is used for each KanbanRecord, properly
taking into account dropdowns declared in subtemplates.
closesodoo/odoo#94977
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In the new Kanban view, clicking on a BooleanToggle field (on any card)
always toggles the field of the first card. We would like to toggle the
field of the card that is clicked on.
This is because the same id (fieldName) is used for all Checkbox
in the BooleanToggle. If you click on a label, its native behaviour is
to click on the input with the same id. In our case, this will always
create a click on the first ToggleBoolean (the first card).
The solution is to make the id passed to the field unique. To do this,
we will add the datapointID to it.
Before:
Card 1: id = fieldName
Card 2: id = fieldName
After
Card 1: id = fieldName_datapoint_1
Card 2: id = fieldName_datapoint_2
closesodoo/odoo#94966
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This allows to remove the AND/OR mix from message view identifying fields.
Part of task-2741982
closesodoo/odoo#94948
Related: odoo/enterprise#28988
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Clean (demo-)data to be fully editor-friendly (i.e. use `<p><br><p>` instead of
`<br>` between paragraphs), fix some (grammar) typos.
Task-2893398
closesodoo/odoo#94943
X-original-commit: 87b4bc6d19fef947f7bf5d15835f17b9c2019902
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The fix 1b80fe9 removed the behavior that made `.o_not_editable`
`contenteditable=false`. Without this behavior, other issues could
arises.
closesodoo/odoo#94889
X-original-commit: 4e7d6e1a70e44df3476c2602119fbcedc7c04199
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Purpose
=======
Currenlty an error is raise saying that a leave cannot be set accross
overlapping contracts.
But in this special case we could split the time off and allow this simple
action.
Taskid: 2836901
X-original-commit: 1012a7ea8033675b6ebab96922e124b04e5ed884
Part-of: odoo/odoo#94885
Purpose
=======
We currently prevent leaves overlapping several contracts to avoid messing
with the generated resource.calendar.leave.
In case the contracts are on the same resource calendar, this shouldn't be
an issue actually.
Taskid: 2836901
X-original-commit: 4e87c30bb136083153091e67e6dd9d9f64fa94c2
Part-of: odoo/odoo#94885
A forum tag is always linked to a forum.
But some flows are not considering that part and are returning/using
tags from other forum too.
Step to reproduce, having 2 forum `Cats` and `Dogs`:
- Create a `Food` tag on the `Dogs` forum
- On the `Cats` forum, type `Food` in the tag input
- First error: the `Food` from `Dogs` incorrectly shows up
It means that the user can't create a new one from the `Cats` forum
but will actually have to select (without know it) the one from the
`Dogs` forum.
- Select that tag anyway
- Second error: The tags displayed on the post is redirecting to the
wrong other forum, ultimately not showing the post from all forums
(and the one you just came from).
- Third error: The /tags page won't list the `Food` tag on the `Cats`
forum.
Note that there is probably some access traceback involved in a multi
website and/or multi company setup.
After this commit:
- only the tags from the current forum will show up and be selectable
when creating a post.
- it will be possible to create a new tag for a forum is another forum
already has a tag of that name
- the tag on the post (next to its title) will not redirect to the
incorrect (and possibly not accessible) forum
Note that the method was already reading multiple properties of `self`,
it was already not an `api.model` method anymore.
closesodoo/odoo#94917
X-original-commit: 4ff52d0b9a71d3072f5973d8e900d802e6b129c0
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: hoangtiendung <hoangtiendung070797@gmail.com>
Probably introduced in PR changing rendering of chatter in form renderer that
changed timers in unfortunate situations.
Open form view utils was missing an await on (chatter container) render, but the
issue was not perceptible before.
closesodoo/odoo#95003
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Some payment tests were unexpectedly relying on the 'transfer' payment acquirer
to work because of a multi-company issue in the core payment tests setup.
This commit fixes the problem and adds an additional check in the tests to
make sure they rely correctly on the 'dummy' acquirer created in the payment
tests common.
closesodoo/odoo#94972
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
The _parse function of sanitize used to be recursive both along the
length and depth of the DOM tree, making it exceed maximum stack size
limit for long documents. This updated version is now only recursive in
the depth of the tree, not its length. It would be possible to write a
fully non-recursive version of this function but it is out of scope of
this task and is unlikely to happen anyway as DOM trees are way more
unlikely to exceed stack limits in depth rather than length.
task-2895671
closesodoo/odoo#94967
X-original-commit: c711a2c4106da0c2d5c35ee7a367ba86a9dcbdb7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
"All" is capitalized but not "records".
It should be consistent: either all capitalized, none, or only the first word
closesodoo/odoo#94963
Related: odoo/enterprise#28990
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Using `./odoo-bin` to start Odoo, the addons path can contain a `~`, eg
`~/Documents/whatever`.
Those `~` are accepted and work both with the `--addons-path` passed as
the command argument, or in the `.odoorc` config file.
The `@standalone` tests (launched with `./test_module_operations.py`)
however did not work with that `~` as the path was not "normalized".
Neither a `~` in the config file or in the `--addons-path` argument were
working.
While it is not very critical, it is a nice to have to have the same
behavior as the `./odoo-bin` as this made me lose quite some time
figuring why I couldn't use my usual `design-themes` repo addons path.
closesodoo/odoo#94953
X-original-commit: e633092a5932f24eda840e1decca92ed238a3a29
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Co-authored-by: Xavier-Do <xdo@odoo.com>
Revert of
https://github.com/odoo/odoo/pull/92794
If you install pos_restaurant and open a PoS sale session, issue will start to appear after a certain time (about 1 minute):
For V15:
Javascript console logs will log errors:
`TypeError: Cannot read properties of undefined (reading 'id') Chrome.js:97`
For V15.2:
The products button will become unresponsive (so the PoS is unusable).
With error in the JS console as well:
`TypeError: Cannot read properties of undefined (reading '0') Chrome.js`
OPW-2889985
closesodoo/odoo#94938
X-original-commit: 965b797772becba0dbd7b978b5c422ba1474663a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Commit [1] moved the edition of the website in the backend and
introduced an iframe as the editable. In doing so, some tour
actions became unstable.
The issue is that previously, when an action reloaded the page, the tour
service would reload as well. This is no longer the case and the tour
service stays active when the page is reloaded (e.g. when saving a
page). This can lead to a tour clicking on an item before it is ready to
be clicked.
Specifically in this case, the tour saved and clicked on edit as the
next step.
Clicking on edit before the page is properly reloaded leads to the click
being ignored.
This commit uses the util function `clickOnSave` which ensures we're out
of edit mode and the page is reloaded before doing anything else.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
runbot-4074
closesodoo/odoo#94932
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
A CSS comment in webclient_templates was written as a JS comment and
appeared as an invalid CSS rule in the devtools. This commit converts
that comment to use the proper syntax.
closesodoo/odoo#94925
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In some cases, empty messages can be displayed in the portal chatter.
For instance, if a customer sends a message with no body and just
an attachment, and the attachment then gets deleted, it will still
be displayed as an empty message in the portal chatter.
To solve this, this commit filters out empty messages from the portal chatter.
Task-2833919
closesodoo/odoo#94828
X-original-commit: 10d2a3e01a0fb62860e502cc67e5311b9420a684
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The website architecture has been refactored for the internal users and
admins with [1].
Now, they can access the website in the backend inside the website app.
Long story short, the website will be displayed in an iframe in a client
action. The URL of the browser will be tweaked to reflect the iframe one
instead of the real one (which is something like /web#action=..).
It had a few drawbacks:
- On page refresh (F5 or browser button), the user would land on the
frontend version of the website instead of remaining in the backend.
- When the user edited the URL (Like removing `/shop` and typing `/jobs`
instead, he would land on the frontend version too.
- Impossible to directly go to the backend version of the website.
Those are improved with this commit by using a slightly different URL
when we are in the backend. A `/@/` will prefix the iframe URL.
If logged in, the user will land on the backend. If not, it will simply
redirect to the frontend version of the website.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
closesodoo/odoo#94580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Fix some uncommon nightly error on the runbot where a race condition
happened when the tour finished too soon. The test is successful but
during the browser cleanup, things are still happening.
task-2832564
closesodoo/odoo#91920
Related: odoo/enterprise#27600
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
``scheduled_date`` field of ``mail.mail`` is a char field since its addition
in 2015 (see odoo/odoo@364b4ba06d). As its first usage was in combination with
mail templates, a char field was used to simplify its implementation.
However this technically allows to store whatever value in that field. Using
it in a filter with a datetime argument is quite strange. A workaround is
to try to parse as much as possible the inputs, remove timezone information,
try to localize it, and have it in regular server format to enable filtering
on it.
We consider value should be set in UTC. If we have a specific timezone set
on the input we localize it to UTC. Otherwise we consider the input was done
in UTC, as all datetime fields. It is the role of the business code generating
mail.mail to either give the timezone, either already convert into UTC.
This might solve the following bug
Step to reproduce:
activate the developer mode
go to settings - technical - emails
create a new email and set the Scheduled Send Date in the future
run the scheduled action Mail: Email Queue Manager
Current behavior:
the email is sent and the action does not consider the filter
Expected behavior:
the email is not sent and will only be sent when the scheduler detects
that scheduled_date exceeds the current time.
Task-2833300
opw-2823106
closesodoo/odoo#94937
X-original-commit: 5c113cb9d54e051132a9a50deb2fcf61f9c9dc2c
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit:
There is no backlink to message on 'Replying To' in header of Composer
After this commit:
There is a backlink to message
Task-2664839
closesodoo/odoo#94873
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2898692
closesodoo/odoo#94914
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Purpose
=======
Allow portal users to deactivate their accounts from the portal view.
After the deactivation, they are redirected to the login page, so
they can verify that they can not longer login with their credentials.
We first archived the record and remove sensitive information (password,
login, so he can not log in again with the same credentials).
After the deactivation, we blacklist the email and the phone of the
user, so we are sure that we never send him again email / SMS.
Then, we create a <res.users.deletion> to delete the user and the
partner in a CRON because this operation can be heavy (write_uid,
create_uid field on all models).
Task-2629544
closesodoo/odoo#78298
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
Allow portal users to deactivate their accounts from the portal view.
After the deactivation, they are redirected to the login page, so
they can verify that they can not longer login with their credentials.
We first archived the record and remove sensitive information (password,
login, so he can not log in again with the same credentials).
After the deactivation, we blacklist the email and the phone of the
user, so we are sure that we never send him again email / SMS.
Then, we create a <res.users.deletion> to delete the user and the
partner in a CRON because this operation can be heavy (write_uid,
create_uid field on all models).
Task-2629544
Part-of: odoo/odoo#78298
Consider two models A and B, a many2many field F from A to B and its
inverse relation G from B to A. When F is modified, G is updated
accordingly in cache. The statement
records.write({F: [Command.link(b.id)]})
is expected to add b.id to records.F, and add records.ids to b.G. In
order to avoid nondeterminism, the additions should be done at the end
of the recordset, and in order. In other words, if none of "records"
are in b.G, then after the statement above, b.G should be updated as
b.G = b.G + records
This patch ensures that "records" are added in order.
closesodoo/odoo#94909
X-original-commit: b8fbc460673827497f6817e1751b5d365d8ae29a
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
Before this commit, it was possible to set the selection of the document
whenever sanitizing an element that was not present in the dom.
task-2877501
closesodoo/odoo#94900
X-original-commit: 7b60241e01914ffc0176c24d4e780f773f9a277f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This PR introduces the new kanban, list and form views written in owl.
Even though it contains the implementation of those 3 views, only the
kanban view is activated for now (the list and form views aren't 100%
ready yet, so they aren't added to the view registry).
Alongside the views, the fields (`<field name="..."/>` in archs) and
widgets (`<widget name="..."` in archs) of web/ have been implemented
in owl as well. Legacy ones remaining in other addons are supported
in our new views, thanks to a compatibility layer. The goal is to convert
them asap though. A few fields and widgets from other addons have
already been converted in this PR.
Legacy views, fields and widgets are kept for now, which explains the
number of added lines in this PR (around half of them concern tests).
They are still extended by custom code in other addons, that still need
to be converted (a lot of them are already on the way). Moreover,
they are still used in Studio as well. The plan is to lazy load them in
the Studio bundle when all custom code extending them will be
converted. Studio will be converted for v17.
closesodoo/odoo#92475
Related: odoo/enterprise#27879
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
With this commit, we only display the "legacy" indicator (red/pink
background color to indicate old widgets in new views) in debug mode.
Part-of: odoo/odoo#92475
This commit allows multiple declarations of a dropdown menu in a kanban
card to generate a dropdown component for each definition.
Part-of: odoo/odoo#92475
In legacy kanban views, one could use JSON in the arch to, e.g.
parse text field values encoding data. This was no longer the case
in the new implementation. This commit fixes the issue by adding
it to the kanban record rendering context. However, we'll consider
adding it in owl directly.
Part-of: odoo/odoo#92475
Some attributes of the elements determining the "ellipsis" dropdown menu
of a kanban card were invalidly reported on the main Dropdown node
created during the compilation. This could cause crashes (during the
props validation) or broke the CSS.
In this commit:
- we fix the above mentioned problem
- we put the class o_drowdown_kanban on all "ellipsis" dropdowns
generated by the kanban compiler in order to get the appropriate CSS
- we make sure that those dropdowns are visible in kanban dashboards
by default
Part-of: odoo/odoo#92475
This commit removes the SimpleDialog class and adapts the
KanbanCoverImageDialog to use the Dialog component instead.
It also makes sure that the KanbanCoverImageDialog uses the FileInput
component to use a more centralized way of calling the HTTP
'upload_attachment' route.
Part-of: odoo/odoo#92475
This commit changes the prop names of the FileInput component to bring
them in line with the current naming conventions. Also the default
route has been changed from '/web/binary/upload' to
'/web/binary/upload_attachment' since the latter is used more often.
Part-of: odoo/odoo#92475