This adds many improvements to table editing in Odoo Editor, as well as some styling improvements.
New features :
- Rectangular cell selection
- Changing the color of a cell
- Buttons to add/remove/move rows/columns
- Resize rows/columns
task-2858455
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#92200
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The commands to add rows and columns in certain positions were
superfluous as commands to add rows and columns suffice if you pass them
a position argument.
Part-of: odoo/odoo#92200
When the user picks a color, the colorpicker closes, triggering
color_leave. This is conceptually wrong and can cause issues as it
reverts the current history step.
Part-of: odoo/odoo#92200
This adds a menu to manipulate table rows and columns when hovering
over them. Hovering over the first row shows the menu for the hovered
column.
Hovering over the first column shows the menu for the hovered row.
The buttons in the menu allow the user to add/move/remove rows/columns.
task-2858455
Part-of: odoo/odoo#92200
With this, when whole table cells are selected and the user picks a
color in the toolbar's colorpicker, that color is applied to the whole
cell rather than to the text only.
task-2858455
Part-of: odoo/odoo#92200
This adds the feature of showing the appropriate resize cursor depending
on which border (vertical or horizontal) is hovered in a table.
task-2858455
Part-of: odoo/odoo#92200
This adds the possibility to select whole cells, rectangularly rather
than line per line from left to right then top to bottom.
task-2858455
Part-of: odoo/odoo#92200
- reduce the default row height to get a padding of .5rem instead of .75
- use a darker grey for table border color
task-2858455
Part-of: odoo/odoo#92200
When converting a paragraph to a checklist, we first apply the checklist
class and then take the paragraph's attributes and apply it to the new
list. If said attributes included the "class" attribute, it wrote over
the checklist class.
Part-of: odoo/odoo#92200
When the editor's test utils set the selection, they did not trigger the
selectionchange event, which means the editor's listener didn't get
called.
Part-of: odoo/odoo#92200
`getDeepRange` fetched a range on potentially the wrong document and
`getTraversedNodes` created a node iterator on potentially the wrong
document, when the editable was not in the DOM.
Part-of: odoo/odoo#92200
If an error was thrown during a call to `testEditor` (eg, a test
failed), we never went through the code that destroys the editor and
cleans the DOM. This catches any error to throw it only at the end of
the function.
Part-of: odoo/odoo#92200
Introduce a new Dynamic Placeholder Generator
in mass mailing and SMS creation.
Using a specific character (#) in subject or via the PowerBox in body
we open a field selector popup, which can be use to select
the wanted field and enter a default value. on validation, the dynamic
placeholder will be inserted in the corresponding input/editable.
task-2154624
closesodoo/odoo#71878
Related: odoo/enterprise#30333
Related: odoo/upgrade#3766
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
We remove the existing dynamic placeholder generator tab,
in mail and sms creation views.
In preparation of the implementation of a new way to generate
the dynamic placeholders
task-2154624
Part-of: odoo/odoo#71878
To Reproduce
=============
- share a project with a portal user (with editing rights)
- connect to portal with this user and try to group tasks by deadline
Problem
=======
An access error is raised stating that this user doesn't have right to read
`deadline_field:week` field.
The issue comes from this line :
https://github.com/odoo/odoo/blob/42cb8ad0a31162d9d1b93e4eae0562c89685fe3c/addons/project/models/project.py#L1621
where `fields` contains `date_deadline:week` but `self.SELF_READABLE_FIELDS` contains `date_deadline`
that's why `date_deadline:week` will remain in `unauthorized_fields` .
Solution
=========
To solve the issue we take only the field name from the groupby when computing `fields_list` that
will be checked by `_ensure_fields_are_accessible`
opw-2949047
closesodoo/odoo#98953
X-original-commit: 1d0a62d0d235a4f0686e17033bb9d144d5583907
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
Before this fix, resequencing would use values from _get_sequence_format_() run from an empty model.
This method result is influenced by the sequence_override_regex param of the move journal.
This means that if the journal of the moves that are resequenced has a sequence_override_regex param, it will be ignored in the wizard.
This fix run the _get_sequence_format_() method on the first move to take the journal into account.
Note that the wizard only allows resequencing moves from one same journal.
closesodoo/odoo#98926
Task: opw-2825699
X-original-commit: b22c37a5f173161b4a5f798462ea05142bb9334a
Signed-off-by: William André (wan) <wan@odoo.com>
If datetimepickers were used too soon after page loading, they would use
the wrong format and UI options as the code in charge of initializing
those options was not fully lazy loaded yet.
With this patch, we prevent the tempusdominus lib to consider pickers
that are in a body that is marked by the lazyloader during the lazy
loading of JS files. We could potentially not add the lib attribute
(data-toggle="datetimepicker") on those elements and let the business
code initializing the pickers add it but that would not have been a
stable fix and it may be better this way as this works generically.
opw-2944720
closesodoo/odoo#98917
X-original-commit: 7e012340d3adcd64e829a5dca34173da24d649bc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps :
In a ONE company environment,
\- Go to Project Task list view.
\- Display 'Customer' column.
\- Select multiple records (multi-edit).
\- Click on a 'Customer' cell to display the dropdown list.
Issue :
Traceback : company not found.
Cause :
partner_id's domain refers to company_id,
which is not present in the vue if not in multicompany.
Fix :
Add it in ivisible.
closesodoo/odoo#98913
Signed-off-by: Xavier <xbo@odoo.com>
- fix typo in model manager: "return" -> "continue" in loop
- fix typo in model field: "models" read from record not from field itself
- fix reading obsolete fields in message view
- move listeners on records directly rather than storing a map on model manager
(code a bit easier to read, and issues on deleted records easier to debug)
- remove obsolete trigger of listener in _created (not possible to observe a
record before it exists)
closesodoo/odoo#98892
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Fixes a traceback due to Visitor/country being a computed field
that is imperatively updated by server data.
Task-2962126
closesodoo/odoo#98847
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
PURPOSE
Improve performance of activities creation and management. Improve overall
code.
SPECIFICATIONS
Main code changes are
* classify activities by model, to browse related records in batch per model
instead of one by one;
* rewrite create and _action_done main methods to be done in batch;
* skip useless computation (use categories before browsing records, avoid
useless ref / direct xml ID check, ...);
* globally batch when possible;
See sub commits for more details.
LINKS
Task-2884301 (Voip synchronization simplification)
Task-2883589 (Activity creation performance)
closesodoo/odoo#93682
Related: odoo/enterprise#28421
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Update counters after all previous performance commits. It is done as a single
update due to frequent conflicts and difficulty to keep updated counters for
each commit separately.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
When assigning activities to people we check target user has the rights to
access to document. Otherwise they end up with notifications and activities
for records they can't see.
This code is currently a loop doing browse and access checks one record
at a time. We improve it by grouping activities by related record model
and target user, allowing to batch some calls.
Note that this somehow reverts odoo/odoo@c38a0d6768 and odoo/odoo@a98c15f443
as normally odoo/odoo@16351e4879 should be sufficient to handle MC use
cases. Lack of clear unit tests for those corner cases make it difficult to
clearly reproduce issue anyway.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
MailActivity model has an ``_action_done`` method that is quite heavily
used and overridden. It notably posts messages, create next activities but
also has some specific behavior depending on category.
Purpose of this commit is to improve code of this method to avoid useless
queries, improve performance, and rethink the computation with batch in
mind.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Purpose of this commit is to improve batch creation of activities by trying
to group checks by user and/or model when possible.
Notably
* subscribe partners in batch when several activities are assigned to the
same user (use case: batch assign on leads, users may be assigned on
several records in a single udpate);
* check in batch access on partners;
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Change some ``ref`` to low level method ``_xmlid_to_res_id``. The latter one
does not call exists, which allows to gain one query that we do not need
here.
Default methods on activity / activity mixin to find the default activity
type (todo, model-based, generic) are cleaned. Notably code was duplicated
between mixin and activity, it now always call the same code.
Remove an unnecessary ref, probably a leftover of new rendering methods on Qweb.
Remove an unnecessary sudo.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
No need to send bus notifications one by one, we may use sendmany. Various
activities crud methods send notifications, better group them when possible.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Improve performance by batching activities creation through the mixin. This
helps saving some queries.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Purpose is to add helpers on activity model, notably to ease batching based
on models. As activities are linked to records using a res_model / res_id
pair most code is not optimized (checking records one by one). Purpose of
this tool is to ease doing computation by batch of models.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
We now return generated records when calling ``_action_send_mail`` on mail
composer. This allows to have access to generated emails (in mass mode) or
posted messages (in comment mode). Otherwise we have to access sub-fields
like activity_ids / message_ids, which may be inefficient or generate extra
ACLs checks.
Also replace some |= with += when usage of OrderedSet is not necessary. To
keep ordering, ordered sets are used when doing an or between record sets.
However in some cases we know we are simply adding records not already in
a previous record set, meaning we can just use +.
Task-2883589 (Activity performance and cleaning)
Part-of: odoo/odoo#93682
Purpose is to use it notably in Voip where we link activities / phonecalls
to partners when possible. Future commits will use it more often in thread
methods.
Method to have the primary email is moved with that helper method in a sub
section, in order to have "model" helpers in the same section. Its code is
also simplified and fixed (return missing). Its name is made coherent with
other naming in the file.
Task-2884301 (Voip activity synchronization simplification)
Part-of: odoo/odoo#93682
This patch discard the fields to delete from data structures like field
triggers, field inverses, and fields to compute.
This is quite useful when uninstalling modules. This commit fixes the
uninstallation of modules base_setup, bus, mail, web_tour.
closesodoo/odoo#98668
X-original-commit: 49398a769b2ec4965bf148f10b5e13d0a6c1acff
Signed-off-by: Raphael Collet <rco@odoo.com>
Previous behavior
================
When `editable=bottom`, when we hit tab until the end of the line, the
user starts to create a new record.
But when `editable=top`, when hitting tab multiple until the end of the
line, the user starts to edit the first line that was existing before
instead of creating a new one.
New behavior
============
The behavior is consistent between both cases: the user can always
continue to edit lines one after the other.
The behavior for `editable=bottom` is not changed, but `editable=top`
continues to add lines on top one of each other.
linked to task-2879904
closesodoo/odoo#98603
Signed-off-by: Georis François (fge) <fge@odoo.com>
Before this commit, the `getFirstElementForXpath` function is used in
the unit test for the burndown chart. This function is used to select a
HTMLELement with xpath expression and could be used outside the unit
test of the burndown chart.
This commit externalizes this function in a project test utils JS file
to use this function in another unit tests file if needed.
task-2924268
closesodoo/odoo#97574
Related: odoo/enterprise#30173
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit adds a message "Be notified when in stock" on a product when it is out
of stock. When clicking the message, a form appears where the user can enter
his email. If he is a logged user, the email associated to the partner of the
user is pre-filled in the form. Otherwise the user enters his email.
task-id 2806828
closesodoo/odoo#96633
Related: odoo/upgrade#3718
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
FUNCTIONAL ISSUE
When they receive a rating request email, customers can click on this email to
pick a satisfaction level. However, this feedback is currently effectively
posted only when customers submit the feedback form.
Many customers do not go that far in the process and just close that form. This
means that while the feedback is caught and stored in DB nothing is posted and
users are not notified of this rating.
PURPOSE
When the customer clicks on an emoji, post a message in the chatter without
launching notifications. After 2 hours notify followers. If before this delay
the customer fills in the form, update the post content (new face, feedback)
and launch notification process with the feedback (inbox, emails, ...).
By default, the user has 2 hours to fill the feedback, after those 2 hours
we notify the message containing only the first rating without feedback.
TECHNICAL
Currently, rating from email (route with token) is the following
* Customer receives an email;
* Customer clicks one of the smiley face that redirects to a ``/rate`` route
with the token and rate value;
* the linked ``rating.rating`` record is updated and set consumed;
* Customer may change its face and add a feedback. In that case a message
is posted with the rating face in it;
Issues raised by this
* first rating update does not notify anyone, no message is posted;
* if Customer does not give a feedback, process is stuck at that point;
* the rating is not really linked to the posted message (see ``message_id``
field of ``rating`` record);
Fix that issue to have message directly at beginning of the flow and improve
log and notifications. Update ``rating_apply`` to post the message and update
it when feedback is given.
Allow to delay sending of notifications using a ``mail.message.schedule``
queue model that stores when to launch the notification process for a given
message.
See sub commits for more details.
LINKS
Task-2826699 (Mail: use datetime for scheduled_date mail field instead of char)
Task-2207626 (Rating: Log ratings, post feedbacks)
closesodoo/odoo#95623
Related: odoo/enterprise#29268
Related: odoo/upgrade#3669
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Rating page is broken since migration to bootstrap5. This commit fixes various
issues linked to btn-group, display and usage of group checkboxes. Overall
html structure is cleaned and bootstrap 5 rules are applied.
Some small display improvements are also applied to the rating email.
Task-2207626 (Rating: Log ratings, post feedbacks)
Part-of: odoo/odoo#95623
Co-authored-by: Adrien Dieudonné <adr@odoo.com>
Purpose
=======
When someone receives an email with a rating request, he can click on a
smiley. But if he does not write a feedback, nobody is notified. This means
some rating as somehow lost and people are not notified of it.
Specifications
==============
Now, when the user clicks on the smiley, a message is posted but notifications
are not yet sent. This uses the new ``mail.message.schedule`` mechanism added
in this PR. It gives the user some time to write their feedback and send it.
If they write and submit a feedback, the notification process is launched.
Emails and inbox notifications are created and sent.
If they don't write a feedback notification process is launch after 2 hours.
Testing
=======
Some cleaning is done in tests, notably to split some fields tests from
performance test. A bit performance test is also split into sub tests in
order to better understand queries.
Task-2207626 (Rating: Log ratings, post feedbacks)
Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Purpose of this commit is to allow to update the scheduled date when using
``_message_update_content`` tool method. This allows notably to delay the
sending of notifications in some cases, then send it once all content is
updated according to business requirements.
When giving a scheduled date in kwargs
* either it is set, and we update message schedulers accordingly;
* either we force a void value, which means notification should be done
now and we trigger the schedulers for immediate sending;
Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#95623
Co-authored-by: Stéphane Debauche <std@odoo.com>
Purpose
=======
Currently, only email sending can be scheduled with the `scheduled_date` field
defined on on <mail.mail>. It's not possible to delay the sending of
notifications.
We want to be able to delay the sending of the emails, but also the inbox
and bus bus notifications.
Technical
=========
For that purpose, we created a new model which stores the message we need to
notify with the scheduled date. When a scheduled_datetime is given we skip the
notification process. Instead an entry in that new model is created. A cron
regularly polls the scheduled message and launch the notification process on
messages that are ready to be sent.
Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#95623
Co-authored-by: Thibault Delavallée <tde@odoo.com>