Commit Graph
157697 Commits
Author SHA1 Message Date
Hubert Van de Walle (huvw) 38fbdec503 [FIX] web: restore drag&drop in Firefox
Steps to reproduce
==================

- Go to a kanban view
- Drag a card by the title to another column
-> The record is opened instead of being moved

Cause of the issue
==================

The `.o_kanban_record_headings` elements have a `overflow: hidden` rule
There is a bug [0][1] in firefox from 17 years ago were the
mouse{enter,leave} events are not fired in that case.

Solution
========

The previous attempt [2] to fix the issue is not working (anymore ?)

Thanks to a comment in the issue, we know that we can call
`.preventDefault` on the mousedown event.

[0]: https://bugzilla.mozilla.org/show_bug.cgi?id=339293
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1352061
[2]: https://github.com/odoo/odoo/pull/104128

opw-3120973
opw-3121312

closes odoo/odoo#110282

X-original-commit: 713026806fa712afd85cb2530006f0f880dfa240
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-01-18 17:38:31 +01:00
Aaron Bohy 25d1209cf0 [FIX] web: pager: race condition when paging and fetching count
Have a list or kanban view with 10k+ records (or manually change
`WEB_SEARCH_READ_COUNT_LIMIT` in the code). On a slow network,
click on the pager to go to the next page and click on `10OOO+` to
fetch the total number of records.

Before this commit, this might lead to a race condition where the
total number of records displayed in the pager is incorrect (if the
search_count returned before the web_search_read).

This commit fixes the issue at the pager level. We already disabled
it when clicking on next/previous or editing it. However, this
didn't prevent from fetching the count. Moreover, fetching the
count didn't disable the other features either. With this commit,
the pager is fully disabled when the user interacted with it, until
the view is reloaded.

closes odoo/odoo#110265

X-original-commit: 0ac84bda8de0c1a620d05469562932c0d04e8c3f
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 17:38:29 +01:00
Nicolas Bayet d51e62c6ae [FIX] web_editor: prevent nbsp convesion in html_sanitize
The fix #14569 was not complete. This fix solve the issue explained in
that PR.

The lxml cleaner transform any utf8 character `U+00A0` to a string
`&nbsp;`. This cause a comparison in the editor to be erroneous
inside `HtmlFieldWysiwygAdapterComponent.updateWidget` when comparing
a value coming from the server with the value coming from the editor.

task-3138358

closes odoo/odoo#110264

X-original-commit: 05e0f65c4120ec7e1420dacab8dc678b8a30f70a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-18 17:38:26 +01:00
Michael (mcm) 28df053a51 [FIX] web: don't add hotkey if readonly statusbar
Before this commit, the statusbar added a hotkey even if
it was readonly or non clickable.
Because of this, the user could change the status with a hotkey.

Now, if the statusbar is readonly or non clickable then
the hotkey won't be available.

closes odoo/odoo#110262

X-original-commit: 9569b4f463b6e82df3c8eafb8bd4329faac871b1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-18 17:38:23 +01:00
Jorge Pinna Puissant 67c3a3ad9c [FIX] web: correctly center the no content helper in settings
Before this commit, the no content helper was not centered in the
settings view.

After this commit, the no content helper is centered in the settings

closes odoo/odoo#110261

X-original-commit: 7abf27a71d72dcece05a45345a81ce1dbece817e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-18 17:38:20 +01:00
aliya efed212889 [FIX] account: fix name split
Currently, if someone tries to create an account with an account name that contains a number in the first word, it overwrites the account code if it's provided.

For example:
code: 123456
name: CO2-bijdragen

Would end up as:
code: CO2-bijdragen
name:

With this commit the account code won't be overwritten.
Also, tests are added to test different account creation scenarios.

closes odoo/odoo#110217

X-original-commit: d2342d81c305753ea1dd7dbaf43ff0c11df6ec4c
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-01-18 17:38:14 +01:00
std-odoo 3140afff79 [FIX] web: fix the properties field in dark mode
Purpose
=======
Fix the properties types image that should be light and not dark
in dark mode. Fix the background color of the selection options.

Change the background image used for property types to a real image tag,
so we can apply a CSS filter on it for the dark mode (instead of
duplicating all images).

Task-3117416
See odoo/enterprise/pull/35408

closes odoo/odoo#110203

X-original-commit: 4982735c5a28b6f4a2d870eb679f9b8f2bfdb5d4
Related: odoo/enterprise#35941
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-18 17:38:09 +01:00
det c95011ce6d [IMP] account_edi_ubl_cii: l10n_fr requires delivery address if present
Update the logic so that if there is a delivery address present
we add it in EDI.

This is the behavior of ubl2 which was erased in ubl3 overwrite.

task-id: 3098587
[community](https://github.com/odoo/odoo/pull/110118)

closes odoo/odoo#110118

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-01-18 17:38:01 +01:00
gawa-odoo 36d7d4b956 [IMP] l10n_pl: translation and clean tax tag name
Translated in English and added .po for Polish translation.
Cleaned tax names to make them more in line with new taxonomy.
Tax tag names have been changed to avoid long sentences as names.

closes odoo/odoo#109611

Related: odoo/enterprise#35651
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-18 17:37:44 +01:00
Aaron Bohy d0101c104a [FIX] mail,web: keep changes when changing followers/activities
Before this commit, all pending changes in a form view were lost
when the user added/removed/edited followers or created/edited
activities. In these cases, we want to reload the record, but we
also want to keep local changes. This commit restores the behavior
of previous versions.

Task 3132939

closes odoo/odoo#110246

X-original-commit: f3697e71c2d14e66509ab04bdccf3ef656cd9c8f
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 16:19:34 +01:00
Aaron Bohy 5dcd1db351 [FIX] web: list: correctly evaluate dynamic expand attribute
The `expand` attribute in list views can be dynamic (e.g.
`context.get("some_val_from_ctx", False)`). Before this commit, it
wasn't evaluated, so a dynamic value would always result as true,
as it isn't "O", "false" or "False". To instance, go to Invoices
and add a group by. This commit fixes that issue.

Task 3130159

closes odoo/odoo#110235

X-original-commit: 1072c4880fdd2835b0711869da06681dab20d33c
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 16:19:28 +01:00
Jorge Pinna PuissantandAaron Bohy f56a2b4129 [FIX] web: keep filter when leaving a kanban view and coming back
- Open a kanban view;
- Select a progress bar filter;
- Open a record;
- Came back to kanban using the breadcrumb.

Before this commit, the progress bar is selected, but the records aren't
filtered.

Now, the kanban is exactly the same as it was when we click on the
record, the progress bar is selected and the records filtered.

closes odoo/odoo#110224

X-original-commit: ca864d7e6d510ef6410898099364d854a15150d7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2023-01-18 16:19:25 +01:00
Walid HANNICHE (waha) 7f3a4fbb2d [FIX] board: dashboard darkmode
Steps to reproduce:
- add elements to dashboard
- enter dashboard and enable darkmode

Bug:
titles are unreadable because background is white

Fix:
remove CSS property

closes odoo/odoo#110201

X-original-commit: 5b56f1891d618008678d70ad125ad1393abe352b
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-01-18 13:25:51 +01:00
Benjamin Vray 70cafe7cca [FIX] web_editor: fix classes removed from selected links
Steps to reproduce the bug :
    - In website (edit mode), add a mega menu in the Header.
    - Choose the "Cards" template for the mega menu.
    - Click on a card of the mega menu.
    - Change the url of link in the editor panel toolbar.
    - The style of the card is broken.

The issue is that when the link of the card is changed, 2 classes are
removed from the link ('text-wrap' and 'text-center').

This is from code that removes all classes starting with "text-" and
"btn-" when updating the link in the DOM. This commit fixes that by
avoiding removing classes that should never be removed there.

Note that a previous commit ([1]) had already corrected this but only
for the "btn-block" class. This commit fixes the issue in a more generic
way.

[1]: https://github.com/odoo/odoo/commit/888687b487e95b4bf4fb080118b5eb945c8ab724

opw-2954714
task-3006845

closes odoo/odoo#110186

X-original-commit: 121af26cfee8a227ce5925d3a64a99c5bb63d35f
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-01-18 13:25:46 +01:00
Géry Debongnie 3a5060c691 [REM] mail: remove remaining form renderer override
The mail code had to override both new and old form views to add the
chatter feature.  Since we converted (almost) all uses of the legacy
form view to the new owl views, the old override is no longer necessary.

This commit removes it, and also removes the 'legacy_form' entry in the
registry so all screens should fall back to the new form view, which is
stable.

closes odoo/odoo#110168

Related: odoo/enterprise#35924
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 13:25:43 +01:00
Florian Damhaut 85fe1bc491 [FIX] calendar: fix no last call traceback
If there was an issue an the lastcall value for the calendar cron
the cron would raise an error. This commit give a default value to
the lastcall equal to one week ago.

task-id : 3102295

closes odoo/odoo#110154

X-original-commit: e0aa273104ce576cd2746340f0e2c5c4af4a86bd
Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-01-18 13:25:38 +01:00
Martin Maes 5d69c69c57 [FIX] mrp: Workorder timer not updating on user input
This PR addresses a bug where the user tries to update the real duration of a work order in the list view.
The timer was updated in the backend (so the update was showing when refreshing the page) but not in the front
The problem was the following : the state was never updated in the widget

closes odoo/odoo#110132

X-original-commit: 42bb1ac5195b614de4de674c47864abab79a5082
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-18 13:25:35 +01:00
Andrea Grazioso (agr-odoo) be2cc1b18a [FIX] l10n_din5008_*: add missing translations
Set report layout to DIN5008
Activate French language
Have a customer C with language set to French
Create a sale order to C
Print quotation

Some terms in the resulting document are left in english

As this layout is specific to some localizations (Germany, Switzerland &
Austria) we have the translation for the languages of these countries.
(German, French and Italian).

opw-3103361
opw-3089274

closes odoo/odoo#110120

X-original-commit: 85389ca353c6dcc0b639299628c7c24f08c3e26e
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-01-18 13:25:32 +01:00
Jorge Pinna Puissant 65244f2122 [FIX] web: settings_form_view - resIds should contains only one id
- Install two languages;
- Install Accounting;
- Active 'Default Terms & Conditions';
- Select 'Add a Note';
- Click on the translate button;
- Answer 'Ok' when asking for saving the settings before modify the
    translation;
- Save or Discard the translations;
- Save the settings.

Before this commit, a backtrace is raised. This issue raise because we
create twice the settings record. One before opening the translation and
the second time juste before saving the settings. This is a normal
behaviour in settings, as we consider the settings view as always new, a
new record is always created. But, only the last one should be sent to
the python code on the resId array.

opw-3109677

closes odoo/odoo#109803

X-original-commit: 5394f4c82829f8c7e6aaf73ddb1590f316f87ee3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-01-18 13:25:27 +01:00
rhe-odoo a7d9d63c46 [FIX] point_of_sale: price list test
This commit fix the test when different localisation are used to make sure that the public pricelist is used.
Before, when pos_pricelist test was done and some localisation were installed, it could lead to test failure because the default pricelist wasn't correct on the partners.

closes odoo/odoo#109698

X-original-commit: 53e942fd84549a04af2f9257ec3e80633b4f59ea
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-18 13:25:24 +01:00
Michael (mcm) 153f143003 [FIX] web: fix dragged list view row size
Before this commit, the size of the dragged row was shrunk during
the drag and drop. Now, columns have correct width and the layout
is preserved.

closes odoo/odoo#110193

Task: 2731998
X-original-commit: 27d17c3a9ea241d05b2ffc468094117012bc0a27
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 12:13:18 +01:00
Pierre Rousseau 040410e5cc [FIX] spreadsheet: correctly migrate date offset field matching
Steps to reproduce:
- Edit CRM -> Leads dashboard
- Edit filter "Period"
=> There is no period offset for the pivot 2, 4 and 6, despite the
   fact that these pivots have a period offset defined in the json
   data

This is because the field matching migration was not correct. It did
not take "offset" field into account.

Task-id 3138590

closes odoo/odoo#110221

X-original-commit: 2217c10ba771ece4a4d0d0485ce2f24b13754244
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-18 10:16:20 +01:00
Odoo's Mergebot fa4dabd9a7 [FW][FIX] web: update owl from 2.0.2 to 2.0.3
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.3

- fix: compiler: correctly escape backslashes when emitting block string
- fix: reactivity: don't subscribe to keys when making reactive
- fix: t-call-context: fix capture making component available in ctx
- fix: t-call-context: make `this` unavailable in rendering context

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

closes odoo/odoo#110196

Forward-port-of: odoo/odoo#109976
Forward-port-of: odoo/odoo#109788
Related: odoo/enterprise#35939
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 10:16:13 +01:00
Aaron Bohy 942fcbfb3a [FIX] *: views: add component instance to rendering context
Owl last update fixes the leaking `this` in rendering context of
templates called with `t-call-context` [1]. Since [2], we use the
`t-call-context` directive to control the rendering context of
templates compiled from an arch (e.g. in form and kanban views).
We can now better control what people use in archs, where we don't
want them to access js implementation details, as `this` is no
longer available.

However, the component instance still needs to be accessible in
the compiled template. We thus add the `__comp__` key in the
rendering context. Since we do not want people to access it in
archs, we add a check in the view validation that this string
isn't used in dynamic attributes.

[1] https://github.com/odoo/owl/commit/df59ec49aefce2e0913fdc1792d42b9680fb28b6
[2] https://github.com/odoo/odoo/commit/4c5b867ff6b0b674cb83d1a1262ae354ebaa6d57

X-original-commit: 264f313012aa99449d1576ae1110252c13755142
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Aaron Bohy 020ef1a694 [FIX] web: update owl from 2.0.2 to 2.0.3
Release notes: https://github.com/odoo/owl/releases/tag/v2.0.3

- fix: compiler: correctly escape backslashes when emitting block string
- fix: reactivity: don't subscribe to keys when making reactive
- fix: t-call-context: fix capture making component available in ctx
- fix: t-call-context: make `this` unavailable in rendering context

X-original-commit: 90e913172053bdecc89aceced8c490eba2490013
Part-of: odoo/odoo#110196
2023-01-18 10:16:12 +01:00
Michael (mcm) 07f121faff [FIX] web: confirm to leave settings
Before this commit, the confirmation dialog was opened
only when the user clicked on an action button.
Now, the dialog is also shown when the user clicks a
menu item in the navbar.
Of course this dialog is shown only if the user has
changed a setting.

closes odoo/odoo#110194

Task: 3102800
X-original-commit: a180178bfd73d6e5f95ee5a9e9cdc1b0d64fc574
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-18 10:16:08 +01:00
Thomas Lefebvre (thle) 3b5c46d327 [FIX] website_sale: get fiscal position public user
Steps to reproduce:
- website settings, set "Display Product Prices" to "Tax Included";
- apply a tax A to a product;
- with Accounting app, create a fiscal position
which maps tax A to tax B;
- realize the ecommerce flow with a public user.

Issue:
We notice that the `/shop/product` page
does not have the correct fiscal position.

Cause:
We use the geoip in `/shop` but not in `/shop/product`.

opw-3078766

closes odoo/odoo#110197

X-original-commit: cb850a4ef8352a358b1c7d73a67e4e25ba0b4e38
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-18 07:54:16 +01:00
Rémi Rahir e10d00acfd [FIX] spreadsheet: do not evaluate domain for date filters without a field
We were trying to evaluate the domain of a date filter when no chain was
provided in the field matching instead of returning an undefined domain
like for the other types of filters.

Task 3114332

closes odoo/odoo#110131

X-original-commit: 6eddb4b684d5c233b650f86fd8b26dcb8af4ca2d
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-18 06:55:51 +01:00
Daniel Kosky (dako) d6dc5d0fbb [FIX] l10n_ke_edi_tremol: currency rate zero division error
When posting an invoice to the fiscal device, the currency rate is
calculated from an invoice line by dividing its balance by the lines
subtotal. This is because the balance in the database will be in
KES (Kenyan shillings), whereas the currency on the line can differ.

From v16.0 onwards the way that a line is retrieved in order to
calculate the currency rate incorrect. When (for example) an invoice has
'Section' lines, then a division by zero is attempted (resulting in a
zero division error).

This commit amends the line so that the first line of the previously
assigned 'lines' variable is used instead. This variable contains only
valid invoice lines (non-zero, non-display type etc). It is already done
this way from v15.0 onwards (up to v16.0).

closes odoo/odoo#110210

X-original-commit: 4e0374fd095ea5e65e8ce311d133fca066e3ee6a
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-18 01:01:45 +01:00
Walid HANNICHE (waha) a7f08f0b4c [FIX] purchase_stock: product price accuracy higher than currency accuracy
Steps to reproduce:
. Change the decimal accuracy of the product price to 6
. Create a storable product and set the Vendor Tax
. Create a purchase order with that item.
. Set the unit price to have 6 decimal places. E.g: 9.406250
. Change the demand quantities to 10
. Confirm the purchase order.
. Edit the purchase order and change the demand quantities to 7 (<10)
. When you save, a new return order will be created

Bug:
Merging the two stock moves fail because the unit price is different
and the unit price is different because in the case of taxes we recompute
the unit price from untaxed amount which is rounded using the currency price_precision

Fix:
removed the unit_price from the keys used in matching which require an
exact equality and added a comparaison on the lowest precision

opw-3011342

closes odoo/odoo#110206

X-original-commit: f9ee1a22eb94e7ffcefd0023fc89150f8de73006
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-01-18 00:02:00 +01:00
Yolann Sabaux 45dd909fae [FIX] sale: analytic plan with applicability on invoice
Steps to reproduce
* Create an analytic plan with the domain as `invoice`
* Create an analytic account for the above plan
* Create an analytic distribution model and include condition as account prefix (4000), and product.
* Create a sale order, confirm and create an invoice

 Issue
During the conversion from the Sale Order to the Invoice, the
analytic plan is not applied

 Cause
The analytic distribution is set even where there is none. Therefore,
the compute is not trigger

opw-3109003

closes odoo/odoo#110202

X-original-commit: fd5249ea8687f24e7c9c2a2a3bcbb8cc14333efd
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-17 21:54:46 +01:00
Tiffany Chang (tic) 9d7236334a [FIX] mrp_subcontracting: relax subcontractor location requirement
Previously in https://github.com/odoo/odoo/pull/88644/commits/a57be884ee625ab2d67b65f0ece0b8e9b1620369
we restricted the subcontractor locations (property_stock_subcontractor)
to locations with the new setting `is_subcontracting_location=True`. The
purpose of this new setting is primilarily to support the
mrp_subcontracting dropshipping use case though, therefore we want to
keep the previous freedom of allowing users to choose any location as a
subcontracting_location. There are some routing and filtering
errors/confusion that can occur if a user selects a location that isn't
marked as `is_subcontracting_location` (or sets this value to false
after already assigning it to a subcontractor), but since this has not
been reported as an issue in the past, we expect users to properly
configure these fields accordingly.

Part of general bugfix task: 2985735

closes odoo/odoo#110200

X-original-commit: d86df2b9cef742b6cadd294f57a855634768d039
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-01-17 21:54:43 +01:00
Laurent Smet 3d2461c7c8 [FIX] account: Retrieve st. line amounts from accounting entries
After the creation of a statement line, all involved amounts/currencies are available on the accounting entries.
After that, we don't need to perform any further conversion rate that could lead to inconsistencies since the currency rates could be updated multiple times a day.

This commit adds a new helper to retrieve such amounts from the accounting entries.

This method is only used from the enterprise edition.

closes odoo/odoo#110195

X-original-commit: f214fc319db12d69ee71e25336ef7b21aa9c2e3b
Related: odoo/enterprise#35938
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-17 20:59:38 +01:00
Ricardo Gomes Rodrigues (rigr) 1ff71cb9be [FIX] account: non-null quick_edit_total_amount on a journal entry
For some unsure reason, a client had a non-null quick_edit_total_amount on a journal entry which resulted in a traceback.

The traceback appears because tax_totals is not defined for journal entries. However, the code should not have reached this statement. The first conditional statement of the method is not sufficient in such cases where the quick_edit_total_amount is not null, therefore we add another stronger condition on the quick_edit_mode too.

The only possible way I could reproduce this was by using Studio:
- Activate the Quick edit mode in Accounting
- Studio
- In the journal entry form view
- Remove the invisibility and readonly conditions of quick_edit_amount_total
- Fill in this quick amount
- Traceback

Ticket 3128200

closes odoo/odoo#110183

X-original-commit: 56e0a1e8fa5121408b0744531b5c5e5765c727aa
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-01-17 20:59:33 +01:00
Kevin Baptiste 4583afc4ec [REV] hr_recruitment: revert applicant changes update related partner
This reverts commit 15865cffb5 introduced
in odoo/odoo#93840.

This change was causing issues with applications received from job
boards (like LinkedIn), the same partner is assigned to the applicants
and changing the email address of one of those applicant was repercuted
on the partner and thus all the applicants.

closes odoo/odoo#110171

X-original-commit: 72c62dbf157dfb353caf13a228921e3f81036885
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-17 20:59:30 +01:00
Arthur Detroux (ard) 225ef16203 [FIX] web_editor: dispose of the tooltip when closing the bg-overlay
Since the migration to Bootstrap 5 (at [1]), the tooltip for the
background position overlay was no longer disposed when toggling the
overlay back on.
This meant that new tooltips kept being added and could lead to a very
confusing user interface.

This was fixed for legacy widgets at [2] but the tooltip for the overlay
is a specific case.

This commit makes disabling the overlay also dispose of the tooltip.

Steps to reproduce:
- Edit a website and drop a cover snippet
- Toggle the background position overlay (by clicking on the target
icon)
- Close the overlay (discard, save or click on the editor)
- Change the Parallax option from fixed to Top to Bottom (this is just
so that the previous tooltip is clearly visible after the next step)
- Toggle the background overlay again
=> The old tooltip is still present and a new one is visible

[1]: https://github.com/odoo/odoo/commit/1fcd098af5fa18e848c66bb83bdceb6ba0308512
[2]: https://github.com/odoo/odoo/commit/3c01b1cd77adec146b1a90f96bb1223a2108678b

task-3119958

closes odoo/odoo#110170

X-original-commit: 2ddffeef579baf47ff117b133a9d4fbf12108a2c
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-01-17 20:59:28 +01:00
aath-odoo 6ab8e603ae [FIX] web_editor: should remove button classes on unlink
Before this commit:

On removing link, all classes were removed including non-button link classes.

After this commit:

Only remove link related classes and remaining classes are preserved by
creating span.

Task-2930767

closes odoo/odoo#103602

closes odoo/odoo#110169

X-original-commit: 0057b7983b5da42328187f42729b6648002fb2be
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-17 20:59:25 +01:00
Andro Gvivradze 8144649fe5 [FIX] website_slides: display courses page with single course
Before this commit if you had a single course
and tried to open courses page on website, course
would stretch and fill in whole page.

it is tied to a bootstrap lib update. On bootstrap 4 col-xx-x has
max-width attribute and because of that it wasn't a problem before.
Now bootstrap 5 uses normal width attribute and flex-grow class
just ignores it.

This commit fixes that so that course behaves similar to how
it was in previous versions.

Task-3128895

closes odoo/odoo#110167

X-original-commit: 3171260cc1458e0789268c1425d332d4082743f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-01-17 20:59:22 +01:00
Robert Coleman c84618b8bd [IMP] base_vat: add New Zealand IRD/GST number validation
closes odoo/odoo#110125

X-original-commit: 8b0bcbb3fc4f14d6706860831c16e37360a2d247
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-17 20:59:05 +01:00
Lucas Lefèvre 9a06c9550a [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/331a62e8 [REF] menu: simplify menu api
https://github.com/odoo/o-spreadsheet/commit/9c5f0ebc [IMP/REF] bottom_bar: improve style and usability
https://github.com/odoo/o-spreadsheet/commit/a378c53c [IMP] composer: fuzzy search to autocomplete
https://github.com/odoo/o-spreadsheet/commit/35b1263a [FIX] bottom_bar_sheet: fix innerHTML security issue

closes odoo/odoo#110106

Related: odoo/enterprise#35897
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-01-17 20:59:02 +01:00
Odoo's Mergebot 2d791e8afe [MERGE] mail, various: improve post and composer usage, coding and performances
Purpose of this task is to cleanup usage of main mail.thread post methods and
helpers as well as composer usage and code. Achieve this by removing or
cleaning deprecated code, simplifying flow / API, improving composer support
of templates, rewrite composer code, ease batch support.

In this task we notably

  * cleanup input / output as well as default values for message_post as well
    as 'with view' and 'with template' helpers. Those are now cleaned and
    two main helpers are introduced: post with source (view or template)
    and mail with source (view or template), depending on main notification
    style.
  * rewrite and improve template code generating values from the template
    definition. It is now cleaner, delegated into sub methods and made
    more efficient in batch mode, notably when computing or creating
    recipients;
  * rewrite and improve composer code generating values for either posting
    either sending a mass mailing. It is now better separated into a static
    rendering and a dynamic rendering;
  * supports a batch post on documents, instead of being limited to a single
     res_id and improve overall code to be batch-enabled;
  * support scheduled_date from template;
  * support multi reports templates;
  * perform various code cleaning, rewriting in order to achieve both a more
    readable code, easier to override and understand as well as better tested
    and documented;
  * cleanup configuration of composer. Use fields, better define and update
    their value. Don't add them in UI but allow more fine-grain usage, notably
    when invoked in code;

METHODOLOGY NOTE

Several points are linked to different tasks. A big PR containing a cleaning
and some improvements in the composer behavior, usage and definition allowed
to ease testing and review.

This PR is build on previously merged content that originated form this PR.
See notably (but not limited to)

  * account, mail, sale: properly locate code
    Task-2792146 - odoo/odoo#106658
  * various: cleanup alias usage and empty list help overrides
    Task-3074358 - odoo/odoo#105992
  * clean parameters propagation in post methods
    Task-2726501 - odoo/odoo#82167
  * rating send request api cleanup
    odoo/odoo#106024
  * empty list help cleanup
    Task-3074357 - odoo/odoo#105992
  * rendering mixin options and usage cleanup
    odoo/odoo#106072
  * improve exclusion list mail logging
    odoo/odoo#106568
  * linting and cleaning
    odoo/odoo#106025

Next step will be to improve composer fields to be editable computed fields
and remove the onchange and hard-to-predict code. Translation support will
also be improved, as well as some performance bits.

LINKS

Task-2710804 (Mail: Clean MailThread API)
Task-2993872 (Mail: Support scheduled date in all composer flows)
Task-3035101 (Mail: Support batch-posting from composer)
Task-3034875 (Mail: Speedup and batch partners find or create with templates)
Task-2868153 (Mail: Allow multi-reports mail templates)
Task-3132710 (Mail: Configurable composer)

Prepares Task-2088884 (Mail: Use editable computed stored fields in composer)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#99482

Related: odoo/upgrade#3856
Related: odoo/enterprise#31017
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-17 20:58:43 +01:00
Thibault Delavallée 0039c326f4 [FIX] test_mail, various: update query counters
Update counters now that all changes in this PR are validated.

Main observations

  * batch mode is improved: few tests effectively run on a real batch of
    records but in those use cases there are more gains due to better batch
    management of values rendering and recipients management;
  * posting using a view does not call the composer anymore in all situations
    allowing to gain a lot of queries by not creating a composer and calling
    a dummy onchange on it;
  * various small gains in various tests, notably linked to usage of low-level
    reference fetch and various small code tweaks;

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:42 +01:00
Thibault Delavallée c298e1309d [REF] mail: allow to control composer exclusion list usage
Currently when using the composer excluded emails are computed when the target
model inherits from the blacklist mixin. This behavior can now be deactivated
through a new field 'use_exclusion_list', like what has been done in SMS
composer.

Task-3132710 (Mail: Configurable composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:42 +01:00
Thibault Delavallée 360d9ce201 [REF] mail: add 'force_send' field on composer to control email queue usage
Currently when using the composer to create a mass mailing emails are sent
directly, unless scheduled date is in the future.

With this commit it is now controllable through a field like what has been
done on SMS composer. Its default behavior is the same as before

  * posting on a monorecord: force send notification emails;
  * posting on multirecords: use the queue (force_send=False parameter given
    to message_post and propagated to _notify_thread);
  * mass mailing: use force send to send emails directly;

Usage of mail_notify_force_send context key is also removed when possible
as it is a standard parameter of posting API.

Task-3132710 (Mail: Configurable composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:41 +01:00
Thibault Delavallée 35762204a6 [REF] mail: better use and update 'auto_delete' composer field
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Correctly update 'auto_delete' field

  * add missing update in onchange, to either take value from template, either
    fallback on default_get values as other fields;
  * in comment mode, actual value for 'auto_delete' is True by default. Composer
    value was not used and bypassed by a context value being True by default.
    Context key support is removed, correctly replaced by the composer field
    value itself;

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:41 +01:00
Thibault Delavallée 9140ce06c3 [REF] mail: better define 'keep log' fields of composer
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Change 'auto_delete_message' into 'auto_delete_keep_log' that has the inverse
meaning. Indeed it is unclear what 'auto_delete_message' really does. It is
used when automatically removing emails sent through mass mailing, to know
if message created through inherits are kept or not. Purpose of keeping them
is to have a log on the document. Deleting the message therefore removes the
log.

In this commit we change the meaning to something positive, keeping logs being
clearer when choosing which option to activate. Functional usage of the field
itself does not change with this commit.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:41 +01:00
Thibault Delavallée 629ba0c392 [REF] mail: replace 'is_log' on composer by posting a note
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Remove 'is_log' field on mail composer. Indeed its usage can be globally
replaced by using the 'note' subtype when posting. It is now better matching
the result of using the log a note mode of chatter.

Posting with a False subtype_id already automatically converts it into a
note subtype in 'message_post'. It is now done directly at composer level
to lessen magic and have more control on final output.

In case of outgoing emails subtype has no usage, as notification process is
not called. It is therefore forced to False when creating the mail records.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Thibault Delavallée 28b4ba4049 [IMP] mail, various: allow to link multiple reports to templates
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Update report_template field on template model to be a many2many field instead
of a many2one. It allows to attach multiple dynamic reports to a given template
instead of being limited to a single one.

Name should now come from the report itself, which should be considered as
complete by itself. Template cannot override report naming anymore.

Task-2868153 (Mail: Allow multi reports in mail templates)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Thibault Delavallée fbcc1bf4c0 [IMP] mail: support 'scheduled_date' from template on composer
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Purpose of this task is to correctly support scheduled_date from template on
both comment and mass mode in the composer.

It is currently mainly supported at template level, when using a template
to directly send emails. In this commit we add a field on composer that
takes the value from the template, and propagate it to the mail or messages
created when validating it.

As most template fields it can contain inline template code to be rendered
dynamically on target records, hence using a char field. Its rendering
is done using template that calls _parse_scheduled_datetime. It allows
to have an UTC and timezone agnostic value.

SCHEDULED_DATE SUPPORT

When posting a comment, scheduled posts uses the 'mail.message.schedule'
mechanism that creates the message but send notifications later.

When sending a mailing, emails have a scheduled_date set. As the 'send'
method does not check for scheduled_date (only the cron queue) we have
to filter emails scheduled in the future before calling the 'send'
method.

Task-2993872 (Mail: Support scheduled date in all composer flows)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Thibault Delavallée f652f6a75c [IMP] mass_mailing: improve composer invoke when sending
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Use the new 'res_domain_user_id' field to use in combination to 'res_domain'
on composer to delegate res_ids computation to the composer instead of relying
on res_ids or active_ids. Records to mail are not stored inside a domain.

Set auto_delete values directly when invoking the composer instead of hacking
the generate mail values. That way we delegate more to the composer itself.

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00