Commit Graph
164380 Commits
Author SHA1 Message Date
Antoine Guenet f3b4a2948e [REF] web_editor: abstract convert to grid tests, remove jquery
This removes calls to JQuery in the convert to grid tests and the
functions they test. In the process, these tests are abstracted for
better readability and maintainability.

closes odoo/odoo#113784

X-original-commit: 3eafc2d3425365bfb25b0540de95aab4e7d89ebf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-27 18:12:24 +01:00
Antoine Guenet f3c4f77f68 [REF] web_editor: abstract cell creation in bootstrap grid inliner tests
This commit abstracts the cell creation in the bootstrap grid inliner
tests so as to make it less wordy, easier to read, and easier to write.

X-original-commit: beceaf05f333596816623417f827ea8cdabc7097
Part-of: odoo/odoo#113784
2023-02-27 18:12:23 +01:00
Antoine Guenet 00415b2cb6 [FIX] web_editor: apply max-width to converted filler cells
When we convert a Bootstrap grid to a table, we sometimes need to create
filler cells to make sure the table has the same number of columns as
the grid. A mistake creeped into that process, and we were not applying
the max-width to the filler cells.

X-original-commit: a546eb1374bbe72606203ccd60322d5063a5de38
Part-of: odoo/odoo#113784
2023-02-27 18:12:23 +01:00
Antoine Guenet 282face688 [FIX] web_editor: ensure valid RPC call to font_to_img
When inlining e-mails, we convert font icons to images by calling the
font_to_img route with the icon's dimensions. To get the icon's
dimensions, a call is made to `convert_inline`'s `_getWidth` and
`_getHeight` functions. These functions assume that calling
`getComputedStyle` on the icon to get its width/height will return a
value in pixels. However, this is not always the case. For example, if
the icon is in a hidden element, `getComputedStyle` can return "auto"
or whatever value is set in the icon's `style` attribute (e.g.,
"fit-content"). This commit ensures the return values of `_getWidth` and
`_getHeight` are always numbers as expected.

Doing this also reveals a false negative in the tests where the grid to
convert is not added to the DOM before calling `bootstrapToTable`. Since
`_getWidth` returned `NaN` in this case, `style.setProperty` failed
silently and no max-width was set on the cells. The tests didn't account
for the missing max-width, which now suddenly appeared with this fix
(NaN failed but 0 doesn't). This commit fixes the tests by adding the
grid to the DOM before calling `bootstrapToTable`, and adding the
expected max-width to the expected result.

X-original-commit: 73b404df9be1ba28a784711174cc19e7c599099e
Part-of: odoo/odoo#113784
2023-02-27 18:12:23 +01:00
Dylan Kiss (dyki) ecfe8c890b [IMP] base: do not update country on state change
In the partner form, when you change the state of the partner address and the country remains the same, it still triggers an update on the country field.

This change makes sure that the country is only updated when it has actually changed.

task-3143841

closes odoo/odoo#111230

Related: odoo/enterprise#36386
Related: odoo/upgrade#4277
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-02-27 18:12:15 +01:00
Nicolas Bayet d42a1736ca [FIX] web_edior: prevent fix ensure_no_history_divergence crash
When record does not contain any value for a field being checked by
`ensure_no_history_divergence`, prevent the check as there is no version
to check againts.

task-3196592

closes odoo/odoo#113767

X-original-commit: 7e32b645b28164038e13393867a79672d69e4d17
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-27 17:08:02 +01:00
Achraf (abz) a1d73fef7f [FIX] web_editor: Change logger.error to logger.warning
we don't necessarily need an error type logger here, a warning is enough.
In addition, it is reported on sentry because we receive all error type logs.

sentry-3931144637

closes odoo/odoo#113765

X-original-commit: 358a85103476d25ea507f210d0fae4eef9853669
Signed-off-by: Achraf <abz@odoo.com>
2023-02-27 17:07:59 +01:00
Khoa-Jocelyn d67c0debaa [FIX] mrp_account: fix error expected singleton
If the stock move (consumed_moves) has more than 1 stock valuation
layers (stock_valuation_layer_ids), it will cause an expected singleton
error.

closes odoo/odoo#113764

X-original-commit: 2efe6bea6887ebd6528eba084eb3eaee8af7ab9e
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-02-27 17:07:54 +01:00
Benjamin Vray 6d5586801a [FIX] website: fix popup that closes when editing
Before this commit, in some instances when editing text in a popup, the
popup would close.

The issue was introduced by this commit [1]. A 'd-none' class is since
added on the 's_popup' section when the modal closes but when the widget
starts with the modal already open (e.g. during a widget refresh), the
'd-none' class is not removed from the section.

Steps to reproduce:
- Edit a page.
- Drop a popup.
- Select a word or a sentence and delete it or press "Enter" to
create a new paragraph.
- Bug => the popup closes.

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

task-3102275

closes odoo/odoo#113746

X-original-commit: fb2495d3b87223be65f98583056a070439a7df7e
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-27 16:03:41 +01:00
Lucas Lefèvre 0fa9b07d8f [FIX] documents_spreadsheet: use user timezone for pivot view
Set the user timezone to Australia/Sydney (GMT+11)
Set your computer's timezone is US/Arizona (GMT-7)

Insert a pivot view grouped by a datetime field (e.g. create_date),
The dates are messed up.

The server returns midnight in Sydney, as UTC as always in odoo
2023-01-01 00:00:00 in Sydney is 2022-12-31 13:00:00 in UTC

Since midnight in Sydney is still the previous day in UTC, we
have to convert the datetime to the original timezone to get back the
local date (2023-01-01).

If the user timezone and the computer timezone are different, using
the computer timezone is wrong because it will yield the time in
Arizona.
When it's midnight in Sydney (2023-01-01 00:00:00) it's 2022-12-31 06:00:00
in Arizona.
This is not the same day!

opw-3170077

closes odoo/odoo#113740

X-original-commit: b2f760cae74201d1622e56a0027dae67dcff9e33
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-02-27 15:00:19 +01:00
Nicolas Bayet 0d6d5883ad [FIX] web_editor: make the media modal consider mediaModalParams
When converting the field html to owl, the mediaModalParams were
not properly assigned to wysiwygOptions.

task-3097156

closes odoo/odoo#113739

X-original-commit: 1e02313ebb98c7da4823a251a8abdd4edeece7b6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-27 15:00:16 +01:00
Julien Castiaux 592f99459f [IMP] core: unit test for /web/content as public
This revision adds a unit test for the revision
55a1430016

closes odoo/odoo#113728
2023-02-27 15:00:13 +01:00
Kevin Baptiste f4045d6004 [IMP] hr_contract: contract wage field as ensure_one
The method `get_contract_wage_field()` was always called with a single
contract record, and from a functional point of view, it doesn't make
sense to call it on 2 records from different countries anyway.

task-2801710

closes odoo/odoo#113731

Related: odoo/enterprise#26373
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-27 15:00:01 +01:00
Nasreddin Boulif (bon) b3be95860b [FIX] event_[booth_]sale: don't allow event product on quotation template
Current behavior:

In a sale order: a wizard pops up to complete the link with the event
and attendee when we add an event product (same issue with event booth).

In quotation template: the wizard doesn't pop up when we add an event as
optional product.

When we create a sales order with the quotation template, the event
is added as product but the wizard still does not pop up, and therefore,
the SO is not linked to the event.

After this commit:

  Don't allow adding event (or event booth) as optional product to a
  quotation template.
  A same fix was already done on products (not optional) here:
  https://github.com/odoo/odoo/pull/100499

opw-3081853

closes odoo/odoo#113730

X-original-commit: a6bc38598f695ead9d9816b6858823b28b4ba95d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-02-27 13:56:07 +01:00
Nicolas Bayet d7ea3c1aec [FIX] web_editor: test equality of stripped values in updateValue
Since
https://github.com/odoo/odoo/commit/1b8d663cdccced35fd294ef3481aa7ce294880f0,
in `updateValue`, the `value` and `lastValue` could have different
`data-last-history-steps` and still be the same value.

This commit fixes the method to compare the values stripped of their
history ids.

opw-3134569

closes odoo/odoo#113726

X-original-commit: 5abb2ced63caffaf528f7b71eb1c193729ecd327
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-27 12:54:48 +01:00
sofiagvaladze 2810aa3422 [IMP] hr_recruitment: rename the search field
task - 3203196

closes odoo/odoo#113653

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-27 12:54:45 +01:00
Zahrah 859afd748e [CLA] signature for ZahraBadzohreh
closes odoo/odoo#113717

X-original-commit: eaf3f389806b606fc66f5f3e0322575bde1048a7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-27 11:47:16 +01:00
Jigar Vaghela ce837df5cb [IMP] l10n_in_edi*: improve invoice print
Move QR from header to next to the invoice total,
now it's look like this https://drive.google.com/file/d/1kNge9eWUc0rMD_6VIDni7F4iHDa4QAE7/view?usp=sharing
Fix the QR code size, increase the QR code pixel and give max size so the quality of the QR code is improved.

Merged waybill number and valid until date so it takes less space, same for E-invoice Acknowledgement

task - 3147187

closes odoo/odoo#113671

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-27 11:47:11 +01:00
Jigar Vaghela a14783bb90 [IMP] l10n_in: sort tax name so in invoice PDF it takes low space
task - 3147187

Part-of: odoo/odoo#113671
2023-02-27 11:47:10 +01:00
Maruan Aguerdouh (magm) c2b82c89a5 [FIX] pos_loyalty: enter code button now displayed with discount codes
Steps to reproduce:

- Install pos, pos_loyalty, sales and activate the discounts and coupons
- Create a Discount code for the POS.
- Go to the POS see panel of buttons.

Issue:

Having discount codes in active won't trigger the button for enter the
code to be activated.

Solution:

We added the discount codes (`promo_code`) to the part in
`PromoCodeButton.js` that handles when we display the button.

opw-3193426

closes odoo/odoo#113646

X-original-commit: 200cf4ffa2e18498fdda62c51f7016cf0172e273
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-02-27 11:47:07 +01:00
Xavier Morel 0d5b9d2030 [IMP] core: increase FileStorage buffer size
Closes odoo/odoo#83176

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-01-23 09:32:06 +01:00
Antoine Guenet f5c906770b [FIX] mass_mailing: ensure inlining of HTML with all required assets
Commit [1] cloned the contents of the edited e-mail to a temporary
iframe before inlining its HTML (`convert_inline`). However, the assets
were not properly loaded in the iframe, which prevented the inliner from
doing its job properly, in particular with fonts (e.g., Font Awesome
icons were not loaded so they couldn't be converted to images).
This uses the `srcdoc` attribute of the iframe instead of replacing its
HTML element with a clone of the edited e-mail's, making sure to remove
all scripts from the iframe to prevent them from running, and disabling
script execution in it as a safeguard.

Steps to reproduce an example bug fixed by this commit:
1. Start a new e-mail with the "empty" template
2. Add a "Left Logo" snippet
3. Save
-> The Font Awesome icons are missing from the saved e-mail, the font of
the text is wrong, and the image is stretched out.

[1]: https://github.com/odoo/odoo/commit/582567fa13cef3e5fee00a17ff52c623ba5422f2

closes odoo/odoo#113687

X-original-commit: 79dc6384329b1e8bd2338160d62028ac0c1cdce4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-27 09:37:26 +01:00
xO-Tx 4c03b3651a [FIX] website: fix header shadow color
To reproduce the issue:

- Website > Edit mode > Click on header
- Change the shadow color of the header to a suggested gray > it only
  works with normal colors but not grays.
- Change the header to "Header full" (it has no shadow by default)
- Add a shadow > It works
- Change the shadow color to a gray > it is reverted to no shadow.

To explain what happens exactly, let's suppose we want to set the gray
color from the custom property "--900":

When this color selected on colorpicker, the `customizeWebsiteVariable`
method will update assets to set a new user value:

`'menu-box-shadow': var(--900) ...`

But when the SCSS is compiled, the property name (here "--900") is
computed as a number which generates a wrong CSS value: `var(900) ...`

The goal of this commit is to prevent this behaviour by protecting
colorpicker variable names so they cannot be used for any further math.

task-3069518

closes odoo/odoo#113376

X-original-commit: 3e58af4bd9151f491c6a609b23f956191c594632
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-02-27 09:37:24 +01:00
luvi 7cd4c148eb [IMP] web, *: improve ProgressBarField visual state
*: hr_skills, project

This commit improves the behavior of the ProgressBar field. Before 16.0,
views had a readonly mode, and to avoid having the inputs always visible,
the user had to click on the progressbar to enter into an edition mode.

Nowadays, this is redundant, and make it difficult to guess that the field
is editable. With this commit, the input is always visible, which also
allow to improve the template and the code of the component. The commit
delete unused props/options that were no longer used by the widget.

This commit also remove a legacy scss file that was still present, and the
style of the component has been moved to its own file. Some dead classnames
have been dropped, or replaced by bootstrap classes, reducing the size of
the scss file.

Tests had to be adapted, because some assertions were irrelevant, or were
triggering the click to enter edition mode.

task #3178958

closes odoo/odoo#113002

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-27 09:37:21 +01:00
Aaron Bohy 211ad04773 [FIX] web: Many2One in dialog: open related record in dialog
The external button of the Many2one field has been changed with the
"always edit" feature of the form view, s.t. it displays by default
another icon (a right arrow) and when clicked, opens the related
record in another plain screen action instead of a FormViewDialog.

However, this doesn't work for Many2One fields that are already in
dialogs, because
 1) if it's an action dialog (target="new"), that dialog will be
    closed when opening the related record and the user loses its
    working context
 2) if it's another type of dialog (e.g. FormViewDialog), the
    related record opens in the background and the dialog remains
    open, which is obviously a bad UX experiment. This had been
    locally fixes at some places [2].

This commit fixes the issue by automatically opening the related
record in a FormViewDialog if the Many2One is itself already in a
dialog.

This commit also fixes an issue with the scenario where the related
record opens in a dialog: if there were changes done in the main
record, those changes where lost when the user clicked on "Save"
in the dialog of the related record. We now only reload the
display_name of the related record, and apply it to the model.

[2] https://github.com/odoo/enterprise/commit/ba0e95fe42696dcf44b8feddeb302f04876fcbdc

Task 3191319

closes odoo/odoo#112959

Related: odoo/enterprise#37213
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-27 09:37:18 +01:00
David Monnom (moda) c7fbae7a34 [REF] point_of_sale, pos_*: remove usage of useListener
*:point_of_sale,pos_ayden,pos_discount,pos_hr,pos_loyalty,pos_mercury,
pos_restaurant,pos_sale,pos_six

Previously, the point of sale and related modules made heavy usage of
`useListener`. This is because the pos was converted early to owl, and
in owl 1, using events to communicate between components was encouraged.

In owl 2, the decision was made to stop encouraging this way of
communicating between components, because it encourages communication
accross many layers of components, and is also hard to debug. In
addition, in owl 2, because components can have 0 or more than node,
including non HTMLElement nodes like text or comment nodes, owl removed
the implementation of useListener, as useListener relies on the presence
and unicity of a root HTMLElement per component on which we can attach
event listeners.

Another problem is that events rely on the fact that the components are
in the DOM so that the event can propagate, which can lead to issues in
some cases and in particular, in the PoS, if you load the point of sale
and switch tabs, some things will be broken because we are triggering
events, but there have not been any animation frame fired in the tab
because it's not focussed, and so owl has not mounted the component yet.

When migrating odoo to owl 2, we introduced a shim for this.el and
useListener in LegacyComponent, with the hope to remove it as soon as
possible.

This commit removes all usage of useListener from the pos modules for
those reasons. In some cases, useListener was incorrectly used intstead
of t-on, and the event was triggered and handled by the same component,
in other cases, a simple callback could be passed to a child component.
In a few cases, a method had to be implemented on the store as we wanted
this method to be available everywhere.

closes odoo/odoo#112219

Related: odoo/enterprise#36888
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-02-27 09:37:12 +01:00
Davor Bojkić - Bole 6900eba5bf [FIX] obvious change , as it is valid since 1.1.2023
closes odoo/odoo#113492

X-original-commit: dfcc91ca1844abd284386e55d1d3700ca66b4148
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-02-27 08:41:42 +01:00
Christophe Monniez dfe7bcecbf [FIX] account: adapt pypdf2 import for both versions
As PyPDF2 was bumped from 1.2.6 to 2.12.1 and made some breaking
changes, we made an attempt in 8e0564dff to have Odoo working with both
versions. This is necessary because of the imminent release of Debian
Bookworm that will provide PyPDF 2.12.1. In the meanwhile this import
broke the Bookworm nightly build.

While at it, let's remove the unused `textwrap` import.

closes odoo/odoo#113667

X-original-commit: 7431019b35ee71813ce8602f46ddc50a70c661ed
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-27 07:45:01 +01:00
Abdelouahab (abla) 0d1a074854 [FIX] mail: uncheck recipient without partner
To reproduce
============
- on website add or edit **contact us** form to create a task on a project
- fill the form from Incognito
- on project -> the created task : try to send message on chatter
- you will find the email used when filling the form with possibilty
to check it as receiver
- check the box, a dialog will open to create a Partner for this email
- close the dialog without modifying anything

Problem
=======
the checkbox will remain checked, but when you send a message no email will be sent

Solution
========
as stated in this comment https://github.com/odoo/odoo/blob/de1f701e7bd7ebb6f7ebea5c097d980039c4f904/addons/mail/static/src/components/composer_suggested_recipient/composer_suggested_recipient.js#L128-L130
we will only send the message to partnenrs, so if no partner is
created we must uncheck the checkbox.

opw-3168779

closes odoo/odoo#113701

X-original-commit: 24e6a16e349e1521fadc8c18574c15389c550f0c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2023-02-26 21:11:08 +01:00
Paolo Gatti (pgi) a8dc624635 [FIX] l10n_it_edi: cannot reset to draft moves sent to SdI
If there's a l10n_it_edi_transaction id on the move, then the move
has been sent to the SdI and it has received no rejection yet.
So we avoid showing the Reset To Draft button in that case.

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

closes odoo/odoo#113694

X-original-commit: dc088f2dabc369a3c7a00be7d20e81a56aeffef5
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-02-25 16:26:39 +01:00
momegahed 01489bfab5 [FIX] sale: a missing space in mobile view
Steps to reproduce:

- go to any sale order
- force mobile view
- refresh

Bug:
there is no space between the quantity and the unit

Fix:
putting both in the same line makes odoo add the space between them

OPW-3185674

closes odoo/odoo#113273

X-original-commit: 1a0d4c32161444902467c3ec18003c24e885edd1
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-02-25 13:33:07 +01:00
Thomas Lefebvre (thle) 5da3ab038b [FIX] base, sale_project, project_purchase: convert currencies in profitability
Steps to reproduce:
- create a project with an analytic account;
- create sale orders/invoices and purchase order/bills for a project;
- use other currencies;
- go to the "Project Updates".

Issue:
The amounts are used without being converted
into the currency of the analytic account.

Solution:
Convert amounts used in the currency of the analytic account.

Note:
For performance reasons, it is acceptable to fetch all currency
on the same date to get the conversion rate.
In this case, today's date is the most appropriate
(as the project is in progress).

opw-3193676

closes odoo/odoo#113684

X-original-commit: 68b4ea69c173dd5894bcb42b99e6818f241f9734
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-24 20:14:01 +01:00
Guillaume (gdi) b1ada1af7d [FIX] website: avoid TOC test failure
This commit adds a trigger in the table of content test to make sure the
edit mode is ready before clicking on the first TOC block. This is
necessary because the test often failed on the runbot.

task-3203031
runbot-17505

closes odoo/odoo#113668

X-original-commit: 4775cfc38ed4e601c9ab6ae88c39c77299a50636
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-02-24 18:16:27 +01:00
Lois Rilo c2f499c365 [FIX] base: fix same_vat_partner_id multicompany computation.
Creating a new partner with no company selected should raise the
same VAT partner warning if there is any other partner **in any**
company with the same VAT.

closes odoo/odoo#113649

X-original-commit: 97bf59848e6e0dabda28db4b6fc1cc20844f0b97
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-24 18:16:25 +01:00
Stefan-Calin Crainiciuc (stcc) 53324c44de [REV] mrp: create productivity line before modifying workorder
Reverts https://github.com/odoo/odoo/pull/110666 because of breaking
behaviour introduced in https://github.com/odoo/enterprise/pull/35696

- Install quality_mrp_workorder
- Manufacturing > Config > Create 2 workcenters: WC1 and WC2
- Products > New Product > Name: P, type: Storable, Routes: Manufacture
- Manufacturing > BoMs > Create > Product: P, Operations Tab, add 2 lines:
- 1. operation: OP1, Work Center: WC1, Save
- 2. operation: OP2, Work center: WC2, Save
- Manual Save BoM, don't exit
- Components Tab, unlock column Consumend in Operation, add 2 lines:
- 1. Product: P1, Create and edit > type: Storable
- 2. Product: P2, Create and edit > type: Storable
- Both lines, quantity: 2.
- Each line, Consumed in operations: OP1 and OP2
- Save and exit
- Operations > Manufacturing orders > New > Product: P, Quantity: 2 > Confirm
- Workorder Tab > open first line tablet view: Quantity = 2.00/2.00 Units > Validate
- open second line tablet view: Quantity = 0.00/2.00 Units (!)

closes odoo/odoo#113574

Issue: The recommended quantity should also be 2.00/2.00
X-original-commit: 67774c967b587a660be032712b7a2369ed7abc3a
Related: odoo/enterprise#37500
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-02-24 18:16:19 +01:00
roen-odoo 70057bc721 [FIX] point_of_sale: Cash opening difference not shown in closing popup
Current behavior:
When there is an opening difference, the closing popup does not show it.

Steps to reproduce:
- Create a new POS session
- Add some cash to the register (100€)
- Close the session with the same amount
- Open the session again
- Change the cash amount in the register (80€)
- When closing the session the popup should show the -20€ difference

opw-3101297

closes odoo/odoo#113539

X-original-commit: 03860317dfcc998b5d0716d08b4267b6ee4689e5
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-02-24 18:16:16 +01:00
Anita (anko) b9975214c4 [REM] website_payment(_paypal): remove paypal quick onboarding
PayPal no longer supports receiving payments without an account.

task-3166217

closes odoo/odoo#113138

Related: odoo/upgrade#4354
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-24 18:16:11 +01:00
Morgane (morm) e095e62f4a [IMP] web_editor: different layout in mobile for toolbar
Prior to this commit, the responsive behaviour of the toolbar was a
scroll-x.
I added conditions with widget.isMobile(), to allow the layout to change
in mobile (ex: all the list options in a dropdown).

closes odoo/odoo#110161

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-24 18:16:05 +01:00
David Monjoie 6b974fd540 [IMP] web_editor: make isMobile accessible from toolbar template
The property is needed in the template for mobile design purposes.

task-3087826

Part-of: odoo/odoo#110161
2023-02-24 18:16:05 +01:00
Morgane (morm) 350e719504 [FIX] mass_mailing: fix dropdown and display issues
This commit fixes the issues in the mass_mailing module where the display
needs to be grid, and the dropdown dynamic is causing issues because of
the css rules transform and unset.
Popper.js manipulates transform and the position of the dropdown, and
in mass_mailing, its calculations are wrong.
These !important rules stops it from doing so, by unsetting the automatic
rules generated by Popper.

Part-of: odoo/odoo#110161
2023-02-24 18:16:05 +01:00
Morgane (morm) f37e089c8a [IMP] web_editor: floating bar and commandbar scss review
Prior to this commit, there were functional issues for the floating toolbar
and design issues for the Powerbox in the web editor.

This commit fixes those issues, like alignement for the icons in the list
of the commandbar, box shadows, and the responsiveness of the floating
toolbar on mobile.

In commit [1], the toolbar dropdown had the display static added, but it
causes problems to the responsiveness.
This commit put the display back to dynamic on the dropdown and so, fixes
the dropdown not showing on mobile because of the overflow-x on auto.
The dynamic state also allows the dropdown to change direction (dropdown
to dropup) when there's not enough space for the content of the dropdown.

Would be nice to have : use display state on the all the editor
toolbars (frontend and backend) to modify the layout of the toolbar for
mobile, for a better behavior and design (ex: the different lists in a
dropdown).
For now, it's just a horizontal scroll.

[1]: 459d4e27a8

task-3087826

Part-of: odoo/odoo#110161
2023-02-24 18:16:04 +01:00
Anita (anko) 1d846c36d9 [IMP] payment(_*): allow specifying extra allowed states
Some providers require additional allowed states due to their refund or
transaction process justifying it. Until now, these extra states were
specified in the `payment` module, which was not ideal as it allowed
every provider in every flow to accept these additional states.

With this commit, additional states are now specified only in the
coresponding flow of a provider that requires them.

task-2869678

closes odoo/odoo#107110

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-24 18:16:00 +01:00
snd 4ab6f383e1 [FIX] mrp: translate blocking reason
Blocking reasons on workorders are not translatable, this fixes that.

closes odoo/odoo#113641

Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-02-24 17:13:13 +01:00
amdi-odoo deaf9939b5 [IMP] survey: add every question type filters
Purpose
=======
Improve the results page filter to allow the filtering
on questions of type text_box, char_box, numerical_box,
date and datetime.

Specifications
==============
Updating the URL filters representation to avoid passing the
question types directly in the URL parameters.

Answer matching per question type:
- char_box, text_box: 'ilike'
- numerical_box, date, datetime: '='
Adding a new filter restricts the current filter results.

Handling the filters depending on the 2 different answer models:
'survey.question.answer': matrix, simple_choice, multiple_choice
'survey.user_input.line': char_box, text_box, numerical_box, date,
datetime.
The filters can be combined but their query count doesn't add up
if their related answers data are stored in the same model.

Task-3138245

closes odoo/odoo#110252

Related: odoo/enterprise#36383
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-02-24 17:13:05 +01:00
Sébastien Geelen (sge) aa252adf4f [ADD] web,mail : new dynamicplaceholder tour
Add a tour that test the basics of the dynamic placeholder
dropdown functionality.

task-3081325

closes odoo/odoo#109326

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-24 16:09:45 +01:00
Sébastien Geelen (sge) eae20c47eb [REF] web,web_editor,mail : dynamicplaceholder hook
Refactor the Dynamic Placeholder hook to have better
separation of concern from the Field that need it.

task-3081325

Part-of: odoo/odoo#109326
2023-02-24 16:09:45 +01:00
Sébastien Geelen (sge) 3e5d16967f [FIX] web_editor: strip history ids in isDirty
The presence of the history ids in the html resulted in false
positive in the  `_isDirty()` comparison. This lead to unwanted
writes when switching records, even when no change were made.

task-3186072

closes odoo/odoo#113633

X-original-commit: dcd3a538ecd4d7dc35bd7de6a8e2655e7392660a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-02-24 14:20:41 +01:00
Julien Van Roy 6938ff40d0 [FIX] account_edi_ubl_cii: float_repr should not be used for rounding
The `format_float` function is calling `float_repr`, which should not be
used for rounding operation (see its docstring). Instead, we should use
the `float_round` function.

opw-3171987

closes odoo/odoo#113631

X-original-commit: 0267c0d11ad1a5882aa5520bbf9455156b83149c
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-02-24 14:20:38 +01:00
Mathieu Duckerts-Antoine 965fed0cd6 [REF] *: add dialogService in setupControlPanelServiceRegistry
From a practical point of view, it seems better to also add the
dialog service in the service registry when calling
setupControlPanelServiceRegistry.

closes odoo/odoo#113610

Related: odoo/enterprise#37510
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-24 14:20:30 +01:00
Benoit Socias dafb99681d [FIX] website, website_sale: prevent Chrome from selecting hidden tabs
When selecting the content of a tab with Chrome, if the selection
reaches the end of the tab content and there is additional content after
the Tabs snippet, the selected range also includes the next inactive
tabs that are hidden. Because of this, when replacing that selection,
the next inactive tabs are removed, and the Tabs snippet is corrupted.

This commit avoids this by including the `.tab-pane`s in the read-only
areas while including its `.oe_structure` in the content-editable areas.
This makes the selection adjustment mechanism stop within the active
tab pane.

Steps to reproduce:
- Use Chrome.
- Drop two Tabs blocks inside a web page.
- Select the first tab of the first one.
- Select the last word, including the dot. (Double-click the word and
  drag beyond the dot before releasing the mouse button.)
- Change the selected text's color.
=> The content of the second and third tab also had the chosen color.

- Select the text in the first tab with a triple click.
- Type something to replace the text.
=> The content of the second and third tab were removed and clicking
on the tab's header did therefore not reach them anymore.

opw-3117305

closes odoo/odoo#113624

X-original-commit: fd57dae13179c286da99749e77a3b26efd2f73f2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-24 13:17:06 +01:00