Commit Graph
163215 Commits
Author SHA1 Message Date
Julien Castiaux eaff61793b [FIX] website: public user should see published pp
As the public user, browse the website where you usually should see some
profile pictures (e.g. inside the forum). All the images are wrongly
replaced by the grey avatar placeholder.

When using `ir.binary._find_record` it was checking the access rights
and raising `AccessError` early even if the record was
`website_published`.

closes odoo/odoo#113526

X-original-commit: 0611fb437b699588317919e72ccfa1c41f1245bc
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-02-28 23:49:22 +01:00
Kevin Baptiste 6419bd7f06 [IMP] hr_recruitment: no refuse reason on archive
Don't ask for the refusal reason when archiving an applicant.
Show a pill/ribbon for archived applicants.

task-3172203

closes odoo/odoo#113474

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 22:49:57 +01:00
Kevin Baptiste 1aff45e35e [IMP] hr_skills: improve resume
- Replace "CV" with "Resume"
 - Allow to choose which information to show on the resume (Contact +
   Skills)
 - Use the company colors by default
 - Minor cosmetic changes on the template (reduced margins, better page
   break, etc.)

task-3198645

closes odoo/odoo#113218

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 20:39:11 +01:00
Odoo's Mergebot 76e0b18d50 [REF] web, *: OWL conversion of gantt extensions
We bring here some fixes, refactoring that allow us to finalize the OWL conversion of the gantt view extensions done in
the PR: odoo/enterprise#37091.

closes odoo/odoo#112756

Task-id: 3184636
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-28 20:38:51 +01:00
Julien Mougenot 8f7154771b [FIX] web: allow tours to use new drag&drop helpers
Before this commit, the new drag & drop tour helpers could only be used
on the white-listed "o_record_draggable" class name. This meant that
only the new kanbans could use the "drag_and_drop_native" tour helper.

This commit allows any element using the "o_draggable" class name to use
that helper, and renames occurences of "o_record_draggable" to
"o_draggable".

Part-of: odoo/odoo#112756
2023-02-28 20:38:50 +01:00
Bruno BoiandMathieu Duckerts-Antoine 8a39822aa5 [IMP] mail: add Avatar component
We introduce a new component Avatar whose role is to allow an easy
display of an image and a display name for a user (or emplyee, ...).
A click on the image opens a chat window allowing to chat with that user.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
Mathieu Duckerts-Antoine 926c4d4769 [REF] mrp: revert partly "[IMP] mrp: adapt workorder gantt view"
Revert partly https://github.com/odoo/odoo/commit/d55e6cca0648c78ab27e0107ab7d545e9fd4972b.

Rationale: if the field workcenter_id is not found in the group_bys, the
records in a given row can be associated with different workcenters with
different unavailabilities. So if for instance two records in the same
row are related to workcenters 1 and 2 with respective unavailabilities
from Monday to Wednesday, and Thursday to Sunday, that row would be
totally greyed. This leaves the user with no interesting information.

Moreover, we are about to refactor the GanttView and we want to simplify
the API of the method gantt_unavailability, in particular we do not want
to send row records anymore.

Part-of: odoo/odoo#112756
Co-authored-by: Mathieu Duckert-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
859a289b01 [REF] web,*: OWL GanttView (part 2)
This commit acts as a setup that allows the newly converted gantt view
extensions in enterprise to work properly.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:49 +01:00
Mathieu Duckerts-Antoine efe09fd7ad [FIX] website_livechat: MockServer: patch _performRPC
The new MockServer has no _mockCallButton method. Due to an issue with
the patch function that does not reasign this._super correctly when
entering the _mockCallButton function, a crash did occur.

Part-of: odoo/odoo#112756
2023-02-28 20:38:49 +01:00
Victor Feyens 29b13cbdd6 [MOV] website_sale: move payment-specific logic to website_payment
The `website_id` field is defined in the `website_payment` but not used
for anything until `website_sale` is installed.

This commits moves the `_get_compatible_providers` override filtering
providers based on the current website from `website_sale` to
`website_payment`, where the `website_id` field is defined.

Task-3084364

closes odoo/odoo#111148

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-28 19:08:59 +01:00
maximilien(malb) 9c134ec379 [IMP] account: simplify payment term usability
v16.0 introduced a new payment term view and the possibility of an early payment discount.

However, this view and the underlying behaviour can be simplified.

- Changed the payment term view and the report invoice view to better display the installment
- Removed the balance field from payment terms, replacing it with percentage
- Simplified the due date configuration in the payment terms
- Simplified early payment discount by only enabling it on one-line payment term, so it's user-friendlier
- Moved the early payment computation on the payment term rather than the company

task-3090382

See :
Enterprise : https://github.com/odoo/enterprise/pull/36046

closes odoo/odoo#110274

Upgrade: https://github.com/odoo/upgrade/pull/4349
Related: odoo/enterprise#36046
Related: odoo/upgrade#4349
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-28 19:08:51 +01:00
Guillaume (gdi) 2874b241f4 [IMP] website: ease the header and footer visibility management
This commit doesn't introduce any functional change but allows to manage
header and footer visibility with the already existing data-invisible
system. This simplifies the code and avoids doing an RPC at the start of
the `VisibilityPageOptionUpdate` option.

Related to opw-2971181

closes odoo/odoo#107387

X-original-commit: 07fdbc8847d254498b908a1cde0d910a77666f25
Related: odoo/upgrade#4120
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 19:08:44 +01:00
Guillaume (gdi)andxO-Tx 934f413c1f [FIX] web_editor: do not update the options when destroying them
Since [1] it is visible that there is a race condition in the editor.
The race condition was caused by a call for an update of the option
visibility during the save, but the options may be in the destruction
process. This commit prevents the visibility of the options from being
updated when the option destruction process begins.

Before 16.0 (the merge of the frontend into the backend) the bug was
easily visible by following these steps:
- Drop 2 times the image - text block on a page
- Drop a popup block
- Save

=> During the save, a traceback occurs.
From 16.0 the race condition is more difficult to see but we still need
this fix because the problem is still there.

Note: this forward-port commit took time to get merged in master.
Meanwhile, two fixes related to it were merged in stable. The first one
already reached master a while ago ([2]) but had thus no effect as was
relying on this particular commit here. This is actually great as [2]
introduced a big mass mailing bug, fixed by the second fix which is yet
to be forward-ported to master. That one has actually been put as this
current commit's parent so that [2] is fixed before it can create the
mass mailing bug.

[1]: https://github.com/odoo/odoo/commit/686e011f9b54bcfe93cc22db24435d2ca9213664
[2]: https://github.com/odoo/odoo/commit/6bf3823c2996af4ec0534ff69471887ac43a8ddf

Related to opw-2971181

X-original-commit: 47cdb15082f774da0aa07e289361445ddc3a48f1
Part-of: odoo/odoo#107387
Co-authored-by: xO-Tx <mou@odoo.com>
2023-02-28 19:08:44 +01:00
xO-Tx 562c760ce8 [FIX] web_editor: prevent unwanted actions on save
Starting from [1], a `willDestroyEditors` attribute was added to prevent
race conditions caused by an update on options visibility during the
"save" (after checking the code, it seems that the issue here was caused
by the `hide.bs.modal.SnippetPopup` event which triggers the
`_onSnippetOptionVisibilityUpdate()` handler on `snippetMenu`, leading
to a traceback if editors are destroyed).
So with this fix, the visibility update will be ignored during the save
process.

[A] Note that `willDestroyEditors` is set to `true` on `cleanForSave()`
and never set to `false` after saving the content or destroying the
editors.

Another fix was added in [2] to prevent the click (before the preview
is blocked) on the page while saving, and uses the `willDestroyEditors`
attribute to ignore the click.

Now since `cleanForSave()` is called on `MassMailingHtmlField` >
`commitChanges()` and because of [A], the click will be always ignored
on this field's content.

The goal of this commit is to fix this behavior using a global
`savingContent` indicator which will be used to handle both cases
(a click on page & options visibility update) during the save.
It will be only set to `true`  during the content save.

Note: the forward-port of [1] actually took too long to reach master.
Actually [2] already reached master, having no effect as relying on [1].
This commit here will actually be merged first (preventing [2] to create
the mass mailing bug when [1] reaches master). [1]'s forward-ported
version will actually be the commit following this one.

[1]: https://github.com/odoo/odoo/commit/47cdb15082f774da0aa07e289361445ddc3a48f1
[2]: https://github.com/odoo/odoo/commit/6bf3823c2996af4ec0534ff69471887ac43a8ddf

X-original-commit: b2b8590d19e07659c6ad7c3e3afba0a848b414a5
Part-of: odoo/odoo#107387
2023-02-28 19:08:44 +01:00
Guillaume (gdi) 6007264afb [FIX] website: put the popups shared on all pages in a separate section
Before this commit, when a popup was created and the user wanted to have
this popup on all the pages of his site, the popup was moved to the
footer. Unfortunately, this caused a lot of problems:
1) We had to disable the effects on the footer when the popup opened, so
that the popup would not block the page when the footer had a slideout
effect (see original commit).
2) The popup shared on all pages was attached to a footer template so
that if after setting the popup, the user changed the footer template,
he lost his popup.
3) Putting the popup in the footer led to an important limitation which
is that it was impossible to have a popup shared on all pages on a page
where the footer is voluntarily hidden (via the page visibility option).

This commit fixes all these problems by adding a shared section
dedicated to the shared popup on all pages.

Related to opw-2971181

X-original-commit: 0f131160097deb0693d7bdb4adc43fd69ea49c09
Part-of: odoo/odoo#107387
2023-02-28 19:08:44 +01:00
Mahamadasif Ansari 9dd01bffe2 [FIX] stock: sequence_code key error when create stock pick type
KeyError "sequence_code" occurs when creating a stock picking type. This is
because there is not a key "sequence_code" in vals.

This commit added the condition to ensure "sequence_code" key
is available in vals.

sentry-3828105626

closes odoo/odoo#113849

X-original-commit: f88cd4967d0f455b246f481104090417e4ec10e0
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-28 18:08:32 +01:00
Habib (ayh) 9d86983617 [FIX] account: the comparison of the previous bank statement's closing balance vs the current bank statements opening balance is not rounded which might cause statements to be invalid
closes odoo/odoo#113844

X-original-commit: 693649f7a611478d620f8c5d67549abb5bd1ca5e
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-28 18:08:26 +01:00
det 5c28294dbd [FIX] account: make register payment works in expense
Before this commit, on the list view of the expenses,
when trying to register payment, there is a traceback.

The reason is that 'views' is a required field on record
 of type 'ir.actions.act_window'.

related: https://github.com/odoo/odoo/pull/109671/
& https://github.com/odoo/odoo/pull/110518/

closes odoo/odoo#113832

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-02-28 18:08:21 +01:00
Aurelien van Delft (avd) a3e2431073 [FIX] pos_loyalty: speedup Customer View loading in pos session
Currently, when there is a huge number of loyalty cards (>4000) for
the LoyaltyProgram for instance, loading the Customer View in a
pos session can take a few seconds. This is mostly due
to the getLoyaltyCards function in JS.

This commit adds a small cache in the form of a partner_id ->
coupon_ids mapping. This cache is a kind of like a view
on the couponCache and it allows to retrieve the PosLoyaltyCard
instances from the couponCache much faster.

opw-3145342

closes odoo/odoo#113805

X-original-commit: 2e88d9fef8e713ccc4227cd14b0fa85420d983e3
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Van Delft Aurélien (avd) <avd@odoo.com>
2023-02-28 18:08:18 +01:00
Pedro M. Baeza 90fa089013 [FIX] l10n_es: Amends on 2023 new taxes
Followup of odoo/odoo#110592

- Incorrect 0% soportado fp mapping
- Homogenize new tax names for import and intracommunity
- Incorrect tags for services import. And it should be both supported
  and subjected.

forward port of 3915e68a3077c55f6f83f744e50247075044d78b

closes odoo/odoo#113801

X-original-commit: 4b0a56e96033255d18392863129d67c87d6e3ac3
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-02-28 18:08:15 +01:00
Florian Vranckx 4ac35f1170 [IMP] auth_signup, auth_totp: isolate signup_token and auth_totp
This commit is a security reinforcement.

It applies the same logic as for the password of the user to the totp_secret and signup_token

closes odoo/odoo#113753

Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-02-28 18:08:12 +01:00
Archana Vaghasiya bf4cdcaef3 [FIX] stock: index error in stock_move while split_lines is empty
An IndexError `list index out of range`  trace back that occurs in stock/
stock_move : _onchange_move_line_ids was caught by sentry.
because split_lines list is empty when user enter blank entry  in value.

So hear we check the split_lines is empty or not.

sentry - 3942491608

closes odoo/odoo#113808

X-original-commit: 7e22d16681a68e15ba66bb2c81cd36ad19f6abff
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-28 15:59:00 +01:00
Thomas Josse (thjo) 09c2b5cdbd [FIX] survey: adding test for QuestionPageListRenderer
This commit adds a QUnit test to ensure that the colspan value for the title
column of a section in a List View is correctly computed in order to let enough
space to edit the `random_questions_count` column.

We are testing 4 scenarios:
 * Without the random column,
 * With the random column,
 * With the question_type column at the start of the row,
 * With the random and question_type columns at the start of the row.

For each scenario, we test the value of colsan of the title column and if
every editable column is indeed being edited when clicked on.

closes odoo/odoo#113564

X-original-commit: 98e6b6e932c595881c1a2e4804b505ee9eec6a63
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-28 15:58:57 +01:00
Thomas Josse (thjo) 22e3c9749b [FIX] survey: corrects progress number for random questions
Purpose
=======

Ease the edition of sections.
Make sure we display a correct progress number.

Specs
=====

There is now more space when editing the number of random
questions.
We added an icon on hover to indicate that a section is editable.

When configuring a survey as one page per question, the numbers
near the progress bar where not correct.
With this commit they now are.

Inside this commit we are overriding a function `focusCell`.
This is necessary to enable te user to edit the right column in the view
if those were moved with studio.

Now the method identifies the requested column via its name and not the
actual object.
This is necessary for section rows in which the title column is modified
with an additional parameter `colspan`, rendering the column different from
the original one.

task-2988062

X-original-commit: 737e080bd25fe9136c5606c1f77f94d6cfb0ddf4
Part-of: odoo/odoo#113564
2023-02-28 15:58:57 +01:00
Benoit Socias 1e2ff5d7f1 [FIX] website: handle search keyboard navigation manually
Since [1] when BS5 was introduced, the keyboard navigation of search
autocomplete suggestions did not work anymore.

This commit avoids relying on bootstrap and JQuery to navigate the
suggestions.

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968

task-3148871

closes odoo/odoo#112733

X-original-commit: be549b7b64a253149d55b7f73f1d1a25a29388f9
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 13:01:41 +01:00
Jorge Pinna Puissant 4a8876b550 [IMP] web: oh-snappisation
The aim of this commit is to make more warning and error dialogs behave
like the "oh snap" dialog of form views.

task-id=3126594

closes odoo/odoo#112276

Related: odoo/enterprise#37593
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-28 13:01:36 +01:00
dasz 5060163ef2 [FIX] hr,base: fix layout of simple user form, access rights on create_employee
company_id is not in the group with phone, which makes it unaligned and weird looking, you can
see that especially when HR is installed and adds a boolean with a longer label.

this commit closes odoo/odoo#111567.
task 3127608

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 13:01:34 +01:00
std-odoo e649b36a49 [FIX] web: fix boolean properties value change when editing
Bug
===
- Create a boolean property
- Close the popover definition
- Re-open the definition
> The boolean value has been change because it received the click event.

Task-3172106

closes odoo/odoo#113448

X-original-commit: 677aac62b0efb4b16afd0348c3b3b2c9b4ef65b0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-02-28 10:02:49 +01:00
std-odoo bbb20584c2 [FIX] web: use default value when creating a new property
Bug
===
Currently, the default value of a property is only used when we create
new record. But it can also be used when we create a new property.

Note that the default value is written on the property ONLY if the
property just have been created, to not update existing value on
other records (the goal is to have a behavior similar to normal fields).

Task-3172106

X-original-commit: e3099ae584cef74434fdb51f7fee2ae6250f18ca
Part-of: odoo/odoo#113448
2023-02-28 10:02:48 +01:00
David Monjoie 7c7c369237 [FIX] web_editor restore placeholder when switching records
When switching records, the editable content of the previous record
is replaced by the one of the new record. Unfortunately, there was
no code that handled restoring the placeholder in case the new
content was empty after the change as this was previously only
handled in the constructor.

closes odoo/odoo#113811

X-original-commit: a3c236ef0e047127583f6565461f0b90781584e4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-28 08:14:46 +01:00
David Monjoie 5fba47e860 [FIX] web_editor: no rerender when content is reset with empty string
This event listener was added for the `historyStep` event of the editor
in [1] as a proxy for the `input` event of the editable node. This was
wrong because the `historyStep` event is also triggered at other times
than when the user makes an input.

In particular, it is called when switching records. In such case, the
new value from props can be '' which is not suitable for edition, so
it is replaced with '<p><br></p>'. But since that happens in a function
that is going to call `_historyStep` and the editing value was just
changed to something else that the value received in props, the listener
from [1] would make it dirty and thus trigger a re-render etc.

This commit fixes the issue by modifying the listener in such a way
that it listens to the proper event it was intended to target.

[1]: f56e3bca2456f04616982a9a0e77b8d4c5a0abff

X-original-commit: 384ff11f06ba86360f1993cf0c8a17c2dbaa11de
Part-of: odoo/odoo#113811
2023-02-28 08:14:45 +01:00
vishal padhiyar 0f609527df [FIX] web_editor: missing placeholder after saving record
Before this commit:

Creating a new record and saving it afterwards does not show the placeholder in
the description.

After this commit:

You will see placeholders when you create a record and save it.

Task-3167136

X-original-commit: 793e48ae0478ead38ed6ac7c9a71228e2678e2c7
Part-of: odoo/odoo#113811
2023-02-28 08:14:45 +01:00
Thanh Dodeur 6ed01e9412 [FIX] mail: makes sound effects more resilient to race conditions
Before this commit, there were cases were play() could be called after
stop().

opw-3178875

closes odoo/odoo#113802

X-original-commit: 4aac721eedfa220057e1e5e9f4d10c129c1b64cb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-02-27 21:30:49 +01:00
Pierre Rousseau 6e45c0fd22 [FIX] spreadsheet: preload list record limit
Steps to reproduce:
- Insert a list view in a spreadsheet
- Cut & Paste the entire list to a new sheet
- On the first sheet, insert a formula, `=SUM()` which sum many records of the list
- Click on `Clear history` in the file menu (to force a snapshot and a reload)
=> There are one RPC by number of records in the SUM function, with the
limit increased by 1 each time.

The record limit (the bigger record index) is computed during the
evaluation. With a normal case, the evaluation goes through all the
cells of the viewport, collect the biggest record index, and trigger the
rpc after that.
However, in our usecase, the evaluation is not passed on the second sheet
(the one which contains the list view), so the limit is not computed.
When we evaluate the arguments of the `SUM` function, we evaluate each
argument one by one. So we evaluate a `ODOO.LIST` formula, the limit is
lower than the previous limit, so the function returns an error.
But when evaluating the arguments of a function, we stop the evaluation
as soon as we find an error. So the evaluation of the `SUM` function is
stopped, and the limit is not entirely computed.
So the first RPC will have a limit 1, then the evaluation is re-run, a
second RPC is triggered with a limit 2, and so on.

This commit fixes the issue by preloading the limit during the import of
the data and during an UPDATE_CELL.

opw-3165458

closes odoo/odoo#113789

X-original-commit: 1c5a05198542b3a40c97443b2a9ecf5fb32eb5f2
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-02-27 18:12:29 +01:00
Abdelouahab (abla) e62bd52c27 [FIX] web: hide tooltip when field is invisible
To reproduce
============
- Modify the task list view like so: <field name="partner_id" attrs="{'invisible': [('partner_id','=',8)]"/>
- the field value will be invisible if the customer is "Joel Willis" (with standard demo data)
- However the popover for the value is still there

Problem
=======
the value of tooltip is always set even if the value is invisible

Solution
========
set value of the tooltip based on condition about field visibility

opw-3177191

closes odoo/odoo#113785

X-original-commit: 5bee2125528ee1d20779112093e098eaa64cf5c0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-27 18:12:27 +01:00
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