Commit Graph
145550 Commits
Author SHA1 Message Date
Aaron Bohy 09da30fbcd [REF] board,web: namespace legacy view root classnames
The pivot and graph views have been rewrote in owl in [1]. However,
the former implemention has been kept as it is still used in some
cases (e.g. board application, studio, PieChart widget), but they
are lazy loaded [2].

Before this commit, both the new and former implementations mostly
shared the same DOM (in particular, their root element had the
same classnames). It means that the scss rules of an implementation
might interfer with the other, and vice versa.

This commit adds the "legacy" keyword in the root classnames of
those views, and properly namespaces the scss rules of legacy views
to properly dissociate the style of new and legacy views.

For the pivot view, we re-used the same scss file, so in this
commit, we duplicate it (one for the new view, the other, lazy
loaded, for the legacy view).

[1] 0134495ba5
[2] bd3cf85c841168dfd87f7166b545dd00d9b38bf4

closes odoo/odoo#77323

X-original-commit: 3862d5aae1df72d3585f915e8a2a2626322e74ad
Related: odoo/enterprise#21223
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-09-29 08:32:55 +00:00
Pierre Paridans c0f736c056 [FIX] website: don't show empty burger menu on mobile
When the current app doesn't provide menu-items (or the user doesn't
have the rights to access them), the mobile burger menu should fallback
to the user menu instead of an empty one (like on the App Switcher).

task-2345001

closes odoo/odoo#77322

X-original-commit: 90eecd990c7c97f5914252a9cad28eeb71859e0d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2021-09-29 08:32:51 +00:00
sofiagvaladze 415ab27126 [IMP] hr_holidays: Time Off smartbutton
task - 2634892

closes odoo/odoo#75941

Related: odoo/upgrade#2852
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-29 08:32:44 +00:00
Hubert Van de Walle (huvw) 8b7d840646 [FIX] web: Select the correct record when there is an html table in a line
Steps to follow

  - Add an HTML field in the sales order line view
  - Create a sales order
  - Add a product
  - Add a table with multiple rows in the HTML widget
  - Add a new product
  -> The new product isn't selected

Cause of the issue

  The CSS selector used for finding the record to edit was taking all tr
  element into account

Solution

  Only select direct descendants of the tbody

opw-2632817

closes odoo/odoo#77380

X-original-commit: a8a0f38f5f45f18bc8221bf835d6e54ddabc471d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
2021-09-29 07:12:29 +00:00
Simon Genin (ges) b6be398743 [FIX] web: Allow the graph context option fill_temporal to be set
The option was available before but was forgotten when the graph view
was refactored.

closes odoo/odoo#77330

X-original-commit: 624fd812c5d6b01c0cc11e8620dc703dc0370f73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-29 07:12:24 +00:00
Aaron Bohy dd47708f5f [FIX] web: clickbot: correctly wait for next view
Before this commit, the clickbot test failed when switching from
a dashboard view to a pivot, graph or cohort view, because the
condition to wait before toggling the filters in the next view was
wrong. As a consequence, we started to toggle the filters for the
next view on the dashboard view, so when we actually switched to
that view, the filter menu was closed and the tour was blocked.

The previous condition used the `.o_{view_type}_view` classname,
targetting the root node of the view (which appears in the DOM when
the view is loaded). Unfortunately, since [1] and the new
implementation of the graph and pivot views, we added root
classnames to graph and pivot (o_graph_view and o_pivot_view),
whereas it wasn't the case before. So when leaving a dashboard
view to a graph or pivot view, the former condition was directly
true (if the dashboard contained those views), and we didn't wait
for the next graph or pivot view to be loaded.

Note that the former implementation of the cohort view already added
the "o_cohort_view" classname on its root node, but it didn't make
the clickbot test fail because we don't have cohort views next to
dashboard views in standard actions.

This commit changes the condition to use the view switcher icons
instead.

[1] 0134495ba5

closes odoo/odoo#77324

X-original-commit: bc53eebc8b9cd9f6e949bbe7e91ec2f98e5a0dfc
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-29 07:12:20 +00:00
Xavier Morel 1af688d534 [FIX] core: flushing around HTTP calls
Explicit flushing of the cursor had been implemented in the "legacy"
`url_open` helper, but it was missing when going through `requests`
directly (via the `opener`), or when performing XML-RPC calls.

Fix that:

* extend `requests.Session` and `xmlrpc.client.Transport` so they take
  a cursor
* move the setup of the XML-RPC clients to `setUp` so they can *get*
  the cursor
* move the rest of `HttpCase.__init__` to `setUpClass` and drop the
  override entirely
* remove the now-redundant flush in `url_open` (as it's done by the
  `opener`)

closes odoo/odoo#77359

X-original-commit: c7bdae34690f31960d1fa95b5c3b4052540f5d07
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-09-29 05:48:42 +00:00
Sébastien Theys bdbcf51bf4 [IMP] mail: add ping for active RTC session and clean obsolete
closes odoo/odoo#77382

X-original-commit: 263e77e5d252b61e1dd838c7559e957a20fa2b18
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-29 01:10:51 +00:00
Odoo's Mergebot 8908017621 [FW][MERGE] mail, various: use QWeb in mail templates
RATIONALE

Jinja is used a templating engine in various places, notably in mail templates
and digest content. It is known to have some limitations

  * its syntax is specific and is concurrent with Odoo QWeb template language.
    Additional knowledge is required just for that purpose;
  * it is not XML compliant, meaning we quickly run into issues when editing
    its content as HTML. Notably rendering engine (browsers) may reorder
    jinja content arbitrary when its syntax is not valid, which is often
    the case with advanced constructs involving nested for and if;
  * jinja template do not benefit from improvements done in QWeb and its
    integration in our HTML editor;
  * it is an outside templating engine that we do not control;
  * it adds an external dependency;

PURPOSE

Replace Jinja with Qweb so that we can now build tools to edit a Qweb
template, mainly for ``mail.template`` records. In this merge we now
support QWeb as rendering engine for mail templates. All templates are
updated accordingly. Some other records using jinja are also updated like
``digest`` content (tips).

To be able to edit template content from the backend interface a plugin to
the Odoo editor has been made to seamlessly edit documents. It includes :
  * allow to make dynamic variables (eg. `<t t-out="variable"/>`) not
    editable when required;
  * group and hide related logical branching (ie. t-if, t-elif and t-else)
    in order to see only one at once;
  * a floating select input to switch visibility of a particular logical
    branching;

TEXT RENDERING

Not all content previously rendered using jinja holds HTML content. For
example some email fields (e.g. ``email_from`` or ``subject``) used Jinja
syntax for rendering (e.g. ``Email for ${object.name}`` or
``${object.email_formatted | safe}``).

We want to keep dynamic rendering for those char fields. However as it is
not XML we use a new rendering engine called "inline_template". It is
based on QWeb rendering used to evaluate expression and attributes like
``t-att-href="{{object.link}}"``. Expressions should be enclosed by `{{` and
`}}` to highlight they are dynamic. For most expressions this is equivalent
to jinja expressions with a simple marker change.

LINKS

Task-2497930 (Main editor task)
Task-27033 (Main functional task)

closes odoo/odoo#77377

Forward-port-of: odoo/odoo#77074
Related: odoo/enterprise#21246
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-29 01:42:56 +02:00
Nicolas Bayet e52bde906f [IMP] web_editor: allow qweb edition
Add a plugin for the Odoo editor that includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching
- style t-tags to make them stand out

Task-27033

X-original-commit: odoo/odoo@300da82eb4
Part-of: odoo/odoo#77377
2021-09-28 23:42:55 +00:00
Nicolas Bayet 810f832703 [FIX] web_editor: allow to delete backward a contenteditable
Deleting a node content-editable false did not work.

X-original-commit: odoo/odoo@de42d0f965
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Samuel Degueldre ecf5fbb4a8 [FIX] mail: fix "cannot read 'id' of undefined" in RTC calls
closes odoo/odoo#77371

X-original-commit: e2a2d9f17d7bf3b48ca45c5000547bb82dde3225
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:36 +00:00
Samuel Degueldre 567a09f58a [FIX] mail: fix crashes in methods on PeerConnection in invalid state
closes odoo/odoo#77370

X-original-commit: 5caa7f1aa094813c9f450ad839f1511045e33cca
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:32 +00:00
Thibault Francois 7b1eb7a1c6 [FIX] mail: make possible to search on channel_partner_id
Issue
-----
Adding ('channel_partner_id', 'ilike', name) when searching for
mail.channel.rtc.session does not filter out any record

because the model mail.channel.partner does not define any _rec_name
only the name_get

Solution
-------
Implement a _name_search method consistent with the name_get

closes odoo/odoo#77369

X-original-commit: 6c731a75295bbc8107d08ac3ed5c3d01245c782d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:27 +00:00
Samuel Degueldre 347756909a [FIX] mail: fix crash when trying to catch result of play()
Some browsers don't return a promise from mediaElement.play(), we wrap
it in promise.resolve to solve the issue.

closes odoo/odoo#77368

X-original-commit: 50898870067d05fb01722487dc2d63a1a5155c7d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:23 +00:00
Nicolas Bayet 21e9088839 [FIX] web_editor: save codeview changes
Before this commit, if there were a change in the codeview of the
field html and the record was saved while the codeview was still open,
the changes made in the codeview were not saved.

closes odoo/odoo#77367

X-original-commit: d8a9d23a66d3662fc1c5e4e07e35a1de6800ffa5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-28 21:02:18 +00:00
Rémi a4159afe71 [IMP] survey: display description_done field
It is currently about impossible to edit this field. Having it available
in backend makes sense, allowing to fine-tune its content before publishing
or launching live surveys.

Task-2657694

closes odoo/odoo#77366

X-original-commit: a37842c69b23b136a60ac992770144698e553f2c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-28 19:51:16 +00:00
Raphael ColletandStanislas Sobieski (sts@odoo.com) 31c3f75396 [FIX] expression: avoid ORDER BY clause in subqueries
This fixes a performance issue: ORDER BY clauses in subqueries can make
the query unexpectedly slow.  We should avoid this situation, since
ORM-generated queries have an ORDER BY clause which is not relevant in
the context of a subquery.

The following example was found:

    SELECT "pos_payment"."id" AS "id"
      FROM "pos_payment"
     WHERE ("pos_payment"."pos_order_id" in
              (SELECT "pos_order".id
                 FROM "pos_order"
                WHERE ("pos_order"."company_id" in (1))
             ORDER BY "pos_order"."id"))
       AND "pos_payment".id IN (1285508)

Here are the query plans made by PostgreSQL on this query with and
without the ORDER BY clause.  The query time went from 1240ms to
0.402ms, which is 3000 times faster!

EXPLAIN ANALYZE SELECT "pos_payment"."id" as "id" FROM "pos_payment" WHERE ("pos_payment"."pos_order_id" in (SELECT "pos_order".id FROM "pos_order" WHERE ("pos_order"."company_id" in (1)) ORDER BY  "pos_order"."id"  )) AND "pos_payment".id IN (1285508);
                                                                    QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------
 Merge Semi Join  (cost=2.88..82726.85 rows=1 width=4) (actual time=1239.361..1239.364 rows=1 loops=1)
   Merge Cond: (pos_payment.pos_order_id = pos_order.id)
   ->  Sort  (cost=2.46..2.46 rows=1 width=8) (actual time=0.021..0.022 rows=1 loops=1)
         Sort Key: pos_payment.pos_order_id
         Sort Method: quicksort  Memory: 25kB
         ->  Index Scan using pos_payment_pkey on pos_payment  (cost=0.43..2.45 rows=1 width=8) (actual time=0.014..0.015 rows=1 loops=1)
               Index Cond: (id = 1285508)
   ->  Index Scan using pos_order_pkey on pos_order  (cost=0.43..66770.53 rows=1282120 width=4) (actual time=0.013..1148.194 rows=1182463 loops=1)
         Filter: (company_id = 1)
 Planning time: 0.272 ms
 Execution time: 1239.396 ms
(11 rows)

EXPLAIN ANALYZE SELECT "pos_payment"."id" as "id" FROM "pos_payment" WHERE ("pos_payment"."pos_order_id" in (SELECT "pos_order".id FROM "pos_order" WHERE ("pos_order
"."company_id" in (1)) )) AND "pos_payment".id IN (1285508);
                                                             QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------
 Nested Loop  (cost=0.85..4.89 rows=1 width=4) (actual time=0.047..0.049 rows=1 loops=1)
   ->  Index Scan using pos_payment_pkey on pos_payment  (cost=0.43..2.45 rows=1 width=8) (actual time=0.027..0.028 rows=1 loops=1)
         Index Cond: (id = 1285508)
   ->  Index Scan using pos_order_pkey on pos_order  (cost=0.43..2.45 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=1)
         Index Cond: (id = pos_payment.pos_order_id)
         Filter: (company_id = 1)
 Planning time: 0.322 ms
 Execution time: 0.080 ms
(8 rows)

closes odoo/odoo#77357

X-original-commit: 947c3bd72ee84c3a298e0c9c365340ddf16b307d
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Stanislas Sobieski (sts@odoo.com)
2021-09-28 19:51:05 +00:00
Samuel Degueldre 5ae5c81a23 [FIX] mail: fix settings crashes
In odoo/odoo#76941 some getters were removed but the code using those
getters was not entirely adapted, causing crashes.

This commit also fixes an unrelated crash, where we were attempting to
save the push-to-talk settings for guests, which cannot work as they do
not have a correspoding user.

closes odoo/odoo#77343

X-original-commit: 99a5a59c610ee4d421f5671aa6680377df08168a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 17:45:17 +00:00
Samuel Degueldre e648513376 [FIX] mail: stop showing "Add a description" to guests
closes odoo/odoo#77341

X-original-commit: 38b5e110469b6a3a49e39df3ac0c7b73795aae1f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 17:45:13 +00:00
Samuel Degueldre 3d3f6e6b15 [FIX] mail: fix guest getting session expired warning on mention
When attempting to mention a user or a channel, an RPC is performed.
This uses a method on a model, which guests cannot perform as they don't
have a valid session cookie. This commit deactivates the mention
functionality for guests.

X-original-commit: fe6f2b660a84cfdb74834d52d6ff7860776a2e70
Part-of: odoo/odoo#77341
2021-09-28 17:45:13 +00:00
Odoo's Mergebot 2e18b2a07b [FW][MERGE] project: re-allow recurring sub tasks
Previously, only the direct children of a recurrent tasks were copied
during a recurrence. Also, the child tasks which had a recurrence were
copied with the recurrence_id of the initial subtask, which lead the new
subtask to be linked with the recurrence of the initial subtask.

With this PR we copy the children until the 3rd layer. Also,
we hard copy the recurrence of the initial subtask and link this new
recurrence with the new subtask, to make it decoupled from the initial
subtask recurrence. Furthermore, if several initial subtasks has been
created with a same recurrence, only the first subtask is copied.

PR: #77126

task-2522076

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#77198

Forward-port-of: odoo/odoo#77126
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-28 18:27:20 +02:00
Odoo's Mergebot 902ae2e519 [MERGE] crm, crm_iap_enrich, various: improve IAP enrich
PURPOSE

Cleanup automatic enrichment of leads.

SPECIFICATIONS

Right now, when we choose to automatically enrich the leads from CRM
settings, it activates a cron to periodically enrich the leads using
IAP service.

This commit improves the behavior by enriching the leads after the
records creation using cron trigger. That way it is done nearly after
creation and user gets enrich information sooner.

To make it clear to users, the description for 'auto' mode is improved to
'Enrich all leads on creation'.

Also, now we select 'auto' mode by default instead of 'manual', and
display 'Enrich' button on form view irrespective of the selected mode
(if lead meets certain conditions) unlike before. Rest of the behavior
is still same as before. For example, we still have server action which
can enrich the selected leads in batch, which is useful if there are
existing leads before we enable 'Lead Enrichment' feature.

SIDE SPECIFICATIONS

Improve lead / opportunity marketing information display on form view.

Send html toast notifications when running out of IAP credits for enrich.

Fix some corner cases for lead enrich (involving probability, email).

LINKS

Task-2269743

closes odoo/odoo#60605

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-28 18:27:18 +02:00
Nikunj Ladava 25125eb243 [IMP] crm_iap_enrich: send a toast notification for IAP credit shortage
Before this commit, it was posting a message in chatter if user did not have
credit enough to enrich a lead. This is mainly noise and not really user
friendly.

After this commit, it will show the toast notification for user message

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:16 +00:00
Nikunj Ladava 025c022c03 [FIX] mail: support html message notification
Notification service is supporting html message in it, but in simple
notification it is not triggering the html notifications. So here we add
html message support in simple notification to show the html content in it
when requested.

Before this commit: it was showinng simple text of html

After this commit: it will show the html content in notification

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:16 +00:00
Nikunj Ladava 5277316729 [IMP] {crm}_iap_enrich: enrich leads on creation for auto mode
Right now, when we choose to automatically enrich the leads from CRM
settings, it activates a cron to periodically enrich the leads using
IAP service.

This commit improves the behavior by enriching the leads after the
records creation using cron trigger. That way it is done nearly after
creation and user gets enrich information sooner.

To make it clear to users, the description for 'auto' mode is improved to
'Enrich all leads on creation'.

Also, now we select 'auto' mode by default instead of 'manual', and
display 'Enrich' button on form view irrespective of the selected mode
(if lead meets certain conditions) unlike before. Rest of the behavior
is still same as before. For example, we still have server action which
can enrich the selected leads in batch, which is useful if there are
existing leads before we enable 'Lead Enrichment' feature.

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:16 +00:00
Nikunj Ladava 0369020099 [FIX] crm_iap_enrich: skip leads without email
No need to log a message telling there is an issue with lead email when
email is void. Simply skip its enrich.

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:15 +00:00
Nikunj Ladava 82dd868859 [FIX] crm_iap_enrich: also enrich leads without PLS probability
Current domain to enrich leads exclude those whose probability is 100 (aka
won leads) with a leaf ('probability', '<', 100) . However this also excludes
leads with probability being NULL, meaning we have to update the domain to
be sure to include all not-won leads.

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:15 +00:00
Priyanka Kakadiya 38625a33a5 [IMP] crm: clean lead form view about Marketing information
This commit makes Lead and Opportunity form view cleaner with below
changes :

 * in Lead form view, renamed 'Tracking' group to 'Marketing'
 * in Opportunity form view, renamed 'Misc' group to 'Tracking'
   and moved 'Referred By' field to 'Marketing' group

Purpose is to better highlight important marketing information and better
label sections.

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:15 +00:00
Thibault Libioulle 987023f3b5 [FIX] project: fix recurrence for child tasks
Previously, only the direct children of a recurrent tasks were copied
during a recurrence. Also, the child tasks which had a recurrence were
copied with the recurrence_id of the initial subtask, which lead the new
subtask to be linked with the recurrence of the initial subtask.

With this commit we copy the children until the 3rd layer. Also,
we hard copy the recurrence of the initial subtask and link this new
recurrence with the new subtask, to make it decoupled from the initial
subtask recurrence. Furthermore, if several initial subtasks has been
created with a same recurrence, only the first subtask is copied.

PR: #77126

task-2522076

X-original-commit: 808a965b4171a386f3987071c19cc27783ba0119
2021-09-28 15:40:16 +02:00
William Henrotin 3e4d3fafcc [FIX] purchase: open orderpoint same date than confirmation
Testing orderpoint generation assumes the whole test is done the same
day. The assert could failed if the test is run right before midnight
and end the day after.

This commit ensure the time is frozen during all the tests about
orderpoints generation

closes odoo/odoo#77307

X-original-commit: 079435eb8386554c475cd82d1f6fbb611bba0339
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-28 10:53:33 +00:00
Aaron Bohy 4efa1b209c [FIX] web_tour: display rainbowman at end of tours
Since commit [1], it crashed when, at the end of a tour, we tried
to display a rainbow man, because we forgot to update the "type"
key.

74dc3f654ee5849982b494e46eefb1fc2b4e0c74

closes odoo/odoo#77306

X-original-commit: 6fa92d38e1945414f45411fc2e2528a8ef6f9fd1
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-28 10:53:29 +00:00
Olivier Dony 79bb85364a [FIX] website_event_exhibitor: avoid useless image processing
The `image_256` field is computed (not stored) based on a dynamic resize
of the stored `image_512`. When testing for the existence of an image
value, the stored field should be used, to avoid processing the image
and resizing it, then discarding the value immediately.

closes odoo/odoo#77303

X-original-commit: 416647da28876ffd159c54df8ae986854c2cb8ca
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-28 10:53:24 +00:00
Romain Derie 09d1f69e9c [FIX] website: prevent always showing debug icon in frontend
Commit [1] migrated the old debug manager to the new OWL one.
But is was missing a check, to actually ensure we are in debug mode before
showing the icon.
Without this fix, the debug icon is always shown, even if not in debug mode.

[1]: https://github.com/odoo/odoo/commit/ce5599926af8cf2d69d3abbff0cb212b4af04473

closes odoo/odoo#77292

X-original-commit: dc689838a6514fcbe0c233297123f46b23199ddc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-09-28 10:53:20 +00:00
Chong Wang (cwg) fd85e792ea [IMP] sms: slightly improve sms.sms list view
PURPOSE
We need this commit to provide a better visualization of the status of the SMS
and allow users to retry, send or cancel an SMS from the list view for a better UX

SPECS
sms.sms listview:
* reset 'failure_type' to False when its sms is resent
* 'sms status' column is moved to the right of the 'error code' column
* colors on the whole lines are removed
* the badge widget is used for the 'sms status' column
* new color for badges
    'in queue': blue
    'sent': green
    'error': red
    'canceled': gray
* new buttons are added to directly retry, send or cancel an SMS from the list view
    'fa-paper-plane send now' button
        only visible if the status is 'in queue'
        clicking on this button should effectively send the SMS
    'fa-times-circle cancel' button
        only visible if the status is 'in queue' or 'error'
        clicking on this button should switch the sms to the 'canceled' state
    'fa-repeat retry' button
        only visible if the status is 'error' or 'canceled'
        clicking on this button should switch the sms to the 'in queue' state

LINKS
task-2535005

closes odoo/odoo#74354

Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-09-28 10:53:15 +00:00
JF Aubert 8b5392f8e6 [FIX] sale_stock_margin: fix test_so_and_multicurrency failing around midnight
Due to res currency date in user timezone and sale order date in utc.

closes odoo/odoo#77283

X-original-commit: 34ce921ee1792dbe498fdab96808f76a5c336323
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-09-28 09:29:22 +00:00
Krunal Trivediandqsm-odoo b03b762ad0 [FIX] website: disable scrolling effects for sidebar headers
- Edit the website
- Select the header and set the scrolling effect to fixed
- Set header template as 'sidebar'
- Save
- Scroll -> The website does not properly scroll.

This is now fixed.

closes odoo/odoo#77277

X-original-commit: f253a09214af2f4393031e0610d76f91ea63f833
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-28 09:29:18 +00:00
Swapnesh Shah 81d26dcee6 [FIX] account: disable aml creation from kanban
Steps:
- Go to Journal Items
- Switch to Kanban View
- Click on create

Issue:
- Traeback due to unknow currency

Fix:
Journal Items are not created individually so we have disabled
`Create` button in Kanban view.

closes odoo/odoo#77262

Fixes: odoo#76543
X-original-commit: fa29cd974a9d024349e937b547abe5a6ca522c6d
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-09-28 09:29:14 +00:00
Sébastien Mottet (oms) 433f6c2758 [FIX] website, web_editor: prevent mega menu removal
The user was able to remove the mega menu snippet without removing
the corresponding link in the menu. To avoid this flow to happen
we removed the delete button for the mega menu snippet. We also
handle the case where the user remove the mega menu snippet element
by element. On last element removal we put back the original template.

task-2636545

closes odoo/odoo#77256

X-original-commit: 97810a9c40396bb27cb5779937734849d185cf1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-28 09:29:09 +00:00
qsm-odoo 9d8803f6ba [IMP] web_editor: allow onRemove to be async
Now, a snippet option can do async operations in its onRemove
implementation.

task-2636545

X-original-commit: ef2e55d7f407dedfbf724f2cae32a0fcaede6890
Part-of: odoo/odoo#77256
2021-09-28 09:29:09 +00:00
e91beddac0 [IMP] website: add ability to conditionally show form fields
Allow the user to create forms whose fields can have a conditional
visibility, meaning that the field is only visible if another field in
the form meets certain conditions.

The previous hidden checkbox is replaced by a select with 3 options
(visible, hidden, visible only if).

task-2431285

closes odoo/odoo#77255

X-original-commit: 2dcbfecf3c10687a2cd3af36335d5be70c904fce
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Arthur Detroux (ard) <ard@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-28 09:29:03 +00:00
qsm-odoo 48092fcf85 [IMP] web_editor, *: add a generic class for large editor widgets
*: website, website_payment, website_sale

Instead of having a "o_we_large_input" class, now to have large widget, we can
use the generic "o_we_large" class (a future update is needing that for a non-
input widget).

task-2431285

X-original-commit: a8446e5d0f0b10f99f8174c012a6a53e2134b77a
Part-of: odoo/odoo#77255
2021-09-28 09:29:02 +00:00
qsm-odoo 5b6fc08304 [FIX] website: disable animation possibility on some columns
The possibility to animate colummns instead of main snippets was
recently added. It should however have targeted mains columns that the
user can manipulate and resize instead of structural columns used in
some snippets (form, team, ...).

X-original-commit: 3dc2255819b87fa1094bfe07dcd1e2365becd757
Part-of: odoo/odoo#77255
2021-09-28 09:29:02 +00:00
Mitali Patel 564504ef13 [FIX] project: fix project updates colors in kanban list
Purpose of this commit is to update the kanban card color
same as the state color of project update

closes odoo/odoo#77179

Taskid: 2638993
X-original-commit: 67fec40ab38999f0926297b57eb09d3cc44ebec8
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-28 09:28:54 +00:00
Jacky (trj) 442f856bb8 [IMP] point_of_sale: opening cash control and closing session in POS UI
The opening cash control has been refactored and the closing of the session is now happening in the POS UI. This also leads to a cash control in the UI during the closing.

The advanced cash control is no longer a setting to activate in the config by the user but a computed field based on the presence of a cash payment method. We force the user to always have it now.

The opening cash control has been revamped with the addition of a new money calculator (`MoneyDetails`) allowing the user to easily compute how much money does he have based on his bills.

The closing control has been converted into a popup which allows the users to get an overview of his session details (about orders, payments, payment methods, cash moves, ...). If the `cash_control` has been set to `True`, the user still needs to count his money by introducing it or using the new calculator.

When trying to close the session, if it fails, depending on the error the user get, he can be redirected to the back end to manually close the session. At this point, the user is not able to open the POS UI.
(In order to fully bring the closing of the session in the front end, all the error handlings need to be brought to the front end as well which takes a lot more time.)

Rescue session can only be closed through the back end and the closing cash control is automatically being computed without the user's involvement. This avoid any cash profit/loss in the journals.

The session chatter is being logged with all the details regarding the opening and closing. This give the user a better view of his cash flow in a specific session.

task-2456424

closes odoo/odoo#73464

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-09-28 09:28:50 +00:00
Florent de Labarre fbf5217cb7 [FIX] stock: picking is merge if transit in other addresse
- create Tree warehouses, WH1, WH2, WH3, with three different address
- add route 2-1 to resupply WH2 from WH1, complete partner_address_id on rule with partner_id of WH2
- add route 3-1 to resupply WH3 from WH1, complete partner_address_id on rule with partner_id of WH3
- create a product
- add orderpoint, WH2/Stock with route 2-1 and min_quantity to 1
- add orderpoint, WH3/Stock with route 3-1 and min_quantity to 1

Lauch scheduler.
Issue:
You have 1 out picking of WH1, with qty = 2. It doesn't make sens because WH2 and WH3 have not the same address.

With this PR, 2 out picking are created.

closes odoo/odoo#77151

X-original-commit: 26833a045e48a88bbc41857110f310acd4fa5335
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-28 08:07:46 +00:00
Dharmraj Jhala a8d23ac374 [IMP] website_crm_partner_assign: fix multi datepickers on portal
When a portal user is editing opportunity from front-end, there are
two date inputs, 'Expected Cloing' and 'Next Activity Date'. But both
of them have two pickers for selecting date, a native one and a
bootstrap one, which was probably side effect of commit[1].

With this commit, we only keep the bootstrap picker so that it
respects the date format based on language, and for the check,
to make sure it doesnt break the backend (see ticket from commit[1]
for more details), we simply consider the date with year less than
1900 as invalid.

We also provide a bit more space for bootstrap datpicker to open while
setting the closing date, so that the scrollbar is not introduced on
the modal. And for the next activity date, we make sure that the
picker is opened always on top of the input (which is not the case
currenlty in some screensizes, sometimes it is opened below the input
so it is hidden under the extra scroll introduced with picker).

commit[1] - https://github.com/odoo/odoo/commit/b2b639b693dd7215e3ee501ac89c35f3a6b88bb5

TaskID-2624728

closes odoo/odoo#77289

X-original-commit: da7cac9b1293a0b8d5375e1b4a470f41fe76e8a4
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-09-28 06:48:45 +00:00
Lucas Perais (lpe) 7e8cf3d458 [FIX] web: legacy: no memory leak via owl.qweb
Root components register a listener on env.qweb's "update" event (component.ts:constructor).

This means that every legacy ComponentWrapper does this and it proved to cause memory leaks.

This fix is two fold:
- the owlCompatibility code unregisters the handler on destroy, so that the production run is not impacted by the leak.
- the legacy test infrastructure also forces the unregistration. This is necessary because even though components are destroyed, the qweb singleton in legacy tests holds on to destroyed components' reference.

closes odoo/odoo#77285

X-original-commit: 89034cf597a418bfd35fdd71324415cdbf046a16
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-28 06:48:40 +00:00
Lucas Perais (lpe) 56a35fc294 [FIX] mail: hooks: correctly remove handler
Element.removeEventListener takes the same instance of the handler function
added with addEventListener. Giving it another function (either via a bind or an arrow)
wouldn't have any effect, leaving the handler actually in place.

This commit corrects some code in that direction.

X-original-commit: 82d710ee24ee01dad8fcf6a460fc064a498b5b02
Part-of: odoo/odoo#77285
2021-09-28 06:48:40 +00:00