Commit Graph
159377 Commits
Author SHA1 Message Date
Noe Antoine 5fa77db2ea [FIX] website_event: repair hide_sponsors with correct selector
Before this fix, the 'hide_sponsors' value was used to hide the
row of sponsors in several views:
- page of all exhibitors
- page of single exhibitor
- if website_event_track is installed -> registration confirmation

But actually it did not do anything anymore, because the old
selector used to apply the display none !important was hard-coded
to the previous code structure. This is very unstable, and structure
changed first in 35f70e5f11

Also, o_wevent_sponsor_wrapper selector was not used anywhere.

FIX:

Use o_wevent_sponsor_wrapper to not depend of structure anymore.
'hide_sponsors' adds o_wevent_hide_sponsors on the view and the
sponsors bar will be hidden, as expected.

Task-3213873

closes odoo/odoo#115453

X-original-commit: 13778a454b10aa40fae3cc0e3b7fcbd9e8781ce1
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-16 09:37:22 +01:00
Andro Gvivradze 9b98893b10 [FIX] portal_rating: fix portal.chatter_messages layout
Commit https://github.com/odoo/odoo/commit/22baab2d0ec2c076a4c769f6c594062c0cea5f90 introduced changes to make sure that
footer is not visibly moving when user moved from course to rating tab
on website slides. However, that issue was already solved in the same
commit, with style changes on o_wslides_course_main. Thus, we were left
with big empty space underneath comments section on not only website slides,
but also on any other place where comments section(portal.chatter_messages)
was present.

This commit removes redundant code in order to correct style in pages where
comments section is present.

Task-3203106

closes odoo/odoo#115431

X-original-commit: a58123c1faf888c561e41fd5716be25a44973d6c
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-16 09:37:19 +01:00
Noe Antoine dbff4c3a15 [FIX] website_event_track_live: fit divs to video player size
Issue introduced in https://github.com/odoo/odoo/pull/95450

After migrating to 5.1.3 Bootstrap, the col-12 element no
longer had implicit position-relative attribute, meaning that
o_wesession_track_main div was no longer position-relative.

Therefore, children position-absolute elements for loading
and track suggestion at the start / end of the video became
absolute to the window instead, and format failed to match
the video frame anymore, as it should have.

-> FIX : add manually the position-relative back on the live
track container element (see o_wevent_event_track_live).
We also add JS check to make sure we add position-relative
even if templates are not updated in stable, as the screen
is very disturbed otherwise.

Task-3215833

closes odoo/odoo#115430

X-original-commit: 643cdc649bf14d51528e9502266bfbcd62576b6e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-16 09:37:16 +01:00
yhu-odoo 129f3d949d [FIX] mrp: manual consumption wrong when backorder/split/merge
Fix the isuue that manual consumption is not correctly calculated when
backorder/split/merge.

closes odoo/odoo#115429

X-original-commit: d72ddd80d8a6aaa808c07db685972a1c05e8d6a4
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-03-16 09:37:14 +01:00
Rémy Voet (ryv) 360c48299a [REV] base_automation: avoid recomputing readonly field before write
This reverts commit 0561ad2324905aed5afd5cc163e5e6aebee09d40.

closes odoo/odoo#115425

X-original-commit: f188bf734f56cf2ab045aff1060aa048ed6cf58c
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-03-16 09:37:11 +01:00
amdi-odoo 9bbe43c47f [IMP] website_profile: change alert closing icons
Purpose
=======
Change the current alert banner closing icons
(a "x" in a gray box) by the new good-looking
bootstrap 5 closing button.

Task-3222588

closes odoo/odoo#115424

X-original-commit: 6f83f60f2f0d031c15df5c3b450fb583feaea3b9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-16 09:37:08 +01:00
Pieter Claeys (clpi) ecb0877e86 [FIX] stock: scrap quantity uom editable in done state
Since #104062, the uom field on a scrap order is still editable when it is in the done state. This behaviour is now fixed.

Community PR: https://github.com/odoo/odoo/pull/115288

closes odoo/odoo#115399

X-original-commit: 5785d19c749fb1456bf1079d07e83e401850b330
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-16 09:37:05 +01:00
Thomas Beckers ec9a3e0c74 [FIX] analytic: avoid traceback when searching more analytic plans
In the profit and loss report, if you go to "Analytic Group By" and select
'Search More' (need more than 7 plans), there is a traceback because
"True" is not a valid JSON.

This PR fixes this by changing "True" by "1" like other occurrences
of multi_edit parameter.

opw-3222611

closes odoo/odoo#115422

X-original-commit: 687a166e8c089a650c99eefe9d604c8c2762e1b7
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Beckers Thomas (tbs) <tbs@odoo.com>
2023-03-16 08:31:40 +01:00
jbw 17dda1ca7d [FIX] base: keep company currency active
This commit aims at preventing the deactivation of a company currency.
Was the issue on 2852452 support ticket (v14). But it seems appropriate to merge it in 13.0 as it is probably a good idea that a company currency always stays active.

How to reproduce bug:
In 13.0:
Install accounting with demo data > activate multi currency in settings > deactivate usd > create new invoice > select eur currency > cannot set usd currency back on invoice

Reconcile JS traceback in 14.0:
Install accounting with demo data > activate multi currency in settings > deactivate usd > go to accounting dashboard > click on reconcile 7 items on Bank journal > click on any “customer/vendor matching” line.

closes odoo/odoo#115444

Task: 2852452
X-original-commit: 09cb57446d99a48651cbfeeb5405029bc2d77226
Related: odoo/enterprise#38255
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-03-16 07:29:49 +01:00
jbw-odoo 09c65eacd3 [FIX] allow company to activate it's currency at install
When a company is created during the odoo installation, depending on the installation parameters, importing "res_company_data.xml" before "res_currency_data.xml" can prevent the activation of the company currency.
E.g. a fresh odoo install with account_accountant and no demo data will have 0 active currencies.

X-original-commit: f9247a276b71e9d09bb03c85dc93b36c53703e60
Part-of: odoo/odoo#115444
2023-03-16 07:29:49 +01:00
Abdelouahab (abla) 6ba2d26940 [FIX] hr_holidays: is absent search
To Reproduce
============
- go to employees app and filter by `Absent is Yes` then by `Absent is No`
some employees are present in both filters which is not logical

Problem
=======
the search method on `is_absent` field always performs the search `ids in absent_ids` no matter what are the operator and the value

Solution
========
use the `operator` argument in the searching

opw-3205967

closes odoo/odoo#115443

X-original-commit: 89a762ec463efd936c5d60a483f3cac876724b7e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2023-03-15 23:48:01 +01:00
aliya 0af863c26b [FIX] l10n_co: fix es translations
At the moment translations are only available if a user chooses es_CO specifically. This commit changes it to es, making it available regardless of which Spanish version is chosen by the user.

task-3230384

closes odoo/odoo#115462

X-original-commit: 33b96bce49ea7e0173faf4dc20312dcbe5657634
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-03-15 22:06:44 +01:00
niyasraphy 2e80e60688 [FIX] account : remove upgrade widget from sales & purchase receipt
closes odoo/odoo#104927

X-original-commit: cd0e61d428339088719f635b945a02525d3a60a4
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-03-15 18:22:06 +01:00
niyasraphy eee5527840 [IMP] hr_work_entry: improve hr.work.entry pivot view
before this commit, the pivot view of hr.work.entry model
is not showing the details by default.

after this commit, the pivot view will be expanded by
employee and work entry type and duration is added
as measure for the pivot view.

closes odoo/odoo#115303

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-15 16:08:20 +01:00
Rodolpho Lima 33e54a4feb [FIX] mass_mailing: deactivate snippet overlay on codeview
Before this commit, when toggling the codeview in mass_mailing (debug=1),
the overlay that highlights the selected snippet is not deactivated.
This results on the blue rectangle being seen on the codeview when the mouse
cursor is hovered over the corresponding position.

This commit deactivates the current snippet overlay when the codeview is
toggled.

closes odoo/odoo#115299

X-original-commit: ec8070adb38d092d743679c2dd30872424d46e9d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-15 16:08:17 +01:00
Rodolpho Lima bb5abc8d80 [FIX] web_editor: avoid toolbar update if selection outside editable
When the selection is outside the editable and the `autohideToolbar`
option is false, `_updateToolbar` will perform computations in order to
update a toolbar that is not visible.
In fact, trying to do so can lead to a traceback, as `getComputedStyle`
is called with a null argument when the selection is not contained in
the editable.

This commit avoids such useless computations and tracebacks by returning
from the function when the selection is not inside the editable element.

task-3171892
opw-3161789

X-original-commit: d4b13a147f2a69628c050a04655452fcb2e6d759
Part-of: odoo/odoo#115299
2023-03-15 16:08:17 +01:00
Paolo Gatti (pgi) a03549d771 [IMP] account, account_edi, l10n_it_edi: allow link from imported VB to PO, fixes
Every imported vendor bill now will have the chance to make its invoice_origin linked to a Purchase Order.
The function is moved from account_journal to account_edi_format to allow the link being done from all webservices, thread attachments and upload.

- Avoid mocking the proxy testing

The test on the check that the same attachment is coming twice from the proxy doesn't actually need to test the proxy. By splitting the function, we avoid mocking the proxy for no added value. Added an ir.rule for companies to only look for their account_edi_proxy_client.users

- PA Index label should be Destination Code

PA Index is a completely wrong description. This is the destination "address" of the partner at which our EDI documents (invoices) should be directed to inside the SdI e-invoicing system, much like an IP address. It's not an index, doesn't have much to share with the Public Administration. The correct literal translation of the name should be "Destination Code"
for Codice Destinatario. We have clients opening tickets because they don't recognize this field on the partner form because of the wrong translation.

- Fixes on taxes import

Lines didn't have their taxes cleared, so invoices actually added the taxes in the XML to the default supplier taxes of the product VAT taxes on import search was conflicting with actual withholding / pension fund taxes, so extra conditions are added in the search if withholding / pension fund fields are not specified

Task link: https://www.odoo.com/web#id=3175353&model=project.task
Task-3175353

closes odoo/odoo#114870

Forward-port-of: #111365
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-15 16:08:08 +01:00
roen-odoo bfe6f3e9b0 [FIX] point_of_sale: correct starting balance for rescue session
Current behavior:
The rescue session are created with a starting balance of 0.00. When the
starting balance should be the end balance of the previous session.

Steps to reproduce:
- Open a POS session on 2 different browsers
- Make an order on the first browser, and close the session
- Make an order on the second browser, and close the session
- The second browser's session will be in rescue mode and the starting
  balance will be 0.00 when it should be the end balance of the first
  session.

opw-3136236

closes odoo/odoo#115258

X-original-commit: 265817f7d7d096be4a84a7dd710c1dabb93fe402
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-03-15 13:19:58 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Nasreddin Boulif (bon) 6ada660005 [FIX] web: trigger rendering on change after download attachment
Steps to reproduce:

  - Install Sales modules (for test purpose)
  - Open any quotation
  - Click on "Send by Email" button
  - Download the attachment (in the bottom of the modal)
  - Try to add an other partner to recipients

Issue:

  Chrome: The partner is not added (visualy) to the recipients.
  Firefox: After downloading the attachment, the page is stuck on
  "Loading...".

Cause:

  When downloading the attachment, since it's a link, the browser
  think at first that we are going to change the page, and therefore
  trigger the "beforeunload" event.
  Doing so will call the `urgentSave` method that will set the
  `_urgentSave` attribute to true, and then notify to render.

  When we try to add a partner to the recipients, since the
  `_urgentSave` attribute is set to true, it will not trigger the
  rendering of the view.

Solution:

  Add `download` attribute to the links, so the browser will open the
  attachment in a new tab, and therefore will not trigger the
  "beforeunload" event.

opw-3176996

closes odoo/odoo#115205

X-original-commit: a6d3fb842c4bb2adc2bab5d65c12ceca352ea2cb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-03-15 12:19:57 +01:00
Jorge Pinna Puissant 745d67cfa8 [REF] mrp: MrpTimer and MrpTimerField
Since [1], [2], [3] and [4], the field API was simplified and specified.
Some props were removed (update, type, setDirty and value) and some were
now mandatory (record and name).  This specification make it difficult
to use the fields as a "normal" component (without a record). This was
the case with MrpTimer, that was used as a field, but also as a
component. To solve this issue, in this commit, we divide it in two
different components, MrpTimer and MrpTimerField.

[1]: https://github.com/odoo/odoo/commit/aed1ba484d0c48a59e166ef01e69967bd618a562
[2]: https://github.com/odoo/odoo/commit/8cde3e84bb70a2bd097921c08c0059bf65bee602
[3]: https://github.com/odoo/odoo/commit/688986f888f2fe2371d58b74ded81315ba6bb353
[4]: https://github.com/odoo/odoo/commit/91303252f413325859a6f1651d056593a8cf6382

closes odoo/odoo#114761

Related: odoo/enterprise#37960
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-15 12:19:52 +01:00
Christophe Monniez 48fac32738 [IMP] core: bump master release to 16.3 alpha 2023-03-15 12:18:56 +01:00
Pierre-Yves Dufays 9417edb707 [FIX] website_slides: fix resource download file extension
To reproduce the problem:
- ensures python-magic is not installed. It is used to guess the mime type of
a file. The code uses an alternate solution if not present and this is that
alternate version that's unable to guess the mime type of an xlsx file.
- in website_slides, open a course
- open a content
- go to the "Additional Resources" tab
- add an xlsx file
- remove the extension of the file in the name
- open the public website and open that content
- click on the link of the file you just have added
- instead of a xlsx, you get a zip file

This fix solves the problem by using the extension of the file uploaded if it
is valid.

Technical note: prior version 16, the mime type stored in the attachment was
used to determine the extension of the file when downloading it. From version
16, if the extension is missing in the file name, the system tries to guess it
using python-magic if installed and a custom implementation if not:
_odoo_guess_mimetype. The custom implementation doesn't support the detection
of xlsx files (and other formats) while python-magic supports it. That's why
the problem described above only appends while python-magic is not installed.
To solve the problem we have added in the download URL the file name as the
the name of the resource with the extension of the file name uploaded
(extension not added if the name had already the same extension as the file
name).

Task-3200998

closes odoo/odoo#115273

X-original-commit: 3a7388a69991d968c349133be4ac52745bbac65b
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-15 11:00:10 +01:00
Kamlesh Pathekar 683365021f [FIX] hr_timesheet: fix the project sharing traceback
Steps:
- install hr_timehseet module
- Share any project
- Go to the portal and open the project.

Issue:
currently,timesheet_uom service is not added in project webclient so
service not found.

Fix:
In this commit, we have added timesheet_uom services in project webclient.

closes odoo/odoo#115271

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-15 11:00:07 +01:00
yhu-odoo dc1dd645b6 [FIX] stock: Difference not counted when Enter with 0
In odoo/odoo#112978, it missed the case when 0 is entered (and no
Counted Quantity already set).

On inventory adjustments, when Counted Quantity is 0 and then press
"enter" or "tab", the difference will always set to 0. The compute
function for inventory_diff_quantity is not triggered in this
situation. We manually update the value in this case to trigger the
compute function.

opw-3177578

closes odoo/odoo#115252

X-original-commit: b4b90ff5702d18cc17d74d04e12e3cf11e205e9f
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-15 09:54:59 +01:00
Maruan Aguerdouh (magm) 1274eb4c94 [FIX] website_livechat: fix traceback when giving review without any operators availables
Steps to reproduce:

- Install Discuss and Livechat.
- Open a window without logging in and trigger the Livechat.
- Select the "I have a pricing question" option, and it should tell you
that there are no operators availables.
- When it asks you for your email just type anything, and try to close
the window.
- When you have pressed on the "x" it should ask you to review the
service you had, select any of it and close the window.
- Now log into the database and go to the livechat app and go to the
livechat channel where we did the review, and inside it try to "Go to
Website".

Issue:

Traceback will be raised, caused of the review we have done which is not
asigned to anyone in the support team.

Solution:

When can handle this, and just still take into account the review we
just had (current fix). Or we should not let the user to review if we
don't have an agent to be reviewed.

opw-3143564

closes odoo/odoo#115242

X-original-commit: edc20c1d12225df9a5e169bf13abfb5a796f5236
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-15 09:54:56 +01:00
Tommy (tong) 2b81f595cc [IMP] l10n_au: update fiscal year last day, label display, etc
task-3187734

closes odoo/odoo#115163

X-original-commit: 65dacfc17bec5feba1216354c71ca542c1b762b2
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-15 07:27:40 +01:00
Julien Castiaux 9964ae2f38 [FIX] test_http: typo in test tag
closes odoo/odoo#115228

X-original-commit: 4b3e6a4e7f63f868b74894979557d9e1135c72c3
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-15 00:49:18 +01:00
ska-ibees 52b69e9de4 [FIX] project: fix wrong subtask mapping while project copy
Steps to reproduce:
1. Install module Project
2. Enable Sub-Task feature in settings
3. Create a project A and add a task with subtasks with depth level >1.
4. Duplicate project A

Issue:
Duplicated child subtasks (depth >1) are not being mapped with the newly created project(duplicated one).

Cause:
Only mapping parent task due to wrong filter values.

Solution:
If the `display_project_id` of all tasks to duplicate (subtasks
included) are linked to the project to duplicate, then the
'display_project_id' of duplicated tasks for those tasks will be
the newly created project on all child subtasks record sets.

closes odoo/odoo#115261

X-original-commit: 31a966a9a97c28c36b819e7481809f2cf4565fb5
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-14 21:54:45 +01:00
HydrionBurstandwilliam-andre 4feb7ba3c8 [FIX] translate: upgrade interraction with l10n_multilang
When upgrading a database with `l10n_multilang` installed, the
translations kept were not the right ones.
Here is the process that was executed during the upgrade:
* `base` is loaded: registry is loaded with `translate=True`, which
  calls `convert_column_translatable`. This has the effect of setting
  the value of the field to `{'en_US': name}`, with only that language
  installed.
* `l10n_multilang` is loaded: the function `lang_install` is extended to
  copy the translations of the templates on the instanciated records.
* `l10n_*` is loaded: the translation values are loaded from the `.po`
  files. `lang_install` is called after the loading on the templates,
  copying the value on the records. The value on the records is now
  something like `{'en_US': name, 'fr_BE': nom, 'nl_BE': naam}`.
* `base/end-migrate` is executed: it copies the values coming from
  `ir_translation`, without overriding the values that are already on
  the record because of the order of the `||` operator.

This means that any value inputed by the user[^1] will be overriden by
the value in the `.po` files.

opw-3175383

closes odoo/odoo#115254

X-original-commit: 5d46cdee878d752b9a61a74762a8710be0890e9d
Signed-off-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: william-andre <wan@odoo.com>
Co-authored-by: HydrionBurst <cwg@odoo.com>
2023-03-14 20:42:11 +01:00
Hansun (hale) 5f6c758adb [FIX] event{._sms}: access right for admins of event app
1. Install [Events]

2. On [Settings], create an admin for Events (uncheck all other rights)

3. Click on Events, enter an event

3. Click on [Communication] tab, and try adding a line

Issue: accessing ir.model is blocked

Solution: Find another way

Impacted versions: 15 - master

opw-3163138, 3103199, 3193659

closes odoo/odoo#115237

X-original-commit: db37a4e230f8cd6ac916fe3a21aea5ff43c61d53
Related: odoo/enterprise#38169
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-03-14 19:39:09 +01:00
Géry Debongnie 5ba1322f60 [FIX] web: owl compatibility test helper fix
The `afternextrender` helper is meant to be used in some tests that
want to do something after owl has completed all its work following
a specific action. It is useful when the action may cause some
additional renders, so waiting for one nextTick is not enough.

Unfortunately, it has a bug: it waits for Owl scheduler to be empty. But
in some cases, when a component is destroyed because of an error,
the scheduler task list will not be cleared until the next render
completes. It is implemented that way in Owl to reduce the amount of
work it does. But this means that in some testing scenarios, the
afterNextRender promise will simply not be resolved, since there is no
upcoming render to clear the tasklist.

With this commit, we just avoid the issue by ignoring the fibers coming
from destroyed component.

Note that I think that it is not a good semantic for tests, as it is a
little bit too "black-boxy". Ideally, we should rather wait for something
in the DOM. There is a waitUntil helper somewhere that may be useful for
this situation

closes odoo/odoo#115229

X-original-commit: ca8d1e7ea74120dd088c78bb4916aa994e852a0f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-14 18:09:10 +01:00
Habib (ayh) eb33fdf9d8 [FIX] account: bank statement balance default
Using the bank recon widget (enterprise), it is possible to create bank statements from the list view.
The default start and end balances were not computed.
This PR fixes that (computes the balances) and has a few additional improvements:
- A warning is added to the statement form view to indicate the problem with the statement
- Statement validity can be computed before the statement is saved, to guide the user when manually creating statements
- balance_start, balance_end_real are now computed fields
- default_get method is simplified and moved
- the action "Create Statement" is removed in favour of multi-edit
- tests and translation templates

related enterprise PR contains the necessary view changes.

closes odoo/odoo#115174

X-original-commit: dfae9e204195abc1b776b9797043ceb38318de08
Related: odoo/enterprise#38131
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-03-14 18:09:04 +01:00
Mathieu (mano) 36c85200e9 [FIX] web: tooltip question mark using wrong class
This commit replaces the `btn-link` with `text-info` since it is not a
button and the `btn-link` class should be used in pair with the `btn`
class.

Moreover, the question mark button in form view supposed to trigger the
`tooltip` box is difficult to reach since the triggering area behaves
weirdly on chromium OSX.

This is fixed in a separate commit:
d44d5e8ddea5e7e548cfe8fd74fc8e964ff088c6

This commit has been rebased to target 16.0 in accordance to the other
commit fixing the behavior of the tooltip.

task-3099734

closes odoo/odoo#115217

X-original-commit: eb3d6cc056dae842b03016c3c5084ba37242e386
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-14 17:03:38 +01:00
Ivan Yelizariev 59edbb7894 [FIX] base_automation: avoid recomputing readonly field before write
`base_automation` module patches `write` method to detect changes that trigger
the automated actions. It's implemented by reading current values before making
the write operaion. It may lead to max recursion error if compute method updates
other records. Example: in `account_asset` Depreciation values are computed for
all Depreciation Lines at the same time [1].

Fix it by breaking recursion on computed not stored readonly fields: `write`
method for such fields might be called by compute method only and hence the old
value is always equal to new value.

STEPS:

- Create an Asset model of 240 Months, Straight Line, No pro rata
- Create Assets using this asset model and confirm it.
- Create an automated action for account.move and trigger on update (Action can
be anything)
- Now try to access the Assets

[1]: https://github.com/odoo/enterprise/blob/45dd0884c84d0e8a31c2c36a975f1b1f7cf6d01c/account_asset/models/account_move.py#L39-L46

opw-3147688

closes odoo/odoo#115216

X-original-commit: 0561ad2324905aed5afd5cc163e5e6aebee09d40
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-03-14 17:03:35 +01:00
Maximilien (malb) b944808bb3 [FIX] account_check_printing: res config modification
Before this PR, the res config for the accounting page needed some UI fixes (checkbox misplaced, missing attrs invisible). This PR fixes that.

closes odoo/odoo#115212

Task-id: 3226604
X-original-commit: 33107e37cc007924fbe04d04cc2e9bdc0d3a60c4
Related: odoo/enterprise#38156
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-03-14 17:03:29 +01:00
maad-odoo afe8f31c68 [FIX] web_editor: traceback on arrow up and down in powerbox
Before this commit:

When we add a single / on editor and add any extra character immediately after
 the first / and press up/down arrow key it throws a traceback error.

After this commit

Now, if any new characters is added after the first / and press arrow key then
it does not throw any traceback error.

Task-3193362

closes odoo/odoo#115202

X-original-commit: 10fc8ecd67687f8bbdbb741664968b513063c824
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-14 17:03:26 +01:00
David Monjoie e65f7d7e30 [FIX] web_editor: remove pretty printing of ir.ui.view
The following basic case has been broken in website forever since [1] in Odoo 8:

```html
<p><span>a</span><span>b</span></p>
```

Saving the above html results in:

```html
<p>
    <span>a</span>
    <span>b</span>
</p>
```

Which, when re-rendered back in the DOM renders equivalent to:
```html
<p><span>a</span> <span>b</span></p>
```

Note the space between "a" and "b". That is because etree will pretty print
nodes with indentations as long as they do not have text content, and that
indentation is collapsed into a single visible space by the browser when
inserted in the DOM. This is not limited to span nodes as the same applies to
any inline node. This is very easily reproduced in website on any version:

- Drop a Text snippet.
- Replace all the content of the snippet by "ab".
- Put "a" in bold and "b" in italic.
- Save.
- Notice that the saved version is now "a b" instead "ab".

The user has no way of removing this space easily because even if they manage to
do it by any mean, the server will pretty print the html again and the space
will reappear. The only way to circumvent this is to have some text content as
sibling of the inline nodes.

Consider this:

```
>>> etree.tostring(html.fromstring('<p><span>a</span><span>b</span></p>'), pretty_print=True)​
​b'<p>\n    <span>a</span>\n    <span>b</span>\n</p>\n'​
```

Which is incorrect, while this:

```
>>> etree.tostring(html.fromstring('<p><span>a</span><span>b</span>c</p>'), pretty_print=True)​
​b'<p><span>a</span><span>b</span>c</p>\n'​
```

Is correct.

We could fix it using a heavy hack that would leverage this behavior by
inserting one of the few unicode control characters that etree considers to be
actual content, and therefore preventing pretty printing for this node. The
server would then remove the control character to avoid polluting the actual
views. This would have the side-effect of forbidding this control character to
ever be used in a view however, and would obviously be an extremely ugly hack.

The alternative which was chosen in accordance with Antony (al) and Xavier (xmo)
is to disable pretty printing altogether, since the original commit [1] seem to
have introduced it as a fix for an old version of the editor rather than for the
intrinsic qualities of having pretty printed views.

If we ever want to re-enable pretty printing in the future, I suggest it be
implemented in JS because the browser is the only one able to assert whether a
node is going to be treated as a block or as an inline with respect to the
current CSS rules in application.

task-3142796
opw-3122373
opw-3186250

[1]: https://github.com/odoo/odoo/commit/6b857b6eeb59137a71385f98c82c440ac82cd45d

closes odoo/odoo#115159

X-original-commit: 3c6b9249482454a931f384ffc66ceec64dffbcfc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-14 17:03:21 +01:00
Sébastien Theys e04cae82e2 [IMP] web: add disabled prop to Dropdown
With this commit, we can now customize the Dropdown component to
make it disabled.

closes odoo/odoo#115201

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-14 15:52:25 +01:00
Đặng Văn Lộc 45d9d6d324 [FIX] stock: Error if warehouse_id is given to the form view
If the developer wants to give warehouse_id form view, when create new
location, there will be an error in the compute function because it use
function split() with field parent_path has no value

closes odoo/odoo#115103

X-original-commit: 4d9b2ec6c85a178898bd81fe45bb0fcd3ba1a901
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-14 15:52:19 +01:00
Tiffany Chang (tic) b40c72da7e [FIX] product: print all product labels when multiple tracked products
Steps to reproduce:
- Create 2 SN tracked products
- Create a receipt of the 2 products, with a demand qty of 2+ of
  each product
- Create the SNs of the incoming products + validate picking
- Print Labels > 2x7 or 4x12 (with or without price) > confirm

Expected result:
2+ labels per product printed, 1 for each SN

Actual result:
Only 1st label of the 2nd product is printed, all of labels of the 1st
product are printed

Issue:
The "quantity" in:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

is structured as:
  {product, [(barcode_to_print, qty_to_print), ...], ...}
or in this case:
  {product2: [(product2_sn1, 1), (product2_sn2, 1), ...], product1: [(product1_sn1, 1), (product1_sn2, 1), ...]}

So there was a miscounting where:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L162-L164

Would set the current_quantity to 0 (since only 1 per SN barcode)

And:
https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L155-L156

would register the not (current_quantity=0) as true and quantity={product1: (...),...}
as true => move onto the next product rather than checking if there
are any more (barcode, qty) tuples to print, i.e. never reach:

https://github.com/odoo/odoo/blob/da30b41022c4f05b3abfdc3e64519d8438d25745/addons/product/report/product_product_templates.xml#L166-L167

for product2 and therefore never reach its (sn,qty) labels beyond it's
first one.

Note that this issue does not occur for the dymo or zpl labels because
they follow different, less complicated templates

opw-3199095

closes odoo/odoo#114972

X-original-commit: 54e587b272a52972a0f615a29005dcb6fdb6992f
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-14 15:52:16 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Noe Antoine 2f7d95a75e [IMP] crm: underline datepicker field in PLS settings
Make the date field always underlined in the PLS modal in
the settings, to indicate that it is editable and not a
technical constraint.

Also rename confirm button to "update".

Task-3193113

closes odoo/odoo#114223

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-14 15:52:04 +01:00
Mohit Beniwal 66cac3a7ed [FIX] inventory: invalid literal for base 10:'false' in inventory
This issue was occurring while printing the count sheets in the 'update
quantity' section of products in 'Inventory' module.

Steps to Reproduce:
- Open Inventory module and go to any product.
- Click on update quantity button.
- Click create button, select the new record without saving it.
  Then click Print > Count Sheet

To fix this we check whether it is integer or not, if it is integer then
only it will print the report.

sentry-3880400776

closes odoo/odoo#115186

X-original-commit: 2600c17859363f5ec8c1f50a73e9d1990aa762ba
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-03-14 14:39:22 +01:00
Roy Le 0cf04fdd85 [FIX] hr: cannot create a new employee on the application
Steps:
1. Create Employee A that related with user A / partner A in Sales
department
2. Create a channel Sales, set Auto Subscribe Departments as Sales
department
3. Archive Employee A / user A / partner A
4. Create a application B in Sales department and click button Create
Employee
5. An error occurred: duplicate key value violates unique constraint
"mail_channel_partner_partner_unique"

closes odoo/odoo#115184

X-original-commit: e5e2cc8e00d4aec6f76283e8c5a7e485d6e9ab63
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-14 14:39:17 +01:00
Géry Debongnie c59650fc3f [IMP] web: some autocomplete improvements
This commit introduces two small improvements to the autocomplete
component:
- the ability to autofocus the input, once it is mounted
- the ability to set an additional class to its root element

closes odoo/odoo#115142

Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-03-14 14:39:11 +01:00
Xavier Morel e37109c8c3 [REM] core: support for werkzeug interactive debugger
With the special support for postmortem debugging removed, the
likelihood of needing / wanting the werkzeug remote debugger seems
even more remote (as it works in strictly less situations, only for
frontend non-json requests).

So remove that as well.

closes odoo/odoo#115176

X-original-commit: a2022783b652299155c460294c00dbced9b619ac
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-03-14 13:30:19 +01:00
Xavier Morel 09023b6f87 [REM] core: remnants of debugger support
It's done nothing since #78857 and it doesn't seem like anyone has
cared (found no issues or tickets).

Rather than restore the feature, just remove the leftover bits.

X-original-commit: 4a7cfc8844eb9b754f16f9d013452d5bde8770b5
Part-of: odoo/odoo#115176
2023-03-14 13:30:19 +01:00
Julien Van Roy a3748a2a6a [IMP] account_edi_ubl_cii: add Singapore Bis 3 format
Add a new edi_format "SG BIS Billing 3.0" available for SG companies.
This format is based on BIS Billing 3.0.

task-3180983

closes odoo/odoo#115147

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-14 13:30:15 +01:00
Sébastien Theys e8a4f4dce8 [IMP] bus, mail: make test data more consistent
In preparation of discuss refactoring.

closes odoo/odoo#115047

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-03-14 13:30:13 +01:00