Commit Graph
157157 Commits
Author SHA1 Message Date
Younn Olivier 99a6951f43 [FIX] web_tour: fix the tooltip content font-size
Before this commit, the tooltip content of a tour had a font-size set in
rem. As its container dimensions were computed using the root element
font-size, these dimensions were not correct if the tip was inserted in
a document with another root element font-size.

This was leading to a bug after [1] added an iframe to edit the website:
the backend and frontend root elements font-size are different and the
containers of tips targeting frontend elements were clipped.

This commit fixes the tooltip content font-size in px (with the
font-size used to compute the container dimensions), so that it can be
placed in iframes with a different root element font-size.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-3035156

closes odoo/odoo#106746

X-original-commit: 8703c01d0c0c84331e4d4adb00c8def962635e17
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-29 11:33:55 +01:00
Younn Olivier c5bffd01cd [FIX] website_slides: fix slides_tour
Before this commit, the main website_slides tour, slides_tour, was
broken after [1] introduced the WebsitePreview client action.

This commit adapts it to work with an iframe.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-3035156

X-original-commit: 4f463092c02bcf5201464b30d1d58b5c1b53cc70
Part-of: odoo/odoo#106746
2022-11-29 11:33:54 +01:00
Younn Olivierandqsm-odoo 3160e5d6e1 [FIX] website: fix the homepage tour
Before this commit, the website homepage tour was starting with an
unresolvable "Wait for the editor to be started", useful only for tests.

This commit removes that technical step for user tours.

task-3035156

X-original-commit: d45ce39b2904bcb4335f74fab3c42f3eebf477d5
Part-of: odoo/odoo#106746
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-11-29 11:33:54 +01:00
PNO 5527adc18e [FIX] stock: Fix quantity done on lots changing to 1
Issue:
At anypoint we should be able to call the method "_set_lot_ids" from stock.move on moves that are already done and the quantities should not change.
This is not the case for lots that get their quantity changes to 1 as if the product was tracked by serial number.

This commit should be seen a a complement to the commit: https://github.com/odoo/odoo/pull/79565

Fix:
Check the product is tracked by SN before trying to change the quantities to 1.

Related ticket: 2689724

closes odoo/odoo#91769

X-original-commit: b56f96d6d63435d629f0a8137a038dacaf0782fe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-11-29 11:33:50 +01:00
Yash Pathak 203e10bdd5 [CLA] update OERP members
closes odoo/odoo#106752

X-original-commit: ad9dca99f266bc2612f6001382534ed05e11700e
Related: odoo/enterprise#34478
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-11-29 10:31:25 +01:00
Ivan Yelizariev 255e5c5804 [FIX] base,web: fix address widgets in reports for RTL
Address widget has `o_force_ltr` class [1] since Odoo 14 [2]. Somehow, it didn't
work in Sale Order report and everything was RTL. But since Odoo 16 address part
actually became LTR. It mixes things up, because partner name and phone number
in the billing/delivery sections is still RTL [0].

This commit fix it by forcing whole address block to LTR. Alternative solution
could be removing `o_force_ltr` class, but this approach looks more risky and
should be done in master instead.

[0]: opw-3053457

[1]: https://github.com/odoo/odoo/blob/1666ee5515996fab8a843b36b4fd93b776172f75/odoo/addons/base/views/ir_qweb_widget_templates.xml#L26

[2]: https://github.com/odoo/odoo/commit/5b7c3805a045d8824dd1b4fa0de07d90b17392c1

closes odoo/odoo#106750

X-original-commit: a63f616c280ff464e331e3ba97265a8c29a86871
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-11-29 10:31:22 +01:00
Kevin Baptiste 80576925e9 [FIX] hr_(holidays_)attendance: recompute overtime on leaves > 1 day
1/ When approving / refusing a leave spanning multiple days, the
   overtimes were only recomputed for the starting date and not the
   whole period.

2/ Overtimes should be computed whatever the kind of time off that's
   been taken (Absence or Other).

task-3073155

closes odoo/odoo#106751

X-original-commit: 116d7cb46132404354e00e67a2364b8239fcdce5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-29 09:32:48 +01:00
niyasraphy e5c792510a [FIX] sale_expense_margin: remove duplicated if condition
closes odoo/odoo#106748

X-original-commit: 63c85bf237eaa2262fa9abf7e63595b8465d5586
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-29 09:32:45 +01:00
Ricardo Gomes Rodrigues (rigr) 581da8ca32 [IMP] l10n_pt: refactor Portuguese localization
This commit completely refactors and updates the Portuguese localization to include the:
- Chart of Accounts (the accounts as well as the account groups)
- Fiscal positions
- Taxes (including the ones from the islands of Madeira and Azores)
- Tax groups
- Tax report according to the Governement template
- Translations files to have the official translations of the accounts, the tax report, ...

Links:
CoA: https://www.occ.pt/fotos/editor2/taxonomiasplanocontas_fev2019.pdf
EU reverse charge: https://europa.eu/youreurope/business/taxation/vat/cross-border-vat/index_en.htm
Tax report template: https://info.portaldasfinancas.gov.pt/pt/apoio_contribuinte/modelos_formularios/iva/Documents/declaracao_periodica_IVA.pdf
Information on how to complete the tax report: https://www.occ.pt/news/_manual/ColecaoIVA2019.pdf

Task id 2755518

closes odoo/odoo#87572

Signed-off-by: Laurent Smet <las@odoo.com>
2022-11-29 09:32:43 +01:00
Antoine Dupuis (andu) d76e3bb82e [IMP] account: Change 'Miscellaneous' menu to 'Journals'
In Odoo 16, we redesigned the `Accounting > Miscellaneous` menu to
provide a convenient interface for inspecting any journal entry or
journal item.

As such, it no longer makes sense to call it 'Miscellaneous'.

This commit aligns the name with the new functionality.

We also remove the default filter of the 'Journal Entries' view, which
restricted it to miscellaneous entries, and replace it with a filter
on posted entries, consistent with the purpose of conveniently
inspecting the accounting journals.

closes odoo/odoo#106749

Task: 3083921
X-original-commit: ee551d74557b889a463bd7dff234ff5f12539e4a
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-11-28 20:50:25 +01:00
Antoine Guenet 091dfca6fb [IMP] web_editor: align editor columns with editable bounds
Columns added with the "columns" Powerbox commands should be aligned
with the editable element's bounds.

task-3001988

closes odoo/odoo#106747

X-original-commit: fb55f688f6be2211ebeea4ba431a06230c40fb6b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 19:49:04 +01:00
qsm-odoo e16fef2380 [FIX] website: hide backend navbar tour tips when entering edit mode
When entering edit mode, the navbar is hidden. The problem is that since
the merge of the website-in-backend feature at [1], it is only not shown
via an animation (height 0 + out of screen) but not `display: none`. The
tour system thus thinks it is still shown and keeps showing the related
tour tips.

E.g. with website_sale installed (and no demo data, to have the tours),
go on the shop page, there is a tooltip pointing at "+ New", enter edit
mode => the tooltip is still there and it even prevents to click on
"Discard" to leave the edit mode.

This commit fixes the issue by making the navbar `display: none` once
the closing animations are finished.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-3082439

closes odoo/odoo#106735

X-original-commit: cdc8d4c889b316664323afad0d848403960150d5
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-28 18:51:53 +01:00
qsm-odoo 1419655e16 [FIX] website: allow to exit fullscreen if not on website anymore
While showcasing your website inside the website application, there is
the possibility to hit the escape key to enter fullscreen (hiding the
backend navbar outside edit mode and the editor panel during edit mode).

There was a problem following this flow:

- Go to your website inside your website app
- Hit escape to enter fullscreen
- Press CTRL-K to switch to another part of the backend
=> You are now somewhere in the backend, without the navbar (fullscreen)
   and you cannot exit it.

As it was a one-line fix (except for the re-indentation), this commit
now allows to exit fullscreen mode wherever we are.

Discovered during task-3082439

X-original-commit: bd225ec782e26c87301e9e786ffd7250ad62ebfc
Part-of: odoo/odoo#106735
2022-11-28 18:51:52 +01:00
shsa-odoo bd1850d30f [FIX] mass_mailing: should not crash when loading snippets
Current behavior before fix:

In mobile view when we click invite button on events module which loads the
snippet, at that time there was a traceback.

Desired behavior after fix:

Now the snippet gets loaded without any traceback.

Task-2994261

closes odoo/odoo#106734

X-original-commit: 634f6ae4d4208f0551bc2b81c359915eb47316b5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 18:51:49 +01:00
Samuel Degueldre 2b33d2113e [FIX] web: make originalError the root of the error chain
Previously, when calling error handlers, we would give them a new error
created by the error service, as well as an `originalError` which is the
error that was caught by the error service. In some cases, this error is
part of an error chain, eg: errors that happen in the owl lifecycle are
wrapped in an `OwlError`, so that when an error occurs in a callback
passed to a lifecycle hook, the position where the hook was called to
register the offending callback is part of the stack trace.

In practice, most error handlers only care about the error that caused
the entire error chain (the root) when deciding whether they should
handle the error or not, eg: an RPCError should be handled by the rpc
error handler, regardless of whether it occured in an event handler or
in a component's willStart. It already reads the traceback to display on
the UncaughtError provided by the error service as this traceback
contains the entire error chain stack information and is annotated with
source maps by the error service.

This commit makes it so that the `originalError` passed to handlers is
now the root of the error chain, it also sets the `cause` of the
UncaughtError which is passed to handlers as the error that was caught
by the error service, so that if a handler needs to inspect the error
chain to know whether it can handle the error or not, it can still do
that.

related to OPW-3069633

closes odoo/odoo#106720

X-original-commit: dd6f103b1635868e03a7aa40eb7186861d22d377
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-11-28 18:51:47 +01:00
Romeo Fragomeli 755cb64b4a [FIX] web: titles are smaller in reports
Since the Bootstrap 5 migration the "headings" `<h1>`, `<h2>`, ... are
smaller than before.

This commit, restores the old CSS rules from Bootstrap 4 for reports.

Steps to reproduce:
* Open Sales
* Select a quotation
* Print the Quotation (using Print dropdown) => BUG title is smaller
  than the old version of Odoo (e.g. Odoo v15)

closes odoo/odoo#106721

X-original-commit: 76299a8d63e85249d30d864a777c2f142ea5daf5
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-28 17:54:03 +01:00
Kevin Baptiste 0a0c6917b5 [FIX] hr_holidays: take full day leaves on Day view
The default hours of a time off created from the Day view would be the
range of hours that was selected in the calendar view, thus resulting in
leaves of half an hour.

closes odoo/odoo#106719

X-original-commit: 1ea102d4a2d62308c6dfaa7c3a71fdc4c6c4db85
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-28 16:53:48 +01:00
Romeo Fragomeli 3dc6d81590 [FIX] web: kanban: quick create column text wrapped
In kanban view, the columns are in a flex container and as there is no
specific flex rules on the quick create column and is shrink by
default. So when the new column is above the edge of the viewport, it
starts to shrink.

To avoid this bug we have added the same flex rules has the kanban
column.

Steps to reproduce:
* Open Note
* Create many new column => BUG text wrapped when the new column reach
  the width of the viewport.

closes odoo/odoo#106683

X-original-commit: 62b692b6edd7d57ef14c02ecd5b731c8ba664b98
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-11-28 15:53:25 +01:00
Patrick Hoste 58fa3d1ece [FIX] mass_mailing: fix unsubscription_date when opt_out on create
Before this commit when creating a mailing contact with a mailing
list opt_out at creation the unsubscription_date wasn't set.
Indeed, from the mailing contact view the mailing list uses an
editable list that passes all the values at create even when not set
contrary to when one update the contact only the changed values are
passed. This commit fix this issue.

Task-3070852

closes odoo/odoo#106682

X-original-commit: e7c22094068ce5cdff7f30178cea6d4f39f09137
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Hoste Patrick (pko) <pko@odoo.com>
2022-11-28 15:53:23 +01:00
Florent de Labarre 44c407da3c [FIX] stock: impossible to search correctly location
Before this PR Odoo don't pre-search on location.

closes odoo/odoo#106680

X-original-commit: 55729e2bfb402e5af6569c8dd19ee8495fa244a9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 15:53:20 +01:00
niyasraphy 4b04d2d7d3 [FIX] lunch: timezone field alignment in alert form view
closes odoo/odoo#106679

X-original-commit: 4b0efa700d045b6f8f8b7569d498137af4d09909
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-11-28 15:53:17 +01:00
Valentin Vallaeys (vava) 3e0c80270d [FIX] product,web: color_field fixes for product variant color
There was a typo in the color_field xml not allowing to disable the
pop-up in case of readonly. A test validates the feature is active.

The color_field now displays the transparent symbol (instead of black
color) in case the color is undefined.

The product configurator also displays the transparent symbol for
undefined non-custom colors.

task-3013110

closes odoo/odoo#106669

X-original-commit: c67c32c2dbe10b4885ec1177852839b3d18ecf05
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-11-28 15:53:11 +01:00
Odoo's Mergebot 70a6407d6c [MERGE][REF] account, mail, sale: properly locate code
PURPOSE

Purpose of this task is to cleanup attachment management done in composer overrides
in account modules and move it to model.

SPECIFICATIONS

Accounting holds code to handle attachments linked to their custom composer
(``account.invoice.send``) that uses through inheritance the mail composer
(``mail.compose.message``) that has a specific processing of attachments
to link pending composer attachments to the right records. Move it as a classic
model override for account.move

Account_edi and various l10n submodules hold some custom code to generate and
handle EDI attachments. It is used to add attachments linked using AccountMove
specific 'edi_document_ids' field when sending emails based on templates.
Move it as a classic model override for account.move and account.edi.document.

Move model-specific overrides of the mail composer directly at model level in
purchase and (website_)sale.

Update some naming and docstrings accordingly. See sub commits for more
details.

LINKS

Task-2710804 (Mail: Clean MailThread API)
Task-2792146 (Mail: Move model-dependent code from composer / template)

closes odoo/odoo#106658

Related: odoo/enterprise#34439
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-28 15:53:00 +01:00
Thibault Delavallée 04c1959456 [MOV] account, mail: move model-specific template code to model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Account_edi and various l10n submodules hold some custom code to generate and
handle EDI attachments. It is used to add attachments linked using AccountMove
specific 'edi_document_ids' field when sending emails based on templates.

Currently MailTemplate is overridden in accounting modules to hold code related
to AccountMove and AccountEdiDocument attachments manipulation. This is linked
to EDI and report naming, not mail specific. This should therefore not be
implemented at template level, but in those specific models.

For that purpose we introduce a method in MailThread that allow to handle
attachments when being in a template context. An override in account_edi
allows to implement its specific behavior.

By the way an old docstring in l10n_it_edi that was quite unrelated to the
override is also removed, as it was more confusing than helping.

Task-2792146 (Mail: Move model-dependent code from composer / template)
Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 0be5b37008 [MOV] mail, loyalty, purchase, (website_)sale: move model-specific composer code to model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Update addons

  * in purchase and sale: context key update should be done at message_post
    level, especially this is not used in mass mailing mode;
  * in website_sale: code to update sale order to avoid sending recovery
    emails several times belongs to a "post hook" method on sale order model;
  * in loyalty: remove a deprecated / unsupported 'mark_coupon_as_sent' key;

Task-2792146 (Mail: Move model-dependent code from composer / template)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 1c240f11df [IMP] mail: cleanup code bits in attachments processing
Purpose of this commit is to try to make code a bit easier to follow using
dicts, sets and tuples, as well as updating some variable names.

Also rename the method to be clearer. Tools methods may omit the namespacing
to avoid too much confusion in naming.

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 0ea4c3110a [MOV] account, mail: properly locate attachments management on model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Accounting holds code to handle attachments linked to their custom composer
(``account.invoice.send``) that uses through inheritance the mail composer
(``mail.compose.message``) that has a specific processing of attachments
to link pending composer attachments to the right records.

Indeed attachments linked to the composer are pending attachments, and are
linked to the record when posting the message. This allows to know which
attachments have been added by the user, have specific rules for access
rights, ...

However this code has been wrongly added directly at mixing level at
odoo/odoo@bdcc012004. Instead ``_message_post_process_attachments`` method
should always be called based on a record, allowing to locate the override
at model level.

Task-2792146 (Mail: Move model-dependent code from composer / template)
Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:58 +01:00
Thibault Delavallée f1bb452ce4 [MOV] mail: move method to process attachments
Purpose is to make a section that will cover pre- and post- process methods
for posting or mailing records.

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:58 +01:00
Kartik Chavda 49977c1116 [FIX] hr_timesheet: fix searching on is_project_overtime field
Before this commit Projects in overtime filter does not return
project as expected after project has allocated hours to set
on then.

This commit fixes by taking allocated hours into account to
search for project that are in over time.

task-3000817

closes odoo/odoo#106657

X-original-commit: cbd091cb088fba44c14c27dbbc9e8ca098742da1
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-28 15:52:49 +01:00
Jérôme Hellinckx 86ad480b72 [FIX] purchase_stock: avoid PO exception propagation to DONE receipts on less received quants
Before this commit:
1. Create PO with quantity 10, confirm (creates receipt-1)
2. Receive 2 quantities on first receipt (receipt-1), backorder (receipt-1 is 'done', creates receipt-2)
3. Receive 3 quantities on second receipt (receipt-2), backorder (receipt-2 is 'done', creates receipt-3)
4. Change quantity to 5 in PO
5. An exception is created on all receipts (1, 2 and 3)

In the scenario above, receipt-1 and receipt-2 are partial receipts that are set to 'done'.
It is not necessary to create an exception in these receipts when the quantity is changed to less than originally expected in the PO.
Since the system checks that the new quantity has to be equal or greater than the received quantities, the already received quantities cannot be impacted.

After this commit:
The exception is only propagated to the receipts that are not done.
e.g. in the example above, an exception appears only in receipt-3.

task-2648209

resolves #76297

closes odoo/odoo#106633

X-original-commit: d6fad232c3dd4a4f7cd54bd255b75314d54ed065
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:42 +01:00
Mathieu Duckerts-Antoine 74c5692f48 [FIX] web: fix the error that the name of the line is too long
- Currently the label of the lines is not limited to the number of characters. When the user gives a name that is too long, the graph will not be displayed.
- This commit limits the number of labels, if exceeded it will display as ...

closes odoo/odoo#106623

X-original-commit: 54657151957c5be5e885c245db9e1830709833c0
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-11-28 14:51:39 +01:00
Jinane Maksoud 4e06b34bce [FIX] mrp: fix the filter order in _bom_find_domain
Only active boms should be returned by the domain even if
they match a product id.

closes odoo/odoo#106615

X-original-commit: 2a73890d304476833d76bac9a36ef92f12f267a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:36 +01:00
Donatas cd704e7119 [IMP] website_sale: adds search_product to shop values
closes odoo/odoo#106613

X-original-commit: 3772da47af7e1de2d9608372c9306e61a91ded82
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-28 14:51:33 +01:00
Lucas Lefèvre 4bb43e2554 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/ab6f47f9 [FIX] InternalViewport: compute the actual visible rect of a zone
https://github.com/odoo/o-spreadsheet/commit/966c311e [REF] plugins: unify position getters API
https://github.com/odoo/o-spreadsheet/commit/9f1c9695 [IMP] model: ignore type property in command payload
https://github.com/odoo/o-spreadsheet/commit/862dacbc [REF] selection: rename getPosition to getActivePosition
https://github.com/odoo/o-spreadsheet/commit/0144515a [REF] selection: getPosition return main position
https://github.com/odoo/o-spreadsheet/commit/38422f4f [FIX] find and replace: scroll on single match.
https://github.com/odoo/o-spreadsheet/commit/9be582c7 [FIX] selection_input: traceback when using unbounded ranges
https://github.com/odoo/o-spreadsheet/commit/49285322 [IMP] doc: add tables of contents
https://github.com/odoo/o-spreadsheet/commit/2c5d86af [IMP] model: config to provide external dependencies
https://github.com/odoo/o-spreadsheet/commit/5b442218 [REF] plugins: use object in constructor
https://github.com/odoo/o-spreadsheet/commit/ef98be1b [REM] plugins: remove useless modes
https://github.com/odoo/o-spreadsheet/commit/4f20d05f [IMP] data: reorganize data top menu

closes odoo/odoo#106583

Related: odoo/enterprise#34412
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-28 14:51:24 +01:00
Romain Derie 2fdd998a9a [IMP] website: improve we-urlpicker URL preview button wording
Quick feedback from client, this is following [1] that added a button
next to the URL input of `we-urlpicket` to be able to preview the link.

The wording was not great, it gives the impression it's an option to
chose to have that URL opened in new tab (eg when form is submitted).

Also, giving it the style of a conventional we-button was also giving
the same impression that it was actually an option that you could click
on to enable something.

Changing the wording and the style of those special we-button should
reduce the confusion.

Arguably, one might think about the usefulness of this button but it
acts as the counterpart of the regular links which have a "Open in new
tab" possibility when hovering the link in their preview tooltip.

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

opw-3060966

closes odoo/odoo#106538

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-28 14:51:21 +01:00
Bruno Boi 7f257a2025 [FIX] web: popovers and arrows repositioning
**Before this commit**
When a popover is shown and then repositioned to a different placement
(i.e. due to window scrolling or resize), its arrow is misplaced.

This is due to the fact that classnames added in order to correctly place
its arrow are just added to the previous ones instead of replacing all
the needed classnames.

**After this commit**
The classnames are now properly replaced instead of just being appended.

closes odoo/odoo#106495

X-original-commit: c54cc2f87930147b5addb6f447574c677ef3504d
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-11-28 14:51:16 +01:00
Simon Genin (ges) 7455bd4d79 [IMP] test_lint: remove escheck test
As of 16.1, the ecmascript version accepted in odoo is 2022.
This basically makes escheck almost irrelevant.
Escheck being only able to check up to the version 2021, it can be
removed safely.

closes odoo/odoo#106052

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-11-28 14:51:10 +01:00
Rodopho Cammarosano de Lima (rcdl) 3c12c5e939 [IMP] web_editor: add forceNewWindow to LinkTools
Upon instantiation of a LinkTools object, the forceNewWindow property is
now added to the options object. This allows us to take advantage of the
pre-exisiting mechanism to conditionally display the "open new window"
checkbox in the LinkTools widget
(odoo/addons/web_editor/static/src/xml/wysiwyg.xml:334).

The possibily of not having the checkbox in the DOM demanded a
modification of LinkTools._isNewWindow().

_isFromAnotherHostName(), being used by both LinkDialog and LinkTools,
was moved to their parent class Link.

task# 2789222

closes odoo/odoo#104923

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 14:51:07 +01:00
Rémy Voet (ryv) 7f7006da02 [REM] stock_account: remove useless overwrite of read_group.
Force `group_operator` of `unit_cost` to be None to be able to
remove useless `read_group` override.

closes odoo/odoo#104863

Related: odoo/upgrade#4012
Related: odoo/enterprise#33568
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:00 +01:00
Hugo Carlier (Huca) fb13d7c99e [IMP] project, hr_timesheet: improve UX
- Description:
    - project: Apply default filters when selecting a 'blocked by'
    task in task form (project.task form view > blocked by notebook >
    add a line > apply a default filter on the current project and on
    open tasks)
    - project, hr_timesheet: uniformize remaining hours display in
    kanban view for tasks and projects (project.project kanban view:
    add a frame around remaining hours. The color of the frame follows
    the same rules as the one used in project.task kanban view)

task-3034806

closes odoo/odoo#104250

Related: odoo/enterprise#33309
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-28 14:50:50 +01:00
Nicolas Bayet 0340537152 [FIX] web_editor: check method addNeutralStyle
Because of css limitation, the child of a parent that define a
text-decoration cannot "neutralize" that decoration defined by its
parent with a css property (ie. the text-decoration cannot be
overridden).

When a block define an inline style or any tag that have a class, the
method `formatSelection` tries to "neutralize" the style by calling
`addNeutralStyle`. As it is impossible to "neutralize" the style for
underline nor strikeThrough, there is no method `addNeutralStyle`
defined for those properties.

Before this commit the method `formatSelection` was crashing because
`addNeutralStyle` was not defined.

Task-3002123

closes odoo/odoo#106635

X-original-commit: ce068a3113204dc558e69e88f1d2d778fa446c73
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 13:20:47 +01:00
Mathieu Duckerts-Antoine 84a0d31ca7 [FIX] web: search model: one2many search default labels
When a one2many is used as a search default, its label has to be fetch
via a name_get in order to get a correct display of the facet
corresponding to that field in the search bar. It turns out that the
search model did not wait properly the return of the name_gets before to
start to compute the facets.

closes odoo/odoo#106624

X-original-commit: 50f58212410b321c1c4ad3d42a91cd1d23567308
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-28 13:20:44 +01:00
Antoine Guenet fc080b960d [IMP] web: extend form default autofocus to textarea and contenteditable
When rendering, the form view looks for the element it should autofocus,
and defaults to the first text input it finds. This extends that default
behavior to the first textarea or contenteditable element.

closes odoo/odoo#106622

X-original-commit: 82a98715ae2937bff8b58212c452a28d0b28e102
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 13:20:41 +01:00
Antoine Guenet b5af8198fa [FIX] web_editor: handle default_focus form attribute for html_field
When rendering a form view that has a truthy `default_focus` attribute,
the renderer looks for the element in its tree that has its `name` as
`id`. However in the case of `html_field` it couldn't find it since
`html_field` failed to apply that `id` to its focusable element (the
editable root). This adds the `id` to the editable root when rendering
the element in `wysiwyg`, and also directly applies `contenteditable` to
it so the `focus` method actually does what we expect it to, even though
we are waiting for `HtmlFieldWysiwygAdapterComponent` to be mounted
before actually instantiating the editor itself.

task-3073096

X-original-commit: 7e14e2a9c055f5b30b7510ffad994fa10196e34d
Part-of: odoo/odoo#106622
2022-11-28 13:20:41 +01:00
niyasraphy eb52fb3ddb [FIX] hr: disable launch plan button on warning
closes odoo/odoo#106618

X-original-commit: 19cef78284bbf85810bdf183e4462e35da902e3a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-28 08:22:23 +01:00
Florent de Labarre 45b2017004 [FIX] website_crm : impossible to add a crm form
In large database with lot of user, the browser don't respond.

closes odoo/odoo#106640

X-original-commit: 0f597b3a9c4110d2984000c21564cc95e61491c4
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-28 00:25:44 +01:00
Guillaume (gdi) 63c66dbf5c [FIX] website: prevent carousel indicators errors
In this commit [1] (merged in 16.0) a bugfix has been made in the
`removeSlide` function but this one should have been applied on all
supported versions because the bug it fixes is present on all versions.
The bug it fixes is the following:
- Drop a carousel block on a page
- Remove the *first* slide

=> There is no active indicator.

Moreover, the bugfix made in 16.0 [1] introduces another error: when a
slide is removed from the carousel the indicators are not in a correct
state anymore.

Following the same steps with the changes of [1]:
- Drop a carousel block on a page
- Remove a slide

=> Indicators are no longer consistent with the slides so tracebacks
appear during the carousel slides. The list of indicators must have on
each element a `data-slide-to` attribute which must reflect the
position of the slide (starting with 0).

So this commit is to backport the fix from 16.0 [1] to 14.0 and to fix
the new bug that [1] introduces.

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

task-3040931
opw-3051615

closes odoo/odoo#106639

X-original-commit: 212e8ce620f6eb95aeff6426e06cb29b2c06d0c1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-26 14:02:14 +01:00
Antoine Dupuis (andu) 67a383a13d [FIX] account: Deferred income wiz - don't reconcile draft entries
When creating draft deferred entries in a reconcilable account,
we should not attempt to reconcile them, because only posted entries
can be reconciled.

closes odoo/odoo#106603

X-original-commit: edaf019eac9124cb64c0a1dce55291d40b542256
Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-25 23:15:18 +01:00
Guillaume (gdi) 0b7d53b3ee [FIX] website: scroll to the next visible element
Before this commit, the buttons to scroll to the next element might not
work if the next element was invisible.
Steps to reproduce the bug fixed by this commit:

(Note that these steps are only reproducible from 15.0. We decided to
merge this fix in 14.0 to be custo-friendly)

- Install two languages on a website
- Drop a cover block (1), with a height of 100% and a scroll down button
- Drop a new block (2) only visible for language B below the block 1
- Drop a new block (3) visible for everyone below the block 2
- Save and go to the site in language A
- Click on the scroll down button

=> No scroll at all while the user expects to scroll to the block
visible to everyone (3). This commit fixes that by making the user
scroll down to see the next visible element.

opw-2967706

closes odoo/odoo#106477

X-original-commit: 076d7ac7795f86d48b532b6c2a1ff76e4503604e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-25 20:54:51 +01:00
Romain Derie 999da9c285 [FIX] website: prevent crash if unexpected cookies bar cookie value
With commit [1] we refactored the cookies bar to let the user decide if
he wants to accept the cookies (and/or only part of it).
Before that commit, the `website_cookies_bar` cookie could only hold
`true` as value, which now is holding an object like
`{"required": true, "optional": false}`.

This creates an issue if a user is coming from a previous version with
`true` as cookie value because since the refactoring it will crash both
in JS and PY because `in` instruction with a boolean value will fail in
both languages.

The decision taken here is simply to remove the cookie if we face such a
case so the user can decide again what he wants (since there is more
choices now).
It also means that we won't be holding an outdated value in the cookie
any longer.

[1]: https://github.com/odoo/odoo/commit/2cbda6c98ee947cea1d06c09880eee8c758304a8

opw-3074303

closes odoo/odoo#106621

X-original-commit: 22392755ed4c504e6ba2a5a9c9eb6643f2c95994
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-25 19:52:05 +01:00