Commit Graph
154941 Commits
Author SHA1 Message Date
FrancoisGe 39ecfcff49 [FIX] web: sort an open group
This commit solves two bugs:

1. In a grouped empty list view, if you click on a sortable column,
then a crash is displayed.

How to reproduce:
- Go to a grouped empty list view with at least one sortable column
- Click on the sortable column

Before this commit :
    A crash is displayed

After this commit:
    Nothing happens.

2. In a grouped view with at least one open group, columns that do not
have an aggregates value cannot be sorted.

How to reproduce:
- Go to a grouped list view with at least one open group.
- Click on a sortable column that does not have an aggregates value

Before this commit:
    Nothing happens

After this commit:
    The records are sorted by the clicked column.

closes odoo/odoo#102143

X-original-commit: 537bbc79fe0ce34fe8b4746bf4cc86f9ebfc8a12
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-05 09:34:59 +02:00
PoMa 16da82cbdd [FIX] account_accountant: disable bank_rec_widget keyboard nav
Keyboard navigation was misleading, and it was adding a box around
focused which was irremovable because it was injected by the browser

closes odoo/odoo#102033

X-original-commit: 519bbe4b55c907bcd71d03e34dbc706d13a2268b
Related: odoo/enterprise#32235
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-05 09:34:56 +02:00
FrancoisGe 63b8a92e9c [FIX] web: html field in list view
Before this commit, in a list view, html fields in readonly mode were
not rendered correctly. It displayed unprocessed HTML.

For the value :
    <div>Hello</div>

Before this commit, it was displaying:
    <div>Hello</div>

After this commit, we display:
    Hello

closes odoo/odoo#101253

X-original-commit: a6292c17b886996c82c797e562b725d63d4a5b7e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-05 09:34:52 +02:00
Kevin Baptiste 2d9744195c [FIX] hr_holidays: close tag
The `<span>` was not properly closed.

closes odoo/odoo#102162

X-original-commit: cb3b87f8fe66d11e1a96066a27eb3ef979bc3e39
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-05 08:34:00 +02:00
Radhika Shyara 1d9598fd08 [FIX] project: fixes missing stage changed notifications
Steps :
 - When the user is subscribed to the `Stage changed` subtype
   but not `Task in progress` and on change of stage, the users only
   subscribed to stage changed will not receive stage changed notification.

Cause :
 - When the stage is changed it will also change the kanban_state to
   in progress and due to that, it will track the kanban_state from
   _track_subtype, and the user who subscribed only stage_changed will not
   get notified.

Fix :
 - So in this commit, prioritize the stage_id changed notification so that
   when the stage_id is changed we use that one, and the in-progress won't
   be triggered, but when we change the kanban state back to progress it
   will be triggered. As in progress is implicit when changing the stage_id.

task-2818058

closes odoo/odoo#102172

X-original-commit: 4d952d679629a4a225ff208a6d018e11f14bf47e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-05 07:38:44 +02:00
Benoit Socias cbe58fd16f [IMP] website: move device visibility options onto visibility options
Before this commit the Device visibility option was on its own row
inside the options panel.

This commit moves the buttons of the Device visibility option before
the dropdown inside the main row of the Visibility option.

task-2900730

closes odoo/odoo#102154

X-original-commit: 82000acfb6f8c7884994135413dcddac5441f8b4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-05 03:23:21 +02:00
Benjamin Vray f317dd5bcb [FIX] website: fix dropdown menu closing in edit mode
Before this commit, in edit mode, it was not possible to close an open
dropdown in the header anymore.

This was due to BS5 (merged at [1]). Before, the 'show' class was added
to the dropdown menu element (the element with the 'dropdown' class).
But that changed: the 'show' class is now added on the button (the
element with the 'dropdown-toggle' class). And as in edit mode the
openings/closing of the dropdowns are handled manually in the header, it
no longer worked correctly.

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

task-3001198

closes odoo/odoo#102145

X-original-commit: f3e1dc52356164453f72827e3dc87ad903df3d0e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-05 01:18:59 +02:00
Sébastien Theys bdea645949 [FIX] mail: fix and clean display of chatter in new form views
Fix display conditions, clean duplicate code.

Follow up of https://github.com/odoo/odoo/pull/100570

And follow up of https://github.com/odoo/odoo/pull/98101/ (for the SCSS part)

task-3003947

closes odoo/odoo#102165

X-original-commit: 6c6d7ce06ed4b18162db893a0afb65e0479ee11f
Related: odoo/enterprise#32290
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-05 00:09:00 +02:00
Didier (did) 8554c9d583 [FIX] im_livechat: move checkbox "only if no operator"
task-3006024

closes odoo/odoo#102158

X-original-commit: 0e314674d4157e5f10a313ec70008ed443ce8366
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-05 00:08:57 +02:00
Mathieu Duckerts-Antoine 6b2dab4868 [FIX] web: list: allow accurate text selection
Before that commit, it was not possible to select some part only
of a input/textarea input in an editable list view.

closes odoo/odoo#102169

X-original-commit: e572c11ecfb994a474ce800e46895e9233fae64b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 23:00:42 +02:00
Aaron Bohy d9d174efc6 [FIX] web: FormViewDialog: add "Remove" button
In the conversion of the FormViewDialog from legacy to wowl, we
forgot the feature allowing to display a "Remove" button in the
footer, and to execute a custom callback when this button is
clicked. This is used for instance by the Gantt view.

This commit restores the feature.

closes odoo/odoo#102149

X-original-commit: 3eb126d0297a7e3db0cb98cd1ad9555eefaa0cfa
Related: odoo/enterprise#32281
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 22:00:43 +02:00
Aaron Bohy 78c6c70ee4 [FIX] web: FormViewDialog: handle close attr on buttons
Before this commit, clicking on view buttons with attribute
`close="1"` in FormViewDialog didn't close the dialog once the
button action was performed. This commit fixes that issue, and
ensures we do not reload the record if we're about to close the
dialog.

X-original-commit: 32d211a6fd5c121fa5f556f1d78b79421edc6f68
Part-of: odoo/odoo#102149
2022-10-04 22:00:43 +02:00
Pierre Rousseau 9d455d830b [FIX] spreadsheet_dashboard: set the first sheet as active sheet
Before this revision, the active sheet was not correctly set to the first
sheet.

Task-id 3002541

closes odoo/odoo#102148

X-original-commit: faf6cde43f5d092b8b053d4b6392c6641ec0a48e
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-04 22:00:40 +02:00
FrancoisGe afdaf8cb4f [FIX] web: create a record with the widget "many2many"
Before this commit, creating a new record with the "many2many" widget
did not allow to use a context containing a default value
for the parentID (id of the Record containing the many2many).
This value is ignored.

How to reproduce?
- Go to a form view with a field using the "many2many" widget
 with context = {"default_parentID" = ...}
- Click on "Add a new line"
- Click on "Create" (The form view should display the parentID field)

Before this commit:
    The parentID field is empty.

After this commit:
    The parentID field contains the record corresponding
    to "default_parentID".

closes odoo/odoo#102157

X-original-commit: a52eacc5397dc2f98eb052f4cd1e362a97621074
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 20:58:07 +02:00
Mathieu Duckerts-Antoine 2c60272507 [FIX] web: ModelFieldSelector: click on popover back button
Click on the back button in the model field selector popover used to
often remove too many names in the path created via the selector. For
example, starting with "partner_id.name" and clicking on the back button
in the opened popover would give the invalid path "" instead of
"partner_id". We fix that problem.

closes odoo/odoo#102156

X-original-commit: e4a7b63c68a87d7afef987e8d036d7ba9c5b6f96
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-04 20:58:04 +02:00
Mathieu Duckerts-Antoine 7db644da96 [FIX] web: DomainSelector: operator change
In a domain selector, have a selection field and the operator "is set"
selected, then change the operator to be "=". A crash occurs. This
happens because the category of operator change and thus the function
onDidTypeChange of DomainSelectorSelectionField is called with no
parameter. The same problem can happen with DomainSelectorDateTimeField.

We fix that by calling component.onDidTypeChange with the right
parameter in any case.

X-original-commit: a01c2473d93d0d123391ba0131ad505775b3c50b
Part-of: odoo/odoo#102156
2022-10-04 20:58:04 +02:00
Lucas Perais b072e1bd5b [FIX] web: form always edit: a virtual record can be discarded
Before this commit, a virtual record in form view always had the
o_form_dirty class, which is problematic when a tour ends with a virtual record.

After this commit, a virtual non-dirty record in form view doesn't have
the class o_form_dirty, and doesn't have the o_form_saved either as that doesn't make more sense.

closes odoo/odoo#102153

X-original-commit: 0041b9fd8eb75d5b680d94d491e2b9f684b2d0c1
Related: odoo/enterprise#32282
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 20:58:01 +02:00
Lucas Perais 5992fac7aa [FIX] web_tour: drag_and_drop_native: pass position to mousemove
Before this commit, the positions of the virtual pointer were not
passed to the mousemove event, preventing draggable code to correctly work.

After this commit, the Event is a proper MouseEvent, with clientX and clientY set
correctly.

X-original-commit: 2e60d1b733fd73021fb1dea490e6fa3ba2fc31d0
Part-of: odoo/odoo#102153
2022-10-04 20:58:01 +02:00
Julien Mougenot 5805ca28a8 [IMP] core/utils: make separate useDraggable hook in web
A new useDraggable hook is introduced and used in the various components that
use the feature.

It relies on the draggable hook builder which is a generic way to prepare
specific drag and drop features.

X-original-commit: cb1cfe5f5efe1b683d7fdffde3718bd8bf1bcd86
Part-of: odoo/odoo#102153
2022-10-04 20:58:00 +02:00
Julien Mougenot dc7ac937b0 [IMP] core/utils: improve sortable hook with generic draggable hook
X-original-commit: 13745d597d03b552fe5f73ca81143a49efb8aa9f
Part-of: odoo/odoo#102153
2022-10-04 20:57:59 +02:00
Lucas Perais 288623993a [FIX] web: Notebook: class set on pages should appear in DOM
Have a form arch containing
```
<notebook>
  <page class="myClass" />
</notebook>
```

Before this commit, "myClass" did not appear in the final DOM.

After this commit, it does.

X-original-commit: e886adcb38695bcfa8a9f741d4e496229fb199ff
Part-of: odoo/odoo#102153
2022-10-04 20:57:59 +02:00
Mathieu Duckerts-Antoine 75789de7e1 [REF] web: views: put FormLabel's template in xml.
This commit improves extensibility of FormLabel component's template

X-original-commit: f463f28f6d4c2487d59b713ad9118bbaf19b8d3c
Part-of: odoo/odoo#102153
2022-10-04 20:57:59 +02:00
Mathieu Duckerts-Antoine d21634c394 [REF] web: 'web.Field' template
X-original-commit: 60c7b65f7f8efd5209b9fb0166a69035fb92e911
Part-of: odoo/odoo#102153
2022-10-04 20:57:58 +02:00
Lucas Perais 36385e736d [FIX] web, x2ManyField: allowed to not have an arch set
In which case we just don't render any Renderer.
Useful when we want to render invisible fields.

X-original-commit: e77afa6266a66e9d126d9a0293bb3e0eb8fb0ff3
Part-of: odoo/odoo#102153
2022-10-04 20:57:58 +02:00
Lucas Perais 9c375b48fa [FIX] web: legacyLoadViews: correctly retrieve string from arch
X-original-commit: f1f45d2673fe87abfb8cfdd5b978f16db373b53d
Part-of: odoo/odoo#102153
2022-10-04 20:57:58 +02:00
Lucas Perais a02af5b259 [REF] web: basicRelationalModel: factorize legacyUtilities
The mapping operations between the new RelationalModel API and the
BasicModel is now done in its own file

X-original-commit: 1202610ce6946ee4b2878e19e6ee6038edc9a71e
Part-of: odoo/odoo#102153
2022-10-04 20:57:58 +02:00
Lucas Perais 5cee846bb2 [REF] web: formGroups: improve extensibility
X-original-commit: 9f64da010ef74848a3e4dd6b2c6d99365a0312c2
Part-of: odoo/odoo#102153
2022-10-04 20:57:57 +02:00
Lucas Perais 654b47e253 [REF] web: improve ViewCompiler and FormCompiler extensibility
X-original-commit: b0897a76dbbad039043b29b248ba13bfb518f45c
Part-of: odoo/odoo#102153
2022-10-04 20:57:57 +02:00
Joseph Caburnay ec2b66fb13 [REF] barcodes,web: barcode_handler and field_float_scannable to wowl
closes odoo/odoo#102150

X-original-commit: c57a0ada02bfc1f02b3516f92f87b510942c5a87
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 20:57:44 +02:00
FrancoisGe 75ca493a15 [FIX] web: click on m2o_avatar in editable/multiEdit list
The goal of this commit is to fix the behaviour of clicking on a field
with the "many2one_avatar" widget in a list view.

Expected behaviour when clicking on a field with the "many2one_avatar" widget:
- Editable list view: switch row to edit
- Multi_edit list view with selected record: switch row to edit
- Other case: open the many2one_avatar record in a form view

Before this commit, clicking on a field with the "many2one_avatar" widget always
opens the record in a form view.

After this commit, the expected behaviour when clicking on a field with
the "many2one_avatar" widget is respected.

closes odoo/odoo#102146

X-original-commit: ad597d414c59723d3c6af5dfdc1a3a41fd4f4032
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-04 20:57:42 +02:00
Romeo Fragomeli bf7997e5ee [FIX] web: quick create inputs don't take all space
Adds `width: 100%` on the `.o_field_widget` so the input it can take the
all width in the "Quick Create" form.

Also, this commit fixes the CSS selector for the `margin`
rule as in the "Quick Create" form view there is no `.o_group` anymore
on `.o_inner_group`.

Steps to reproduce:
* Go to project
* Select a project
* Click on the `Create` button => BUG

closes odoo/odoo#102151

X-original-commit: 774213758c7ddf7b74a9b370457f017e09d9bbcf
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-10-04 20:01:32 +02:00
Simon Genin (ges) a36fdc43cd [IMP] web: toggling an optional field in list view do not unselect row
Toggling an optional field was unselecting the row, but didn't correctly
copy the same bahavior than legacy when it comes to the saving and
discarding of the data being edited.

However, by simply removing the line of code unselecting the row, we get
a better ux for no cost. The user can continue the record edition after
adding or removing columns.

Note that the focus will always be reset to the first column though.

closes odoo/odoo#102142

X-original-commit: 63c87eac6173af13ec84f90a7f25f07a074197f3
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-10-04 20:01:29 +02:00
Dardenne Florent (dafl) fc4df3c0b2 [REV] web: kanban: bottom quickCreate button
This commit is the revert of #98703.

closes odoo/odoo#102116

X-original-commit: 64c0ed09f058cff9b3cebfe5480a7efd0caa7be6
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2022-10-04 19:04:25 +02:00
Rémi Rahir f0fc3ee7eb [IMP] spreadsheet: Lazy load xml templates
Since the split of components with their templates in dedicated file in
https://github.com/odoo/o-spreadsheet/commit/10e1a0ca, the templates were eager-loaded.

However, this had an impact on the size of the `assets_qweb` bundle.
This commit introduces the lazy-loading of the `spreadsheet.o_spreadsheet`
bundle since it is now achievable.

A followup of https://github.com/odoo/enterprise/pull/30609

task 2896049

closes odoo/odoo#102118

X-original-commit: 15af10c207d6a359a58b5778bd414ff7b543a020
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-10-04 18:06:43 +02:00
Denis Ledoux 01e62c051c [FIX] base: no back-end view caching in --dev xml mode
In `--dev xml` mode,
you would like the views to be loaded from their definition
in the XML file directly.

The view caching introduced in odoo/odoo#99417 prevents that feature,
as once the view has been loaded a first time, the views are returned
directly from the cache, therefore not taking into account changes
directly done in the XML file views.

Setting a conditional decorator,
disabling the caching when in `--dev xml` mode,
solves this issue.

Solves https://github.com/odoo/odoo/pull/99417#issuecomment-1241977197

closes odoo/odoo#102117

X-original-commit: 5fe1d89f4d8718df92c39a80d4b575b8d0381c19
Related: odoo/documentation#2786
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-04 18:06:41 +02:00
Denis Ledoux 3e151bf30a [IMP] base: move view related methods out of odoo/models.py
By definition, views are useless without the web client.
The web client is in the module `web`.
Therefore, in a perfect world, the `get_views` model method
and any related method should be within the `web` module,
as without it they are useless.

Let's imagine you would like to use fully in command-line,
without web client, all those view related methods are useless.

Maybe excepted for reports, as you might still like to be
able to print reports while using odoo fully in command line.

Views related method therefore shouldn't be in `odoo/models.py`.

Also, when you think about it, `get_views` related methods do not
make sense without the model `ir.ui.view`, which is loaded after
the `get_views` related methods, which also doesn't make sense.

However, moving these methods fully in the `web` module is an harder
work. For instance, there are base models, such as res.partner,
already overriding `get_view` in the `base` module,
and therefore relying on these view related methods.

As a first step, we move view related methods direcly in the
`odoo/addons/base/models/ir_ui_view.py` file, where
the `ir.ui.view` model is loaded.

This is not only a design / cleaning change,
but a required change to be able to use content of
`odoo.tools.config`, which is loaded after `odoo/models.py`.
For instance, if you want to configure a conditional decorator based on
the config `odoo.tools.config['dev_mode']`, it is not possible
to do so in `odoo/models.py` because the config is parsed/loaded
after `odoo/models.py`.
The config is loaded here:
https://github.com/odoo/odoo/blob/31de2b0a7a0921cab3c6c54045d15da46c8e6d8a/odoo/cli/server.py#L127
While, within the same file, `odoo/models.py` gets loaded through the
`import odoo`
https://github.com/odoo/odoo/blob/31de2b0a7a0921cab3c6c54045d15da46c8e6d8a/odoo/cli/server.py#L26

And we would like to put such a decorator based on `odoo.tools.config['dev_mode']`
on `_get_view_cache`, to not cache the back-end views when `--dev xml` is
passed in the server arguments.

X-original-commit: 0901adc38a724aec75676285977f1905a84ed8ee
Part-of: odoo/odoo#102117
2022-10-04 18:06:40 +02:00
Nicolas Lempereur bdc2f6e00e [FIX] mail: outlook 365 warning not hiding mail
It seems that there is a rather frequent warning that can be added to
mail received by outlook 365 and that has the form:

```
<table border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100.0%">
...Caution: This is an external email and has a suspicious subject or content...
</table>
```

The combination of `align="left" width="100%"` means that a div after
this alert will probably have a width of 0 (because the previous content
is floating to the left, and taking 100% of width so there is 0 pixel of
width remaining).

This is not an issue in general, but in Odoo this conflicts with a code
that adds scrollbar if a message content overflows (but here since width
is 0 pixel the content is just hidden).

With this commit, if we detect the code that is used in all our received
report (width=100% and float=left), we ignore the float to prevent this
issue from happening.

An alternative is to avoid Outlook 365 adding this structure in a
message (see [1]), but this is only possible if we can change the
configuration where this structure is added (eg. we can't if it is
a customer that is forwarding a mail already broken).

[1]: https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/set-up-anti-phishing-policies?view=o365-worldwide#first-contact-safety-tip

opw-2887342
opw-2925222
opw-2946587

closes odoo/odoo#102107

X-original-commit: ed7280ce8f79ff68904310ca1120cb9c5ee735ae
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-10-04 18:06:32 +02:00
Kevin Baptiste c459618b49 [FIX] hr_contract: allow archiving employee
Users with both "HR Officer" and "Contract Administrator" access should
be able to archive employees even without Payroll access.

closes odoo/odoo#102102

X-original-commit: 765a6ec16b0a3c1cd86f7fc217bfb795a788d9c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 17:01:44 +02:00
Nshimiyimana Séna d99c9ca124 [FIX] payment_alipay: format Alipay API parameter total_fee correctly
Steps to reproduce:
* setup Alipay in test mode (note that Alipay's test node only support
  one currency: the USD)
* create an invoice. Make sure the invoice's total has decimal places
* generate a payment link for that invoice
* go to the generated link
* select Alipay as the payment method and click pay.

You should be met with an INVALID_PARAMETER message.

Cause:
Alipay's doc states that the parameter 'total_fee' can only have two
decimal places. Currently, this requirement is not always respected

opw-2996278

closes odoo/odoo#102088

X-original-commit: 2e6e338e8c4e042a671814673c6f3d0e4e4f50dc
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-04 17:01:41 +02:00
Danial Sheikhani b54ab3dbf0 [FIX] website_sale: reorder quantity width
This commit increases quantity field's width to about 4 characters

task-2996494

closes odoo/odoo#102080

X-original-commit: 6bd26ba42472ad7ccee813429a9aafef47405ba0
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 17:01:35 +02:00
William Braeckman ee9a282c19 [FIX] web: fix file upload service event listeners
The event listeners were added to the upload object instead of the xhr
object making them being called before they were supposed to.

closes odoo/odoo#102061

X-original-commit: 804467d7b0a583ab36a47212d482b41d29ca2203
Related: odoo/enterprise#32247
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 17:01:29 +02:00
Louis Wicket (wil) 9cc35e276d [IMP] mail: move code from components to models (ComposerTextInput)
+ Create ComposerTextInputView model
+ Replace uses of useRef with useRefToModel
+ Replace use of useUpdate with useUpdateToModel
+ Remove dead code (ComposerTextInput._isEmpty)

Task-3001200.

closes odoo/odoo#101707

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-04 17:01:26 +02:00
Arnold Moyaux 35023260ee [FIX] stock: warehouse demo name in data
San Francisco is in data since commit 33950bfdc3
However the task aims to clear demo data but warehouse0 is the default
warehouse in data and should not have a demo name

closes odoo/odoo#101305

X-original-commit: 0fd86c9ab1bbd237b3c7cb3c22b3362612142993
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-04 17:01:21 +02:00
svs-odoo 61bc8347eb [REF] stock: convert stock_orderpoint_list to OWL
X-original-commit: 262366c693ffdb5b9d4bc3c7bef293f52bd6a344
Part-of: odoo/odoo#101305
2022-10-04 17:01:21 +02:00
Arnold Moyaux 989c6df74d [REF] stock: counted qty, forecast, json stock widgets to owl
This pr follow the framework refactoring and translate the widgets
of stock module to wowl.

CountedQuantityWidgetField needs to add an upper listener on input since
the function onChange and onInput of `useInputField` are not overidable.

Json fields had their template in the json send from the server. With
wowl, the template needs to be declare before the setup. So a new wiget
is create for each template and those widgets extends the
a common component that put the json content in the props.

co-author svs-odoo <svs@odoo.com>

X-original-commit: 350a7a0d6f4816ee75676b80a9a5b9769bf80fe6
Part-of: odoo/odoo#101305
2022-10-04 17:01:21 +02:00
Arthur Detroux (ard)andqsm-odoo 84f6010fc1 [FIX] mass_mailing, *: fix options conflicts between modules
*: web_editor, website

Prior to this commit, the template structure for declaring the snippet
options used in a specific context (website, mass_mailing, ...) made it
hard to easily modify SnippetOptions defined in web_editor.

Indeed, the structure was as below
```xml
<template>
    <t t-call="web_editor.snippet_options" />
    ... Additional Options ...
</template>
```
If someone wanted to alter the behaviour of an option from web_editor
for their module, they had 2 solutions

- To extract that option inside another template, extend that template
inside their own module, remove its call from web_editor and instead
call manually the option inside each module (preferred method)

- To impact the web_editor template directly with an extension instead
of a new primary template or override JS options using include or
replacing an option inside the registry.

The second solution was often used but created extra code to make sure
that other modules were not impacted... and it was often not properly
done. For example:

- [1] and [2] introduced javascript code inside the web_editor options
  and isolating it by checking if they are in fact, inside mass_mailing.

- [3] adds code in mass_mailing mentioning JS classes of website, and
  actually broke parallax for website (after [5]).

- [4] broke the image transform option for website (after [5]).

- [6] added some shapes for mass mailing images but ended up adding them
  for the website builder too.

- [7] created different images options for mass_mailing... but ended up
  impacting website options too. Half of those can actually either be
  put in web_editor to improve everything or just in mass_mailing to not
  break the website.

- ...

This commit tries to fix everything "the right way" in master (and will
be backported for the recent 16.0). Other stable fixes will need to be
made to restore the website options in a stable way.

To fix that, this commit changes the structure to
```xml
<template inherit_id="web_editor.snippet_options" primary="True">
    <xpath ...>
        ... Change existing options ...
    </xpath>
    <xpath expr="." position="inside">
        ... Additional options ...
    </xpath>
</template>
```
This allows each module to modify the existing web_editor templates
without impacting it and each other. They can even change the JS
behaviour by using an XPath to replace the data-js of an option, and
changing it to their own extended version of the JS option.

[1]: https://github.com/odoo/odoo/commit/f296992317e96562c66bd7ad59a5080d6c551ed5#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R134-R138
[2]: https://github.com/odoo/odoo/commit/cd403480f90cf7103651f3be818a14b06d3c73ca#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R175
[3]: https://github.com/odoo/odoo/commit/e9237ae8004502a3071e8ceb132d9dac11fe00b3#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R372
[4]: https://github.com/odoo/odoo/commit/ff422df49201be6ed7baa11ef3deb5b9a41042a7
[5]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[6]: https://github.com/odoo/odoo/commit/24a4c7f897d4db6bdf0f3cbfc91a3ce7351241a2
[7]: https://github.com/odoo/odoo/commit/d0c2d8e9a1436a8eaf263797c790329f81d7615b

closes odoo/odoo#99850

Related: odoo/design-themes#597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-10-04 17:01:17 +02:00
MerlinGuillaume eeecb6f7c0 [FIX] resource: show planning resource in its timezone
Work hours in a planning do not respect the timezone

Steps to reproduce:
1. Set your computer timezone to 'America/New_York'
2. Install Manufacturing
3. Go to Settings > Manufacturing > Operations and enable Work Orders
4. Go to Settings > Technical > Resource > Working Times and open
   'Standard 40 hours/week' (San Francisco)
5. Edit the timezone to 'America/New_York'
6. Go to Manufacturing > Planning > Planning by Workcenter and trigger
   the day view
7. The work hours are not correct as they do not respect the timezone

Solution:
Add the timezone of the resource's calendar when computing
unavailabilities

opw-2903591

closes odoo/odoo#102066

X-original-commit: c7ac0ec29d69abdd5eda8887b6ec194db53419fd
Related: odoo/enterprise#32250
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-10-04 16:01:19 +02:00
William Braeckman cd14193919 [FIX] loyalty: make it possible to import coupons etc
TaskId-2991207

closes odoo/odoo#102062

X-original-commit: d4a92b112d0554a2624f7768feb7d54e0484469f
Related: odoo/enterprise#32249
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 16:01:13 +02:00
Antoine Vandevenne (anv) aab9d987f0 [FIX] website_sale: prevent users from modifying paid carts
Bug: Users are able to modify their eCommerce cart after it has been
paid when they fail to return to Odoo through the payment provider's
return route. This prevents the cart from being confirmed.

Steps to reproduce:
1. Install the payment provider Mollie and set it to test mode.
2. Go to the /shop page, add a product to the cart, and select Mollie
   for the payment.
3. On Mollie's hosted payment page, use the card number 4111111111111111
   with the expiry date 03/30 and the secret code 123. Select 'paid' as
   the payment outcome.
4. Confirm the payment but take care not to be redirected to the
   /payment/status route. For examples, close the tab before or comment
   out https://github.com/odoo/odoo/blob/15.0/addons/payment_mollie/controllers/main.py#L38.
5. Go back to /shop/cart and modify the cart.
6. Wait up to 20 minutes for the "payment: post-process transactions"
   cron to try to confirm the cart.
7. Check the cart's chatter: the confirmation failed because the cart's
   and transaction's amounts mismatch.

Explanation: The post-processing of the transaction is responsible for
confirming the cart, but it failed to be triggered because the user did
not visit the /payment/status page. The post-processing cron takes care
of pending post-processings after 10 to 20 minutes, which is long enough
for the user to modify their cart.

Fix: Force creating a new cart as soon as the current one is paid and is
being requested by the website.

task-2995504

closes odoo/odoo#102060

X-original-commit: 5f8674621cbf5919e10e32f29b66ae171fe05993
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 16:01:08 +02:00
Walid HANNICHE (waha) 82265c52ca [FIX] tools: fix underline and italic in logged notes
Steps to reproduce:
- in any app log a note using full composer
- add styles to the text (underline, strike-through, italic)

Bug:
styles except bold are removed

Fix:
added missing styles to the whitlelist

opw-2956374

closes odoo/odoo#102056

X-original-commit: eb07ab104d5f47574e14db811108a7d0cbbbe4b2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-10-04 16:01:06 +02:00