Commit Graph
160697 Commits
Author SHA1 Message Date
william-andre 209e2ebb04 [FIX] account: compute of the name issue when no tax
When posting a move without any taxes, and hashing in version 3,
as in the test `test_account_move_hash_versioning_3`,
there was a case when the move could have its name changed after
posting, and so, after hashing.

The issue came from the order of computation of the name, as
we gave the name in the values when we shouldn't.

closes odoo/odoo#115222

Related: odoo/enterprise#38163
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-02 14:47:02 +02:00
gawa-odoo 15b2c690e1 [IMP] account, l10n_ar: do not put default product taxes on aml
If there are no default taxes on product or account, or
predictive guess, there should be no default taxes on a new aml.
So the `account_sale_tax_id` (and `account_purchase_tax_id`)
field only concern new products (as specified in the tooltip
of the field).

In Argentina, there is a constraint so all lines should have
a tax. So, we need to add default tax on their demo products.
We also add it to the products in account demo to have taxes
by default on demo invoices for all localizations.

task-3045026

Part-of: odoo/odoo#115222
2023-05-02 14:47:02 +02:00
PNO 7afd929433 [FIX] stock_account: _should_be_valued doesn't return bool
_should_be_valued should always return a bool.
Currently, when it's False, it returns False. However, when it's True, it returns self.company_id.
After this fix, it returns True instead of self.company_id.

closes odoo/odoo#120182

X-original-commit: 44430635936dd33b291d9d8514cef9b0013507e5
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-02 13:41:46 +02:00
FrancoisGe d0bb3554c1 [FIX] web: fix advanced search comparison test
This commit adds a patchDate to the "Several date filters and a comparison"
test. The patchDate will allow the date to be fixed and prevent the test
from being invalidated when the month changes in the real world.

closes odoo/odoo#120231

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-02 11:22:17 +02:00
Moises Lopez - https://www.vauxoo.com/ d08043ea73 [FIX] requirements.txt: unpin pytz
On Debian based systems, the `tzdata` package is maintained to reflect changes
in timezones and there is no need to upgrade the `python3-tz` package.
On the other hand, for those who are using `pip` and thus our `requirements.txt`,
the package needs to be up to date. By unpinning it in the requirements.txt:

- new installations based on pip will be up to date
- older installations based on pip can easily upgrade
- debian based installations have to maintain the tzdata package
- mixed installs like on runbot will rely on Debian tzdata

closes odoo/odoo#117527

closes odoo/odoo#120155

closes odoo/odoo#120205

X-original-commit: bb0fe71388c04cf26884eba89d2e0d9d0c00a185
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-04-30 11:56:41 +02:00
Géry Debongnie 425f0fc115 [IMP] web: update owl from 2.1.2 to 2.1.3
Commits:

[FIX] components: properly differentiate t-call subcomponents
[REF] devtools: Better messages forwarding
[FIX] devtools: Fix app methods patching
[DOC] Fix a code bug in the example of slots

See https://github.com/odoo/owl/releases/tag/v2.1.3

closes odoo/odoo#120196

X-original-commit: c44d944192fb583aa3fdfa43a5b175c90907525d
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-29 14:10:08 +02:00
Xavier ALT 513df115b1 [FIX] website: consider menu active even if extra qs found in URL
Commit [1] made sure that to be considered active, the current page URL
should have the same query strings as the ones defined in the menu URL
(if any).
But it was not fully accurate as extra query strings on the page URL
would make the menu not active even if the menu URL query strings would
be found in the visited page URL.

With this commit, when trying to determine if a website.menu is active,
we only take into account the subset of menu's query arguments.

For ex, a menu with an url of `/my-page?country=BE` should be
considered active if the request url is:
`/my-page?country=BE&utm_source=marketing-campaign&utm_medium=email`

[1]: https://github.com/odoo/odoo/commit/065ca15

closes odoo/odoo#120188

X-original-commit: bc1f2c092122e171950348c3e32438e8b862f231
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-04-28 21:33:30 +02:00
Brice bib Bartoletti 24ce0949f4 [IMP] account: add activities views
This commit is adding the activity views and columns to a lot of the basic
accounting views.

closes odoo/odoo#120140

Task-id: none
Related: odoo/enterprise#40554
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-28 21:33:28 +02:00
Mathieu Walravens 1d87710fdc [FIX] http: rewind file upload on serialization failure
Before this commit:
When uploading a file, if the transaction fails due to a serialization
failure, Odoo will retry the request. However, if a file upload is read
during the transaction, the file pointer will be at the end of the file,
and calling `.read()` again returns an empty bytes object.

After this commit:
Upon retrying the request, rewind uploads to the beginning of the file,
if the file supports it.

opw-3228200

closes odoo/odoo#120180

X-original-commit: ac59ef0668122ad71dffbb5575250c767a0a56ec
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-04-28 20:29:55 +02:00
Hubert Van de Walle (huvw) a3a1043e22 [FIX] web: use the correct inputmode for fields
Steps to reproduce
==================

- Use an IOS device
- Open a view with a float field
- Try to edit it

The virtual keyboard displayed is missing a dot, so you can only input
integers

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

For fields that should accept a float value, the inputmode attribute
should be decimal.
Also, specifically on IOS, even with the inputmode set to decimal, it
isn't possible to enter a negative value.

> decimal:
> Fractional numeric input keyboard containing the digits and decimal separator
> Devices may or may not show a minus key (-)

Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode

Solution
========

For IOS, remove the inputmode attribute so that the default keyboard
shows. For other devices, use the decimal/numeric value depending on
whether a float should be accepted.

opw-3269275

closes odoo/odoo#120129

X-original-commit: fb37550715034e7a1fbe751889cd8ea2bd6e4128
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 17:23:06 +02:00
Maryam Kia cd6f3e6373 [FIX] mail: sudo on message in link preview controller
closes odoo/odoo#120116

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 17:23:03 +02:00
Kevin Baptiste 2717c41eb4 [FIX] hr_holidays: check allocation status
opw-3289147

closes odoo/odoo#120082

X-original-commit: 3fb278caabfb5dc5f92d79e2fb3aee9433bf0d94
Related: odoo/enterprise#40508
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-28 17:22:58 +02:00
Ivan Yelizariev 9c81dfc491 [FIX] website_sale: clean RTL mess with Comparison Price feature
Odoo 16 has new feature *Comparison Price*. It allows to show striked price
after the main price. E.g. `$555 -$666-`.

It doesn't work well however on using RTL languages because of *Unicode
Bidirectional Algorithm*. For example, in Egyptian localizations it shows some
mess of striked and not striked characters: `LE -LE-666- 555`. The correct
display should be `-LE-666- LE 555`. (Examples are even more complicated with
symbol E£ that is currently used by default for EGP).

As a solution, use `<bdi>` element to isolate stiked value. Also we have to use attribute
`dir="inherit"` to avoid changing direction for currencies that use LTR
characters, otherwise the result would be `-666-LE- LE 555`.

STEPS:

- Go to settings > website: Activate *Comparison Price*
- Go to Sales > Pricelist: add extra pricelists with EGP currency and mark it
as **Selectable**
- Go to Setting > Languages: activate the Arabic language and add it to the website.
- Go to the product form: add **Compare to Price**
- Go to the website > products, select pricelist EGP

opw-3188129
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi

closes odoo/odoo#120102

X-original-commit: 26b2c5caa8c339ca6b341de317ae289b0d201b01
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-04-28 16:04:46 +02:00
svs-odoo e675a1e59f [FIX] mail: mail activity deterministic order
Adds `id` in the `mail.activity`'s order to force deterministic order in
case multiple activities have the same deadline.

Not having a deterministic order can cause issue when tests check
activities' values but don't ensure they are sorted also by id.

closes odoo/odoo#120034

X-original-commit: b0a99bde8efef287f3ed89afb9da2a67233d4bd8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 16:04:38 +02:00
Mathieu (mano) 3e683cc716 [IMP] web_editor, website: add minor design improvements to the editor
This commit gives a small refresh to the web_editor UI. To do so we
remove the borders from the buttons and inputs. We also increase the
border radius to 4px instead of 2px. The nested menus such as in Themes
tab now have the same  background color than the rest of the UI.

The box shadows on the `we-title`, `we-customize-block-options` and the
checkbox switch have been removed.

All the buttons and select components are now taking the full available
width. The inputs fields remain unchanged except their font which is now
set to sans-serif.

Finally a `<div>` have been added to the replace media snippet to make
it consistent with the other buttons having an icon. Maybe in the future
we'll need a better way to define those.

task-3265187

closes odoo/odoo#119697

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-28 16:04:35 +02:00
Benjamin Vray 33b86b26e3 [FIX] web_editor: fix resizing and padding options of snippets
Since this commit [1], the resizing and padding options of snippets are
not functioning properly in the website's edit mode.

For example, if a user wants to increase the width of a column to the
right, nothing happens. The user must first reduce the column by moving
to the left with the mouse before being able to increase it to the
right. The same problem occurs when attempting to adjust the padding
using the handle buttons.

This issue was caused by a numeric value ('key') being changed to a
string.

[1]: https://github.com/odoo/odoo/commit/800223ae7c5891bf700d45eb6d5f541093dc273c

task-3289164

closes odoo/odoo#119681

Signed-off-by: loco-odoo <loco@odoo.com>
2023-04-28 16:04:33 +02:00
Rémy Voet (ryv) 302c7baa87 [REM] core,*: remove name_get_uid parameter from _name_search.
`name_get_uid` is unused (at least since v14) and the
documentation about it, is wrong.

closes odoo/odoo#117819

Related: odoo/enterprise#39483
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-04-28 16:04:27 +02:00
Kartik Chavda 270c4732f4 [REF] {hr,sale}_timesheet: refactor timesheet form view
Before this commit timesheet community and enterprise form view
where different from each other because of that if we want to
change something in timesheet form we have to do change in both
view and sometimes it is hard to keep track of both view.

This commit use single form view in both community and enterprise
so it'll easier to change something in timesheet form view and
it'll remove some technical debt.

task-3255754

closes odoo/odoo#117748

Related: odoo/enterprise#39343
Related: odoo/upgrade#4520
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-28 16:04:22 +02:00
Julien Alardot (jual) 272a1b9a69 [IMP] l10n_se: Update taxes and accounts
- Switch the taxes and account names to english by default
- Changes the tax names to match new taxonomy
- Account changes following 2023 BAS update
   ° Add 2024 accounts
   ° Remove 2015 accounts
   ° Several changes in names as codes

Task-3052677
Task-3122530

closes odoo/odoo#117445

Related: odoo/enterprise#39186
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-04-28 16:04:16 +02:00
det 3cdec23ab3 [FIX] hr_expense: foreign currency rework
Bugprovemnts when multi-currency is enabled, alows to
enter expenses in activated currencies. The expense is
directly converted to the company currency using same day'
rate:

- do not reset amount on currency change

- rework of the views, to show currency and related amount only
when relevant.

- remove dead code: amount_residual on expense

closes odoo/odoo#114528

Task-id: 3191597
Related: odoo/upgrade#4443
Signed-off-by: Laurent Smet <las@odoo.com>
2023-04-28 16:04:08 +02:00
David Monnom (moda) bec5c746b4 [FIX] loyalty,pos_*: reward program loading issue
Previously, when a reward was applied on a product, the product was
checked against the reward_product_ids field, which is a computed m2m
field that contains all the IDS of the products on which this reward is
available. In many cases, rewards are available on all products, causing
the computation of the m2m to fill it with the ids of all products.
This caused performance issues on all DBs with lots of products (~200k)
in all flows involving rewards.

We can't remove reward_product_ids from the data loaded in the frontend
in stable because existing JS customisations might crash if they depend
on its presence. As such, to keep compatibility with existing databases,
an ir.config_parameter has been introduced to opt into the new
behaviour. This parameter is set when creating a database so that new
databases don't suffer from this performance penalty.
For existing databases, the parameter can be set by hand if the old
behaviour is not necessary and the performance penalty is an issue in
practice, but is unset by default.

When opting into the new behaviour, the reward_product_ids field now
always evaluates to an empty recordset, and the desired behaviour should
be achieved by evaluating records against the reward_product_domain
instead. In the point_of_sale, the products available on rewards are
calculated by evaluating each product against the reward when it is
loaded. In the loyalty modules, instead of using the in operator on the
reward_product_ids field, we instead evaluate the reward product domain
against the product, which is much faster. This is always done even when
not opting into the new behaviour as the change in implementation cannot
be observed outside of timing.

closes odoo/odoo#120074

X-original-commit: 6f72d053a31aca520cbfbba2d1257568b7f7c0cb
Related: odoo/enterprise#40503
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-28 14:44:07 +02:00
Vincent Schippefiltandrco-odoo f916298bdf [FIX] base: do not fetch computed field already in cache
Before this commit if a computed field is already in cache, but not its
dependencies, `fetch` would fetch those dependencies.
This commit ensures that fetch checks first if a computed is in cache
before fetching its dependencies.
This commit also follows dependencies of computed fields, if they depend
on other computed fields.
Finally, this commit consolidates `fetch` and `search_fetch`:
they should use the same heuristics to know which fields to fetch.

closes odoo/odoo#120001

X-original-commit: 6b680c463956f929db10d4c3058c36112a67e674
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
2023-04-28 14:44:05 +02:00
f5e6494da3 [IMP] web: introduce onchange2
The purpose of onchange2() is to adress two shortcomings of onchange():
 - reduce the payload of the RPC call by minimizing the diff
 - use the "unity" format for returning the data

Because of the dependency of onchange2() on web_read(), the new method
has been introduced in module web.

closes odoo/odoo#119510

Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
Co-authored-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2023-04-28 14:44:00 +02:00
Raphael Collet 0167ac5f0c [FIX] base: res.bank.name_get() not working on new records
Part-of: odoo/odoo#119510
2023-04-28 14:43:59 +02:00
Raphael Collet 664dc3f8fb [IMP] test_new_api: add test on first call to onchange()
Part-of: odoo/odoo#119510
2023-04-28 14:43:59 +02:00
Sébastien Theys 673c926f58 [REF] mail: move channel populate to discuss folder
Part of task-3265211

closes odoo/odoo#120065

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-28 13:33:33 +02:00
Sébastien Theys 96d713cf07 [REF] mail: move channel tests to discuss folder
Part of task-3265211

closes odoo/odoo#120062

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-04-28 13:33:31 +02:00
FrancoisGe 91111f33ef [REF] web: dynamicInfo domain becomes a function
In commit 2ecfed335d, we made the decision
to pass the domain to the field during extracProps with a getter in dynamicInfo.
This strategy causes the domain to be evaluated for all fields using it
in their extractProps. Very often we want to evaluate the domain on
an event, for example when a m2o is clicked on. The permanent evaluation
when using the widget therefore implies an unnecessary computational cost
for the evaluation and prevents the use of field.domain as a default value,
as it may be present in readonly views which never need the domain to be evaluated.

We will therefore convert the getter domain into a function that can be
called when we need the domain to be evaluated. This allows us to avoid
unnecessary evaluations and we can use field.domain as the default value
in the dynamic.domain.

closes odoo/odoo#120061

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 13:33:28 +02:00
Mohit Beniwal aeb199d77f [FIX] web: prevent missing 'data' argument error while uploading empty file
DataURL returns 'data:' in Chrome for empty files which is not valid dataURLas
it expects 'data:<mimetype>;base64' . This DataURL method is used to obtain
base64 representation of the file data,. That's why the 'data' argument is
missing and error is being generated.

Steps to reproduce:
1) Open Notes and create a new Note in Chrome.
2) Add a new attachment using /image command.
3) Add an empty file.

By applying this,it will return proper format for empty file.

sentry - 3749971166

closes odoo/odoo#120060

X-original-commit: fd6b904a97e7dab6e720675d9c805ed45eacef1e
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-04-28 13:33:25 +02:00
Achraf (abz) b303b20e7d [FIX] base_import: prevent traceback of Unsupported file format text/csv
When we try to import bank statement CSV file with all required columns and
set the encoding format as koir8_r we get (ValueError: Unsupported file format
text/csv, import only supports CSV, ODS, XLS and XLSX) this error.

steps to reproduce:
    1. Go to accounting and then import bank statement.
    2. Select a csv file to import with all required columns.
    3. Set Encoding format as koir8_r and then click on 'TEST' or 'IMPORT'.
    4. The error will occur.

see this traceback: https://tinyurl.com/24bxk7bt

Applying this commit will fix this issue.

sentry-4049996747

closes odoo/odoo#120054

X-original-commit: 7270bbf589a9d3d794e399b3cf3ad18acf7a2ed6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 13:33:22 +02:00
Antoine (ande) faefae9e47 [FIX] point_of_sale: loyalty feature no name
Current behaviour:
In point of sale settings, in the Pricing section,
the loyalty feature has no name, only a description.

Steps to reproduce:
1. Head to the settings
2. Navigate to Point of Sale
3. Scroll to the Pricing section
4. One of the feature has no name
5. Only a description: "Manage promotion that will ..."

Cause of the issue:
In the field component, the nolabel attribute was set on 1,
which made sense in 16.0 before the standardization of the settings.

opw-3284475

closes odoo/odoo#120046

X-original-commit: 0331151231b5b86ca852c713a0401b98ce982606
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Demany Antoine (ande) <ande@odoo.com>
2023-04-28 13:33:20 +02:00
Alexandre Kühn e155eda05c [FIX] mail: no crash when mentioning partner after channel mention
Steps to reproduce:
- Open channel general
- type "#" in composer so it prompts "#general"
- delete "#"
- type "@" in composer

This happens because the partner suggestion part relies on raw server
data in model thread, `thread.channel`, which is erased from the
channel suggestion. This was used to detect whether partner is member
or not, in `thread.channel.channelMembers`.

This commit fixes the issue by making partner suggestion relies on
more reliable data in models, `thread.channelMembers`.
`thread.channel` is deprecated, and will eventually be removed.

closes odoo/odoo#119935

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 13:33:17 +02:00
Samuel Degueldre d11bf24dea [REF] pos*, web: make pos service start asynchronously
*: point_of_sale, pos_hr, pos_restaurant

Previously, the pos service started synchronously, but doing anything
meaningful with it needed to be done after it was "ready", meaning it
had loaded and processed the data. The reason for this is that we need
to start the services before we mount the chrome, but in the pos we want
to show the loader immediately while the data is loading. This means
that any service that depends on the pos service in a meaningful manner
has to be written in a convoluted way, where it starts as a dummy
service and then overwrites itself in the env when it's actually ready.

This commit allows to write services that depend on the pos service more
naturally, by making the pos service properly asynchronous, meaning its
dependents will only be loaded once it's actually ready. To work around
the loader issue, the loader is mounted as a separate owl appplication
with not services, this application is shown over the chrome and when
the chrome mounts, it hides the loader and destroys the loader
application after the fade-out transition.

closes odoo/odoo#119908

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-28 13:33:15 +02:00
Valentin Chevalier f18bdad78a [FIX] payment_stripe: add email for shipping partner
Before this commit, the shipping partner was created without an email
address.

After this commit, the shipping partner will be created with the email
given by the customer on the express checkout form.

closes odoo/odoo#120037

X-original-commit: 527b498811d3e3f83ca64bf58f5c0a882432bf87
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-04-28 12:26:46 +02:00
Sébastien Theys 09ac15e2dd [REF] mail: clean code for message update
As a bonus, add cross-tab update for current user in chatter.

Part of task-3265211

closes odoo/odoo#120018

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-28 12:26:43 +02:00
Nasreddin Boulif (bon) df187c4cc2 [FIX] google_calendar: sync the right description
Steps to reproduce:

  - Install 'CRM' module (for test purpose)
  - Configure the google calendar credentials on Odoo
  - Go to CRM -> Configuration -> Activity Types and create a new one
  - Set 'Meeting' as Action
  - As default note, add some bullet points:
    ```
    Hello :
      - First point
      - Second point
      - Third point
    ```
  - Open any Opportunity and create a new Activity (in the chatter)
  - Select 'Meeting' as activity type and open the calendar
  - Add a new event (description should be field with the default note)
  - Open the event (on Odoo and/or Google Calendar)

Issue:

  The description of the event is broken (bullet points missing).

Cause:

  When syncing the event from Odoo to Google Calendar, the description
  is converted to plain text (using `html2plaintext` function).
  Then, when syncing the event from Google Calendar to Odoo,
  the description is also updated locally with the remote one.

Solution:

  Don't convert the description to plain text but use
  `tools.html_sanitize` on the html content instead to sanitize it.

opw-3105194

closes odoo/odoo#119695

X-original-commit: 21f3f9aa31a44840077b80d27aaee8160b391308
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-04-28 11:18:26 +02:00
Demesmaeker 4c701ab1fc [FIX] product: only activate pricelists when enabling pricelists
Following 83c52575d0 we activated or created pricelists as soon as a
currency was activated/created/deleted, for every company that might already have another
pricelist setup done, which was quite confusing.

With this fix, we ensure this will only happen:
- at company creation
- when enabling the pricelist feature
- when enabling the multi-currency setting (only the first time, unless the pricelists were
disabled manually afterward)

closes odoo/odoo#120039

X-original-commit: 4c0146d939e40e9433794802388cf06147e716f2
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-04-28 09:53:12 +02:00
Damien Bouvy 4dbab115e2 [FIX] web: less 'in your face' kanban assignation icon
The "quick assign" feature introduced in 66321f7 can be a bit too
visible and distracting - it is after all a shortcut and should probably
not add a primary-colored button on all kanban cards it's used on.

This revision makes the quick assign shortcut only appear on a card
if it's hovered (always visible on mobile though).

ask-3292053

closes odoo/odoo#120035

X-original-commit: 198a498c83e37197a963bdb18a608834808cd096
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-04-28 09:53:09 +02:00
Guillaume (gdi) b4ba82dc20 [FIX] web_editor: correct the custom block HTML
Since [this other commit], custom blocks are not displayed correctly in
the editor. The DIV tag is not supposed to be self-closing. However,
older versions of JQuery supported it anyway (they turned `<div/>` into
`<div></div>`) Since the update of JQuery to version 3.6.3, self-closing
DIVs are no longer correctly supported by JQuery.

For example, if you type this in the Chrome console:
```
$(`<div id="divRoot">
    <div id="selfClosing"/>
    <div id="notSelfClosing"></div>
</div>`)[0]
```
JQuery will create the following structure:
```
<div id="divRoot">
    <div id="selfClosing">
        <div id="notSelfClosing"></div>
    </div>
</div>
```
JQuery doesn't parse the HTML correctly and returns a wrong structure
(the `#notSelfClosing` is moved inside the `#selfClosing`).

Note that doing `$('<div/>')[0]` will return a correctly parsed DIV.

This commit corrects the layout structure of custom blocks so that they
are not composed of self-closing DIV.

Steps to reproduce the issue:
- Edit a website page
- Drop a block
- Click on the save icon
- Click on "Save and reload"

=> The custom block is not displayed correctly.

[this other commit]: https://github.com/odoo/odoo/commit/ae1cd3d5bb99b9835501144522b71f152aaf8e34

task-3290172

closes odoo/odoo#120027

X-original-commit: fd76d59bcd08e824c4e46814d0754a225f7a1b72
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-04-28 09:53:06 +02:00
Adrien Guilliams (adgu) a38dfaa605 [FIX] point_of_sale: reduce orders to sync in cross-orders
With the cross-orders feature, whenever the PoS have to sync with
the server, it send to the servers the orders that have changed
since the last sync. The problem is that we added to this set all
the orders that we loaded from the server even if they didn't change
between the two sync. We fix this here.

closes odoo/odoo#119929

X-original-commit: 4ba8699b95325480c9ebfc0ca3c8a2433b15b87a
Signed-off-by: Monnom David (moda) <moda@odoo.com>
2023-04-28 09:52:54 +02:00
Rodolpho Lima 0026c8659c [FIX] mass_mailing: add missing tour for new mailing from campaign
This commit adds a basic tour for creating a mailing from a campaign's
"Mailing" tab, via the list view of the `mailing_mail_ids` one2Many field.

closes odoo/odoo#119918

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-28 09:52:52 +02:00
Rodolpho Lima 40b10b106e [FIX] mass_mailing: allow create mailing from campaign
The campaign's "Mailing" page displays the one2Many `mailing_mail_ids` field
in a list view. When creating a new mailing from this view, a new record is
created with the fields from the comodel(`mailing.mailing`)'s form view, which
does not have the necessary "body_html" field.

This resulted in a traceback when attempting to save changes to the newly
created record, as `MassMailingHtmlField.commitChanges` calls `Record.update`
for such field.

This commit ensures the `body_html` field is present by adding it as a
dependency of MassMailingHtmlField.

Task-3225211
OPW-3204686

Part-of: odoo/odoo#119918
2023-04-28 09:52:51 +02:00
Jeremy Kersten 855da5757f [IMP] base: widget currency, allow to force decimal_places
This commit allow to add in t-options the decimal_places.
It is useful in case all price are without decimal e.g.

closes odoo/odoo#120036

X-original-commit: 800d18f2e9f94c68ebca281c9956abb23e7e33e6
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-04-28 08:57:58 +02:00
Pierre Rousseau a449b05221 [FIX] web: allow to disable autosave on boolean toggle
Since https://github.com/odoo/odoo/commit/28e6b7eb83e4309c4e70974d947194bdca240865, the boolean toggle widget
trigger a save when the user clicks on it. This is a problem when the
widget is used in a form view opened from a o2m list, because the
record updated is saved immediately, even if the user clicks on the
discard button.

This commit adds a new option to disable the autosave on the boolean
toggle widget. To disable the autosave, add `autosave: false` in the
options on the field definition.

Task-id 3235962

closes odoo/odoo#120000

X-original-commit: b56e58dff3258698dbbf173bc6790a35a47131b0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 07:54:26 +02:00
Laurent Smet 10c46e2e76 [FIX] web: Add minimal support to x2many for relational_model
Suppose a RelationalModel instanciating a record.
On this record, trigger an onchange adding a new line on a one2many field.
=> The values of the Command.create command is not parsed correctly.

Indeed, if your one2many contains a Date field, its value will be a string and
not a Datetime object as expected.

closes odoo/odoo#119928

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 07:54:23 +02:00
luvi 5e7bc4ab85 [IMP] web: improve SelectMenu usability
This commit aims to make the SelectMenu easier to use with a better
navigation system, and the ability to select a value with the enter
key.

The bottomArea slot no longer adds a div, which could allow to use
DropdownItems in this slot, and navigate fluently from other options.

Those improvements are required by task-3134491, which will replace
a select2 input with the SelectMenu instead.

Tests have been added for the navigation behavior and the selection
with the enter key.

closes odoo/odoo#119934

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 06:56:53 +02:00
william-andre 0767e690f6 [FIX] account: import misc. operation by giving only foreign amount
Import a file with a content like this (specifying the amount in foreign
currency but not the amount in company currency)
```
Journal,Reference,Journal Items/Account,Journal Items/Label,Journal Items/Analytic Distribution,Journal Items/amount in currency,Journal Items/currency
Miscellaneous Operations,EUR March 2023,101000 Current Assets,label,,-29,EUR
,,201000 Current Liabilities,label,,29,EUR
```

The debit/credit were set to 0, but it would have been expected to compute
the amount from the foreign balance instead.

task-3287331

closes odoo/odoo#120022

X-original-commit: 5f2412ac0ebb7e5868fc6c60789914de2c213d3f
Related: odoo/enterprise#40467
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-27 20:37:52 +02:00
Ayushi Gorai c51c66805d [FIX] base_import: prevent the list out of range error
When the user uploads a file the length of the list will return 1, but when
it tries to retrieve a file which is not in the list or wants to upload another
file while the process is ongoing it will throw a IndexError.

After this commit, the race condition is satisfied i.e. now the user will not
able to upload the file while the uploading is still going on.

sentry-3938949468

closes odoo/odoo#120012

X-original-commit: 482e0034e1a5882ea1e0bc4ddb56d8ef5f5a1a92
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-04-27 18:25:40 +02:00
Hubert Van de Walle (huvw) 9fa61411c2 [FIX] sale_stock: allow to tab past an empty QtyAtDateWidget
Steps to reproduce
==================

- In the settings, check the "Reception Report" option
- Create a new quotation
- Add a line
- Do not select a product
- Press tab a few times

The focus doesn't go past the Quantity widget

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

The next item to be focused when pressing tab is selecting with the
following selector

https://github.com/odoo/odoo/blob/13745d597d03b552fe5f73ca81143a49efb8aa9f/addons/web/static/src/core/utils/ui.js#L159-L161

Since there is a tabindex of 0, the focus will try to go to the
QtyAtDateWidget

Solution
========

Set the tabindex to -1 when no value has been set

opw-3266063

closes odoo/odoo#120005

X-original-commit: 30fcb2e60fed17a473353b21bac4916e9ab77b10
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-27 18:25:37 +02:00
Sébastien Theys 3d1a21dc18 [REF] mail: move channel of message post controller to discuss
Part of task-3265211

closes odoo/odoo#120002

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-04-27 18:25:33 +02:00