Commit Graph
160712 Commits
Author SHA1 Message Date
Christophe Simonis 653ec8cf60 [IMP] core: enforce format of module versions
As module versions can be single digit, an upgrade script for version
`x.y.z`, is currently parsed as an upgrade script for module
version `z` in Odoo `x.y`.
However 3-digits module versions are more common than single-digit ones
and developers may expect the `x.y.x` upgrade scripts to be major-less
scripts.
This ambiguity can lift off if we accept module versions to be **only**
2-digits or 3-digits. This however make the `x.y.z` upgrade script
major-less. This can be fixed by renaming the script to `x.y.z.0`.

Part-of: odoo/odoo#118420
2023-05-02 18:06:44 +02:00
remi-filament 56d87dc792 [CLA] corporate le-filament
closes odoo/odoo#120284

X-original-commit: 44458824c6a7f8df34074b19a3b8d6fef248863a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-02 15:59:23 +02:00
Asta f9d45393fd [CLA] signature for Qlasta
closes odoo/odoo#120283

X-original-commit: d32c551e386ea2ac5ba7efeca9b70ac7ea6b79a9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-02 15:59:21 +02:00
David Monnom (moda) bed0002f20 [FIX] pos_mercury: Wrong use of popup method
Fixed the popup call. The call was made with the old method showPopup.

The call is now made with the new .add method on the popup service.

closes odoo/odoo#120274

X-original-commit: d174e6cdacfdde6973e4ced931bb7572b6bd0511
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Monnom David (moda) <moda@odoo.com>
2023-05-02 15:59:18 +02:00
tsm-odoo 0c919774ea [FIX] mail: fix non-deterministic message test
Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 15:59:13 +02:00
Fabien Pinckaers 6d102d4ee4 [IMP] base: better copywriting for 'neutralized'
closes odoo/odoo#120263

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-02 15:59:10 +02:00
Pulinckx Pierre (PIPU) 126da95642 [FIX] *: replace %d by %s when using sprintf
*: web, web_editor, payment
Before this commit, templates with %d was given to sprintf but it was not interpreted by the function
After the commit, %d are replaced by %s in templates for sprintf
Also this commit converts a last _.str.sprintf into sprintf

PR#120143

closes odoo/odoo#120143

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-02 15:59:04 +02:00
damr f481475879 [FIX] stock: allow multi-picking validation w/show reception report
Steps to reproduce:
- activate `group_stock_reception_report` in settings
- activate `auto_show_reception_report` for the "Receipts" operation type
- create a receipt w/ any product + confirm
- create a return w/any product + confirm
- select both the receipt + return in the (Operations > Transfers) list
  view > action > Validate

Expected result: both pickings are validated
Actual result: stacktrace due to expected singleton ValueError

enterprise PR : https://github.com/odoo/enterprise/pull/37518
task-3204596

closes odoo/odoo#120190

X-original-commit: b2ac4b2f30e15c4b8a50628798b2fc39d7d43331
Related: odoo/enterprise#40570
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-02 14:47:39 +02:00
Thomas Lefebvre (thle) 6ff0506658 [FIX] website_sale, website_sale_stock: prevent out of stock
Steps to reproduce:
- create a product;
- disable the continue selling option for the out-of-stock;
- do not have a stock quantity for this product.
- go to ecommerce;
- without click on the product, add it in the cart with the cart icon (on the picture).

Issue:
It is possible to add the product to the cart.
If we repeat this several times, we will create quotations.

Solution:
Hide the button if the product is a storable product
and we don't want to sell it if we have no stock.
We also check the quantity available.

opw-3148069

closes odoo/odoo#120176

X-original-commit: bf4b5962c396101f242822058b5ddf815408e3f8
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-05-02 14:47:34 +02:00
Alexandre Kühn 9cfb6fe471 [FIX] mail: no scroll on small chatter
Before this commit, when chatter message list was lower
than 2500px, the message-list had scrollable of 2500px
of height.

This happens because the area detecting present time was
always 2500px. thus making the content have this value as
scrollheight.

This commit fixes the issue by making presence area not
go above the conversation height. So if message list is
250px of height, then presence area is 250px, not 2500px.

closes odoo/odoo#120173

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 14:47:31 +02:00
David MonjoieandJinjiu Liu d0e14f6064 [FIX] web_editor: fix ClipboardJS traceback in Firefox 109
Starting with Firefox 109, a widget element prototype that is put
inside an iframe will not be instanceof its original constructor.
See: https://github.com/webcompat/web-bugs/issues/118350

This is because a node that is adopted by an iframe will have its
prototype changed to match the constructor from within the iframe
instead of its original one. This has been the case for a long time.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1470017

It largely went unnoticed because of another quirk of Firefox related
to the use of instanceof which was fixed in version 109.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1360715

Since this bug was fixed it became apparent, in the form of a
traceback, that the wrong instance of ClipboardJS was being used
in the case of Firefox, due to the forced prototype change.

This commit could be reverted once Firefox is fixed.

Steps to reproduce the issue in Firefox > 109:
- Create a new mass mailing.
- Choose the third template with "Thank you for joining us!".
- Click on the "LOGIN" button link inside the email.
- Get a traceback about a paremeter not being the right type.

Task-3186513
OPW-3172914

closes odoo/odoo#120171

X-original-commit: c0da01c716716f9d35abe9d90dad27cce1452ebb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Jinjiu Liu <jili@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2023-05-02 14:47:28 +02:00
David Monnom (moda) 439a3b1683 [FIX] point_of_sale: wrong popup import
Fixed incorrect use of the popup add function. Since version saas-16.2,
the first parameter must be the chosen popup component and not the name
of the popup as a string.

closes odoo/odoo#120101

X-original-commit: cba91da208b30b5122af3d76c4e7731555d6e0c8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-05-02 14:47:26 +02:00
Nicolas Lempereur 994ee129b7 [FIX] sale_management: quotation template+sequence=lessbug
Scenario:

- set a quotation template on a quotation that adds lines ordered with
  a sequence (eg. 3 lines with sequences 10, 11, 12)
- add lines in this quotation
- save

Issue:

The added lines have sequence 10 and the seen order changes.

This is caused by 6f11060d6afd9edce904dd34a2d415a2a2461108 that tries to
mitigate a more rare issue when there is more than one page of lines.

Solution:

Reverting the previous fix, and setting the sequence of the first line
to -99:

- when resequencing the first page, the sequence will be -99 to -60 =>
  records from the second page will not get in the first page

- new lines will be added at the end

Issues still present:

- when resequencing the second page, item from 3 pages get into it (it
  was already the case before 6f11060d6afd9edce904dd34a2d415a2a2461108)

- when adding a new line (without resequencing), it is added at the end
  and not at the beginning of the next page

But those are just behavior in any list view (as is the original issue
of 6f11060d6afd9edce904dd34a2d415a2a2461108, but since it was partially
fixed for a year, this patch try to give an in-between solution instead
of just reverting it).

opw-2833913

closes odoo/odoo#120047

X-original-commit: 621454fac58e6d079ec6dc52795548c3dadea0e5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-05-02 14:47:23 +02:00
qsm-odoo 8b9bd11e13 [FIX] website: restore wrongly upgraded countdown snippets
With the BS5 upgrade script of 16.0, countdowns' data-display may have
been converted to data-bs-display by mistake. This will fix the DOM at
page load for good measures, maybe even allowing to remove this code in
a few years as hopefully all current countdowns will have been removed
or edited (or when a proper upgrade script in a future version of Odoo
will be made, if necessary).

opw-3240041
opw-3240532
opw-3258751
opw-3272731

closes odoo/odoo#119767

X-original-commit: ce506f32e3471eea1785312d4140417eba0ce355
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-02 14:47:13 +02:00
Pablo Montenegro 4ff9458dc7 [FIX] l10n_latam_check: prevent selecting checks on payments belonging to other company
Task: 30336

Description of the issue/feature this PR addresses:
In a payment when selecting checks it is allowed to select checks belonging to different companies but it is necessary to allow only to select companies from the same company (the company of the payment).

Current behavior before PR:
In a payment when selecting checks it is allowed to select checks belonging to different companies.

Desired behavior after PR is merged:
In a payment not allow to select checks belonging to different companies

closes odoo/odoo#119755

X-original-commit: 6d6e385a37fa23597bc58a0e14cfcf08df13d57a
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-05-02 14:47:10 +02:00
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