100 Commits
Author SHA1 Message Date
Hubert Van De Walle f07c1a6b60 [FIX] sale_project: editable views for action_view_task
Steps to reproduce
==================

- Install sale_project,industry_fsm,web_studio
- Open quotation S00023
- Click on the Tasks stat button
- Open studio
- Go to views
- Enable the gantt view

=> Unable to complete the operation: duplicate key value violates unique constraint "act_window_view_unique_mode_per_action"

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

The [action record] already contains the gantt view, but it is replaced
inside the python [action].

In [previous] version, the user was entering this condition and thus had
no problem editing the views

Solution
========

Instead of replacing the entire action['views'], we can remap the view
ids to the ones we want.

One side effect of this though is that the `gantt,activity,map` views
will be available by default.

---

[action record]: https://github.com/odoo/enterprise/blob/1df090289f3c45c200d133734989a6d9a8073145/project_enterprise/views/project_task_views.xml#L227
[action]: https://github.com/odoo/odoo/blob/1a9302dc3a9b0d9323612c10e0f3a91300bb89fd/addons/sale_project/models/sale_order.py#L154
[previous]: https://github.com/odoo/odoo/blob/8dbcd3d955e7270fc26a6141e8fce751029e5a4b/addons/sale_project/models/sale_order.py#L133-L141

opw-3800071

closes odoo/odoo#163594

X-original-commit: e331798655f821b89c50a0f578dabeb6e03ecc78
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-04-29 06:25:12 +00:00
Hubert Van De Walle f7e6523bd7 [FIX] stock: prevent opening SM when picking is dirty
Steps to reproduce
==================

- Create two new storable products tracked by USN
- Create a new RFQ with one of the created product
- Confirm the order
- Open the receipt
- Add a new line with the other product
- Click on the open move button in the new line
- Add a new SN
- Save & close

=> Cannot read properties of undefined (reading 'resId')

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

When calling openRecord, if the record is dirty, it is saved before
proceeding.

After saving, we call super.openRecord with the old record.
Since that record is no longer linked to the root record (the
stock.picking), when we try to save it, it won't match an existing id.

Solution
========

If the record is new, we don't save as there would be no way of knowing
which of the returned line would come from this one.

If we are opening an existing record, we find the new datapoint by
matching it's ID.

opw-3777615

closes odoo/odoo#162425

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-19 11:09:27 +00:00
Hubert Van De Walle c6640ddafd [FIX] web: keep group order when restoring empty kanban group
Steps to reproduce
==================

- Go to Field Service
- Group by "start date: week"
- Archive every record in a column until there is only one left
- Go back to the kanban view
- Click on the single record from the column
- Archive it
- Using the breadcrumbs, go back to the kanban view

=> The group order is not preserverd and the empty one is the last one

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

Before archiving the record, we have the following data:
`{group1: [1], group2: [2, 3]}`

After archiving the record, we have `{group2: [2, 3], group1: []}`

A new group is recreated from the old one, but it is always added at the
end.

Solution
========

We can insert the old group at his previous index.
The same solution was used in previous versions

opw-3816409

closes odoo/odoo#160121

X-original-commit: 0d44e931c40fbca005b8d1864cf2d07485ed84f8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-04-04 09:52:49 +00:00
Hubert Van De Walle 80e0f3463f [FIX] account: remove newId from display_name for invoices
Steps to reproduce
==================

- Create a new Invoice

=> The tab title is `Odoo - Draft Invoice (* NewId_0x7f545c9d6980)`

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

In 17, the display_name is computed for the tab title

https://github.com/odoo/odoo/blob/82fd8e702588d2cc5bdad474ed21188257cc7397/addons/web/static/src/views/form/form_controller.js#L342

opw-3794671

closes odoo/odoo#159301

Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-26 15:40:34 +00:00
Hubert Van De Walle ec5059f353 [FIX] web: prevent double translations in views
Steps to reproduce
==================

In 17:
- Install hr_holidays,project
- Switch the language to dutch
- Go to project > three dots > Projectupdates

We can see `x/y Genomen`, it should be `x/y Taken`

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

The original term is Tasks.
When loading the views, python translates them and changes Tasks to Taken.
Owl then translates the template and transforms Taken to Genomen.

Solution
========

Since the views are already translated, we don't need to translate them with owl.
We can simply set the attribute t-translation to off on the view root node.

opw-3787336

closes odoo/odoo#158627

X-original-commit: 454760e12145f8987e443d7776a614a5eb441feb
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-22 03:11:43 +00:00
Hubert Van De Walle 43c0f6ea11 [FIX] mail: reload attachments after upload from dropzone
Steps to reproduce
==================

- Go to Accounting > Customer Invoices
- Open any record with no attachments
- Drag & drop a pdf attachment on the chatter

=> The PDF viewer is empty

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

When uploading an attachment from the FileUploader, the parent view is
reloaded.

This is not the case when uploading an attachment from the dropzone.

opw-3748853

closes odoo/odoo#157232

Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-15 17:29:50 +00:00
Hubert Van De Walle bc326fa21e [FIX] web: prevent multiple updates when pressing enter
Steps to reproduce
==================

In 16.4:
- Go to Accounting > Reconcile 8 items
- Click on the first line on the right
- Edit the label and then press Enter
- Switch to another line

=> Odoo Server Error

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

When pressing Enter, two events are triggered: keydown and change.
In the useInputField hook, there is a listener for both of those events,
and they both end up calling `record.update` with the current value from
the input.

In the relational model, the update is locked inside a mutex.

So the first update (triggered by the keydown) does an onchange.
This onchange deletes the current records (Command.CLEAR) and returns
new records.

Once this is done, the mutex is released. The second update (triggered
by the change event) then tries the same update. Since the value was
obtained when queuing for the mutex, it uses the old (now deleted)
record.

Solution
========

This adds a test for https://github.com/odoo/odoo/pull/154991
as part of the fix got lost in a conflict resolution for previous versions.

opw-3726818

closes odoo/odoo#157155

X-original-commit: fbebffe446de9dd80db2dbe5ca7bd2746dc2a54f
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-11 11:55:08 +00:00
Hubert Van De Walle 0096c62a4a [FIX] hr_expense: statusbar overflow on mobile
Steps to reproduce
==================

- Install Expense (hr_expense)
- Use a small viewport
- Go to Expense
=> The status bar overflows

opw-3704233

closes odoo/odoo#156114

X-original-commit: b1c91dded0a11c870f1618869a7810317ea05643
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-03-01 19:45:57 +00:00
Hubert Van De Walle 90ca3fd1a7 [FIX] hr: many2one_avatar field uses wrong model
Steps to reproduce
==================

- Install Timesheets
- Login as Admin
- Edit the access rights of Mark Demo:
  * Timesheets: "User: all timesheets"
  * Employees: "None"
- Logout and login as Demo
- Go to a project task
- Switch to the Timesheets notebook
- Add a new line
- Click on the employee field > Search More

=> An error occurred

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

The hr.employee.public model is an SQL view of the hr.employee table
with differents permissions.

Since the user doesn't have the hr.group_hr_user group, the model
hr.employee.public should be used and not hr.employee.

Since [0], the model is switched depending on whether the user has the
appropriate group.

The EmployeeFieldRelationMixin is used and defines a getter for the
relation. That relation was not propagated to the Many2OneField.

Solution
========

Pass the relation to the many2OneProps.

---

[0]: https://github.com/odoo/odoo/pull/136786

opw-3765393

closes odoo/odoo#155743

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-03-01 12:10:25 +00:00
Hubert Van De Walle d8ca1f3412 [FIX] web: missing measures in graph view
Steps to reproduce
==================

- Install account_accountant
- Go to settings
- Enable Budget Management
- Go to Accounting > Reporting > Management > Budgets Analysis
- Switch to the graph view
- Change the measure to "Planned amount" and then back to
  "Practical amount"

=> The practical_amount measure is undefined,
   The theoritical_amount measure is missing.

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

The view is defined as follows:

```xml
<graph string="Budget Lines" sample="1">
    <field name="crossovered_budget_id" type="row"/>
    <field name="planned_amount"  type="measure" string="Planned amount"/>
    <field name="theoritical_amount"  type="measure" string="Theoretical amount"/>
    <field name="practical_amount" type="measure" string="Practical amount"/>
</graph>
```

The theoritical_amount and practical_amount are non stored fields and
thus are skipped inside `computeReportMeasures` unless they are passed
in `activeMeasures | additionalMeasures`. [0]

When parsing the graph view, the last field of type measure is
passed to the graph model and is the one that will be used initially. [1]

This is why the practical_amount is initially defined.

Solution
========

We simply need to keep track of fields of type measure.
This was the case in 14.0 but got lost in the conversion.

---

[0]: https://github.com/odoo/odoo/blob/e7a9ebec3176c37485643fcda2381e489a1df86f/addons/web/static/src/views/helpers/utils.js#L49-L60
[1]: https://github.com/odoo/odoo/blob/0fb64bef16914937cf4a1d1618fb58ade6d16f14/addons/web/static/src/views/graph/graph_arch_parser.js#L63

opw-3713613

closes odoo/odoo#153967

X-original-commit: 76178cd61ba10ff29b24183edb550c54b319a230
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-02-14 17:17:00 +00:00
Hubert Van De Walle 939395aefe [FIX] web: tooltip service should not cleanup when mouse is inside
Steps to reproduce
==================

- Use a laptop with touch or apply the following patch

```diff
diff --git a/addons/web/static/src/core/browser/feature_detection.js b/addons/web/static/src/core/browser/feature_detection.js
index 21c6294b1b0e..64c4bc9b899c 100644
--- a/addons/web/static/src/core/browser/feature_detection.js
+++ b/addons/web/static/src/core/browser/feature_detection.js
@@ -62,6 +62,7 @@ export function isDisplayStandalone() {
 }

 export function hasTouch() {
+    return true;
     return browser.ontouchstart !== undefined || browser.matchMedia("(pointer:coarse)").matches;
 }

```

- Enable debug mode
- Go to contacts
- Hover the mouse over a question mark next to a field

=> Nothing happens

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

The function `shouldCleanup` returns true when the device has touch and
the popover has been triggerd with the mouse

opw-3694156

closes odoo/odoo#152629

X-original-commit: 27242a0f1070b6b16c16e479e22dc0ccad0d9659
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-02-04 14:39:24 +00:00
Hubert Van De Walle 28a954997f [FIX] spreadsheet_dashboard: prevent crash on chart double click
Steps to reproduce
==================

- Use a mobile viewport / device (small window)
- Go to Dashboard
- Double click on a chart

=> `this.env.openSidePanel is not a function`

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

On mobile, the MobileFigureContainer is used instead of the Spreadsheet component.
The both use `useSubEnv` but the mobile one was missing the
openSidePanel function.

Solution
========

Add an empty `openSidePanel` function that does nothing.

opw-3677552

closes odoo/odoo#150702

X-original-commit: 990452ad985b1515ba565ff1fe8c6bbaa14fb031
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2024-01-24 00:16:51 +00:00
Hubert Van De Walle a76641cb06 [FIX] web: prevent empty json field from passing the required check
Steps to reproduce
==================

- Enable analytic accounting
- Go to customer invoices
- Open a record
- Open studio
- Click on the Invoice lines > Edit list view
- Set the analytic field as required
- Close studio
- Create a new record
- Add a new line
- Click on the analytic field
- Close the popup
- Save the record

=> Even though we didn't set a value for the field, it is saved

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

The actual field value is an empty object.
The validity of a field is checked here [0].
An empty object is considered a truthy value.

When setting the required attribute directly on the python field
declaration, an empty object does not pass the check

Solution
========

Add a specific check for json fields. When the value is either false
(not set) or an empty object, the field is considered invalid.

---

[0]: https://github.com/odoo/odoo/blob/23f01c533512cbfb33e90509e22cd3c3c4f99d40/addons/web/static/src/views/basic_relational_model.js#L284

opw-3659763

closes odoo/odoo#150677

X-original-commit: 51b538b3f678298f27bbbf458de5696706c18349
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-01-24 00:16:50 +00:00
Hubert Van De Walle e660cd94a8 [FIX] web: no_quick_create option ignored
Steps to reproduce
==================

1. Install event
2. Go to Events
3. Configuration > Event Templates
4. Click on any event
5. Click on Communication
6. Add a line, change type to SMS
7. Type anything in Template
8. Click on Create "..."
9. The operation cannot be completed

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

For many2one and many2many editable fields, the server sets the
can_create and can_write attributes on the field nodes. [1][2]

In some cases [3], those attributes are missing even though the fields
are actually editable. They are also absent for reference fields.

The `canQuickCreate` props was set to the following value:
`canCreate && !noQuickCreate`. When canCreate was absent, this was
evaluated to undefined, thus ignoring the noQuickCreate option.

Solution
========

When the permission attributes are missing, we have to assume that the
user has the appropriate permissions.

We also have to cast the extracted props to booleans as if you have an
props with a value of undefined, it will fall back to the default value.

In the test `no_quick_create option on a many2one when can_create is absent`,
we set the field as readonly and then cancel the readonly on the view.
This reproduces one of the bug of [3] which causes the permission
attributes to be missing.

-----

[1]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1296-L1297
[2]: https://github.com/odoo/odoo/blob/fa6da3d63a3a4cce4e8ca788a49772925d318764/odoo/addons/base/models/ir_ui_view.py#L1080-L1086
[3]: https://github.com/odoo/odoo/pull/138032

opw-3609799

closes odoo/odoo#148163

X-original-commit: efcb2a820bb57f1fae809725e799b3145fbbe599
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
2024-01-11 15:16:22 +00:00
Hubert Van De Walle cabba664fd [FIX] web: add new digits type in supportedOptions
The digits option was of type string, but it needs to be an array of two
integers.
We introduce a new digits type to handle that case.
This is used in studio, more info in the enterprise PR.

opw-3614919

closes odoo/odoo#148571

X-original-commit: 6dbf59a9db1a68069df7e922fcab673ce7f7ae5a
Related: odoo/enterprise#53865
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2024-01-10 07:27:02 +00:00
Hubert Van De Walle 796cb061d0 [FIX] web: enable zoom tooltip for ImageField in edit mode
Steps to reproduce
==================

- Set the zoom option on an image field (You can do it with studio
  starting from 16.3)
- Go to a record and hover over the image

=> Nothing happens

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

The tooltip is only displayed in readonly,
but with https://github.com/odoo/odoo/pull/100570 ,
the readonly mode has been removed.
So it only applies for views with the readonly attribute.

Solution
========

Always display the tooltip

opw-3646005

closes odoo/odoo#148534

X-original-commit: e0f9a7eedfb91ea46969490cf261548835844907
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2024-01-10 06:12:27 +00:00
Hubert Van De Walle 38155143dc [FIX] website: prevent crash in FormEditorRegistry if key not found
Steps to reproduce
==================

Go to Maintenance > Studio > Website > New Form
Click on the website editor
Click on the name field

UncaughtPromiseError > KeyNotFoundError

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

Starting from 17, the FormEditorRegistry is not the legacy one.
If the key is not present in the registry, it will fail, unless we pass
a default value.
In this case, the key `website_form_key` is false.

Solution
========

Pass null as the default value.

opw-3652423

closes odoo/odoo#147840

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-01-03 16:59:16 +00:00
Hubert Van De Walle 63a4481ad4 [FIX] web: reset expanded fields on import compatibility switch
Steps to reproduce
==================

- Go to users
- Open the export dialog
- Expand the Groups field
- Add the Groups > Groups/Access Controls field
- Check the import compatibility option
- Expand the Groups field again
=> `TypeError: this.knownFields[id] is undefined`

Solution
========

The expandedFields were not reset. We also need to update the t-key to
take the compatibility state into account.

opw-3378834

closes odoo/odoo#146116

X-original-commit: d2f52abb8ce1b7e5291e0de7d4ea7788f39115bd
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-12-13 15:53:00 +00:00
Hubert Van de Walle (huvw) 66e43af468 [FIX] web_tour: tours should override with the saveAs option
Steps to reproduce
==================

- Enable the debug mode
- Use an odoo instance with the design-themes
- Click on the debug menu
- Click on Start tour

`OwlError: Got duplicate key in t-foreach: homepage`

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

Website theme tours are registered here :
https://github.com/odoo/odoo/blob/5c01439cf20b2c0ca08d618df6f249617127e6d1/addons/website/static/src/js/tours/tour_utils.js#L348-L358

The saveAs option is used but since the owl refactor, it doesn't
override the previous tour.

There is a default homepage tour in the website addon and then one for
each theme.
There should only be one available at a time (same as in 16.2).
When selecting a new theme, the action button_choose_theme is called and
that ensures that only one theme can be installed at the same time.

opw-3595512

closes odoo/odoo#142350

X-original-commit: 69a361681c909cee5bf73a588dd4263bd49f1d5a
Related: odoo/design-themes#745
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-21 20:06:43 +00:00
Hubert Van de Walle (huvw) a026a9e9b1 [FIX] web: missing pivot measures when using favorites
Steps to reproduce
==================

- Go to budget analysis
- Switch to the pivot view
- Unselect the first three measures
- Save the current search and set it as default
- In the measures dropdown, there is only two measures remaining

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

- When `context.pivot_measures` is used, the measures are computed from
  it and those that comes from the metaData are missing.

opw-3544823

closes odoo/odoo#139315

X-original-commit: b11266cc377fa4753a0ee609258d9919f1ba5496
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-10-20 18:06:41 +00:00
Hubert Van de Walle (huvw) b87e54bce4 [FIX] web: no_create option ignored for many2one + many2many_tags fields
Steps to reproduce
==================

- Install purchase_product_matrix,web_studio
- Go to purchase
- Click on a record
- Open studio
- Click on the "Products" tab > Edit List view
- Edit the product field
- Widget: Many2one
- Disable creation: enabled
- Close studio
- Create a new record
- Add a new line
- Type some random text in the product field

-> The option create is available

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

When the can_create attribute is not passed, the `canCreate` ends up
undefined. This means the default value of true is used and the
`no_create` option is ignored.

The can_create attribute should actually be passed and there is a bug in
python in the `_editable_tag_field` function, but it is not something we
can change in stable due to the fact it it requires an explicit change
in some views to pass the validation and thus, this requires an addon
upgrade (`-u ...`).
See https://github.com/odoo/odoo/pull/138032

opw-3432903

closes odoo/odoo#139068

X-original-commit: 4b6756e1775488e230bc25767adf5744f0ea9149
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-10-18 16:52:06 +00:00
Hubert Van de Walle (huvw) 97caeab30d [FIX] purchase,sale: Packaging Quantity field missing on mobile
Steps to reproduce
==================

- Use a mobile viewport
- Create a quotation
- Add an order line
- Set a packaging
-> The Packaging Quantity field is missing

The same happens on purchase orders

---

opw-3504829

closes odoo/odoo#136213

X-original-commit: c5d665cc2b43a0040c3f5644265e74048c3d5ded
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-09-22 11:56:00 +00:00
Hubert Van de Walle (huvw) 04eed39aa8 [FIX] board: Add to dashboard no longer saves default filters
When adding a view to the dashboard, we already save the domain.
We don't want to save the default filters as they can have an opposite
domain as the one selected, meaning no records will be matched when
going to the dashboard.

---

opw-3385248

closes odoo/odoo#134610

X-original-commit: 16ab99eece9b36b1bb2958bb0f8ec45cbf8b83d3
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-07 09:00:37 +00:00
Hubert Van de Walle (huvw) ef11a89899 [FIX] point_of_sale: hide cash move button for users without permission
Steps to reproduce
==================

- Remove the Accounting/Billing permission from Marc Demo
- Login as Marc Demo
- Start a POS session
- Click on "Cash In/Out"

An error occurs because the user doesn't have the appropriate
permission

Solution
========

Add a key `has_cash_move_permission` in the pos config.
Set it to the presence/absence of the group `account.group_account_invoice`.
If the permission is missing, hide the "Cash In/Out" button.

opw-3333622

closes odoo/odoo#133444

X-original-commit: 62ea247953e5d8e81b3af7d4bbde3ec2ffb49f19
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-29 14:09:47 +00:00
Hubert Van de Walle (huvw) c2b93f7f0e [FIX] hr_maintenance: use hr.employee -> .public when missing rights
Steps to reproduce
==================

- Login as a user with no rights
- Use a mobile viewport
- Create a new Maintenance Request
- Edit the Created By field

-> A traceback occurs because the user has no rights

Solution
========

We extend the Many2OneField to accept a relation option and Depending on
whether the user has the rights, use the correct one.

This is similar to 41eaff0f4c17

opw-3430105

closes odoo/odoo#133261

X-original-commit: e78998c2951ec906fbccbe24e3fa454711a37c2b
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-28 20:14:44 +00:00
Hubert Van de Walle (huvw) a9707ac099 [FIX] mail: only allow image operations for images in AttachmentViewer
First bug
=========

Steps to reproduce
------------------

- Go to A project task
- Upload an pdf
- Preview the pdf
- Press on the "+" key

```
TypeError: Cannot read properties of null (reading 'offsetWidth')
    at AttachmentViewer.updateZoomerStyle
```

Cause of the issue
------------------

Some operations should only be called when the current attachment is an
image.

Second bug
==========

Steps to reproduce
------------------

- Go to documents
- Click on an image document
- Edit the "Tags" field and type +

The image is resized

Cause of the issue
------------------

In the documents app, the viewer is not fullscreen.
The keyboard actions should only be used when the attachment viewer is
focused. The onKeyDown was bound to the document.

Solution
--------

We can bind the `onKeyDown` to the AttachmentViewer.
Since we now need the viewer focused, we can use the autofocus hook.

opw-3456439

closes odoo/odoo#133126

X-original-commit: 7fa95127e55e21bcaf28191c872cd0a1b8a0a6a6
Related: odoo/enterprise#46270
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-25 12:21:13 +02:00
Hubert Van de Walle (huvw) 1076dbdd58 [FIX] purchase_requisition: add missing date_planned computation
Steps to reproduce
==================

- Create a blanket order
- Choose a vendor
- Add a product P
- Set a price
- Save and Confirm
- Click on the RFQs/Orders smart button
- Create a new RFQ
- Delete the line
- Add a new line with the same product P
- Save

-> A validation error appears because the date_planned is not set

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

`_compute_price_unit_and_date_planned_and_name` is overriden and passes
an empty recordset to the super method.

Solution
========

We can compute the `date_planned` using the selected seller

opw-3416573

closes odoo/odoo#132428

X-original-commit: d7db1d799fe042ef248968c6dee53eaf6e0ed3db
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-21 12:39:47 +02:00
Hubert Van de Walle (huvw) f100f16c3d [FIX] web: Many2One option no_opening -> no_open
When editing a Many2One field with studio, and toggling "Disable
opening" with studio, it doesn't do anything because it's the wrong
option.

opw-3434895

closes odoo/odoo#132102

X-original-commit: 0ec5a45f1633ffaff91aba6808cf50ad1c58c60b
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-17 10:33:19 +02:00
Hubert Van de Walle (huvw) 5023e1a52c [FIX] web: commitChanges with a field input removed during an update
Steps to reproduce
==================

- Go to Payroll > Payslips > All Payslips
- Click on any line
- Click on the cog > Edit Payslip Lines
- Change an amount
- Press Tab

```
Cannot read properties of null (reading 'value')
    at commitChanges (/web/static/src/views/fields/input_field_hook.js:163)
    ...
```

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

A custom Field is used: PayslipLineField.
It is used to override the record.update to trigger an action.
https://github.com/odoo/enterprise/blob/f8c027685a49fca519fd6ac2f41dd5f30b243934/hr_payroll/static/src/js/payslip_line_one2many.js#L63-L80

This causes the view to be destroyed -> `inputRef.el` becomes undefined.

Solution
========

Use the field value before the update.

opw-3434835

closes odoo/odoo#131971

X-original-commit: 546978c70f5bee59b9985246977585ef59d761cd
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-16 14:21:50 +02:00
Hubert Van de Walle (huvw) e8d08ffe79 [FIX] web: use optionalActiveFields for direct export
Steps to reproduce
==================

- Go to project
- Switch to the list view
- Remove some optional fields
- Click on the export all button next to the "New Button"

The optional fields configuration are ignored and all fields are
exported.

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

The `optionalActiveFields` are not taken into account when computing the
`defaultExportList`.

This was the case in 15.0

opw-3452459

closes odoo/odoo#131594

X-original-commit: 2a397cb5bb89d1a10e7ac765ff9035c102fbb436
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-10 18:14:39 +02:00
Hubert Van de Walle (huvw) f603e86959 [FIX] project, web: create_group compatible with custom _rec_name
Steps to reproduce
==================

- Enter studio
- Create a new app
- Create a new model with "pipeline stages" enabled
- Close studio
- Switch to the kanban view
- Add a new stage

`ValueError: Invalid field 'name' on model 'x_test_stage'`

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

A model _rec_name is not always name. This is the case for example with
studio stages. In that case,  `_rec_name == 'x_name'`.
Since [commit], we do a create instead of a name_create.

Solution
========

First do a name_create to handle custom _rec_name. Then if there is
still some field to be written, do a simple write.

[commit]: 4e974e5

opw-3432017

closes odoo/odoo#130921

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-07 19:57:54 +02:00
Hubert Van de Walle (huvw) f478310d17 [FIX] web: prevent rollback in ace_field
Steps to reproduce
==================

- Enable debug mode
- Go to Settings / Technical / Automation / Automated Actions
- Set "Action To Do" to "Execute Python Code"
- In the code editor, type really quickly

The code is briefly focused and when the next input is processed,
everything is erased.

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

The AceField makes a debounced commit with the current editor value.
This triggers an onChange event, and upon receiving the results,
we update the editor value with the resolved value.
Although the editor value may have changed in the meantime,
we still revert it to the previous value.

Solution
========

There is no need to update the record every 10ms. We can simply to that
on blur. This is also what was done in 16.2.

opw-3379740

closes odoo/odoo#129694

X-original-commit: 4047ed03117fbcd5634843e29dc82e7ffb71b910
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-07-26 13:22:09 +02:00
Hubert Van de Walle (huvw) 877b8a9031 [FIX] web: multisave take manual changes into account with a single record
Steps to reproduce
==================

- Go to documents
- Click on a document
- Add a tag

-> Nothing happens

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

Since https://github.com/odoo/enterprise/commit/e35017719d0996279f362423a7b4b1c6e30b9766 ,
the documents app uses the _multiSave method from the relational_model.

If the selection is of only one record, the changes passed to the method
are ignored.

opw-3393862

closes odoo/odoo#128515

X-original-commit: 7e361761d20ddc64c62b85f3496e1596dc42987b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-07-24 11:28:45 +02:00
Hubert Van de Walle (huvw) 15cf748478 [FIX] account: invoice report compatible with studio
Steps to reproduce
==================

- Open studio
- Go to reports
- Click on invoices
- Try do drag a text block at the end of the page after the table with
  the total

  Studio doesn't place a drop hook after the table.

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

Studio only adds hooks before and after each direct child of the element
with a 'page' class.

Since [commit], the `#right-elements` and `#payment_term` elements are
outside the page and thus we can't place an element after.

Solution
========

- Move the `#right-elements` and `#payment_term` inside a new div since
  they are part of the same line and we don't want to put an element
  between them.
- Move that div inside the page.
- Add a clearfix class in order to have it's height correctly computed.

[commit]: https://github.com/odoo/odoo/pull/107714/commits/66373a538e123b29b983a8e02f302e7e258e084d

opw-3345430

closes odoo/odoo#127771

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-07-17 09:20:45 +02:00
Hubert Van de Walle (huvw) cb5a1cfd16 [FIX] web: SelectCreateDialog should set selection_mode for kanban
Steps to reproduce
==================

- Install purchase_stock
- Use a mobile viewport
- Go to Purchase
- Click on a record
- Try to set the "Deliver To" field
- Click on a record

-> An action is triggered and the record is not selected

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

[commit] removed the only use of `forceGlobalClick`.

When it is set, KanbanRecord.selection_mode evaluates to true.

Solution
========

forceGlobalClick should be set when selecting a record from the
SelectCreateDialog.

[commit]: https://github.com/odoo/odoo/commit/6e18fb3c35281bdba26d9616150141298975bb40

opw-3337018

closes odoo/odoo#127632

X-original-commit: 7a1db9fade48d231a71084624fa0063989afd2b9
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-07-06 20:56:11 +02:00
Hubert Van de Walle (huvw) bc70627cba [FIX] auth_password_policy: allow to start a password with a special char
Steps to reproduce
==================

- Go into sign-in > Don't have an account
- Enter a password starting with a special character (ie: $)

Uncaught Javascript Error > Failed to set the 'value' property on 'HTMLMeterElement': The provided double value is non-finite.

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

`(password.split(/[^\W_]+/).length - 1)` -> 0
`0 / 0` -> NaN
`Math.min(NaN, 1.0)` -> NaN

opw-3397932

closes odoo/odoo#127337

X-original-commit: e377aae101477b414d5391036477280a0c18445c
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-07-05 09:01:10 +02:00
Hubert Van de Walle (huvw) 954b106757 [FIX] purchase: valid autocomplete for purchase.bill.union
Steps to reproduce
==================

- Go to Accounting > Vendor Bills
- Create a new record
- Click on the Auto-Complete field > Search more
- In the search bar, search for a reference

-> str is not a function

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

The search filter is declared as such:
```xml
<
  field name="name"
  string="Reference"
  filter_domain="['|', ('name','ilike',self), ('reference','=like',str(self)+'%')]"
/>
```

This domain is evaluated in javascript by basic python interpreter.

Going from 15 to 16, it has been rewritten. The str function isn't
present anymore in `py_builtin.js`.

Solution
========

Since this is the last remaining usage of this function and `self` is
already a string, we can simply replace `str(self)` by `self`

opw-3383708

closes odoo/odoo#126593

X-original-commit: 4485d1ca6d1dfe33f4fca6d2cc140296ce4058a5
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-28 09:59:41 +02:00
Hubert Van de Walle (huvw) f120977751 [FIX] analytic: missing currency field for aggregates
opw-3316448

closes odoo/odoo#126209

Related: odoo/enterprise#43067
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-06-23 16:35:46 +02:00
Hubert Van de Walle (huvw) 75bc86c817 [FIX] mail: usable ListActivity widget in many2many subview
Steps to reproduce
==================

- With studio, create a model
- In the form view, add a many2many pointing to res.partner
- Close studio
- Create a record
- Add a line by selecting a partner

-> `Cannot read properties of undefined (reading 'find')`

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

The res.partner uses a custom widget for the activity field `ListActivity`.
The fieldDependencies selection fields are not properly defined.

opw-3360436

closes odoo/odoo#125907

X-original-commit: 69019fd51aa4d157b95dd44c9f359b967c67a23d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-21 19:04:17 +02:00
Hubert Van de Walle (huvw) f15807b787 [FIX] web: refocus date field in editable list
Since [0], when a cell is already focused, we do not refocus again.
But we forgot to set the lastEditedCell to the current one.

The test "editable list view, should refocus date field" has also been
fixed to reflect the actual behaviour. We set the focus on the picker
cell. Before, in the test, it was on the body. This means that in [1],
`this.activeRowId` would be set to null, thus, the test was not failing.

[0]: 437edce313
[1]: https://github.com/odoo/odoo/blob/1ecfd4ee9529a3cd21a925c1e850e10fe05f2097/addons/web/static/src/views/list/list_renderer.js#L116-L117

opw-3332809

closes odoo/odoo#125301

X-original-commit: 5ee1532bdbdde0062a13e75d85f7342eb2447415
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-06-21 13:46:00 +02:00
Hubert Van de Walle (huvw) 9d48733d19 [FIX] account: display journal entries total
Steps to reproduce
==================

- Go to Accounting > Accounting > Journal Entries

The total at the bottom is not displayed and there is a `-` instead.

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

The `amount_total_signed` field uses the currency_field
`company_currency_id`.
It should be present in the view for the web client to be aware of it's
value.

opw-3316448

closes odoo/odoo#125639

X-original-commit: eaec9f7c3c28e2ee9d42597052a21e6b2695cd60
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-19 19:17:03 +02:00
Hubert Van de Walle (huvw) 426d95eecd [FIX] web: remove duplicate month in arabic
Steps to reproduce
==================

- Switch to arabic
- Open a datepicker
- Select the month

The month are displayed twice in two different arabic namings.

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

There is an issue in the moment locale files since [0]. It has been made
apparent since [1].

Solution
========

Cherry pick a fix from the moment repo [2].

Revert the ar.js locale from before [0]

[0]: 11f3e7351a899848ec4df0107c3f6e2a627807ba
[1]: 6a1183f4c93ad068524a3242cd7b4e37f68fbf95
[2]: https://github.com/moment/moment/commit/251fba65cca5d5b2cf79f1f51a9d413c5e0cb161

opw-3349560

closes odoo/odoo#125381

X-original-commit: bfdf5baf4017058d7aff7c93fd504e684ed6783a
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-16 13:41:17 +02:00
Hubert Van de Walle (huvw) f06c2ae2a6 [FIX] web: duplicate t-key for translated colors
Steps to reproduce
==================

- Switch odoo to french
- Go to projects
- Click on the three dots

-> Got duplicate key in t-foreach: Violet

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

Since [0], the colors have been renamed.
In french, both Purple and Violet translates to Violet
Color is a LazyTranslatedString and its string representation is the
translation.

Solution
========

Use the index for the t-key

[0]: https://github.com/odoo/odoo/commit/ef313061301948693bfbeb16e8ccca786e5251f4#diff-df052c03baba52d267dcf7714eb1a1d03f1eddf85f096ff1c8d016f12f71a6b5L40-L53

opw-3358597

closes odoo/odoo#124545

X-original-commit: 323dfc4e32278b52b883a78b8a91c230ac31220b
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-10 08:16:40 +02:00
Hubert Van de Walle (huvw) cfc049c0a9 [FIX] web: indeterministic test fail
Apply the same solution used in other tests with "test:hashchange":

```js
await testUtils.nextTick();
await legacyExtraNextTick();
```

closes odoo/odoo#124041

X-original-commit: 8bd9809bc4700637ffb26bbcfbd00c62b0dbd220
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-06 22:54:41 +02:00
Hubert Van de Walle (huvw) 60d6b423c3 [FIX] stock: allow the forecasted report to be accessed by it's URL
Steps to reproduce
==================

- Have at least two warehouses
- Go to products -> Acoustic Bloc Screens -> Forecast
- Switch warehouses
- Refresh the page

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

When reloading the page, the action is restored from the router state
(the URL). This means that the context isn't restored. In that case,
`originalContextAction.active_model` won't be defined. We then try to
use `originalContextAction` as if it was a string. But in this case,
it's an object `{active_id: ...}`.

opw-3301164

closes odoo/odoo#123812

X-original-commit: 6205a3b85b6551393c9ed33d0213cff9bc693ba3
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-06 10:30:14 +02:00
Hubert Van de Walle (huvw) 708f15c9b1 [FIX] web: don't use the compileButton fn for bootstrap toggles
Steps to reproduce
==================

- Use a mobile (xs) viewport
- Go to sign
- Click on "Action"

-> InvalidButtonParamsError

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

The bootstrap button should not be compiled as an action button

Solution
========

Don't call compileButton for button with the data-bs-toggle attribute
We also need to cancel the global click to let bootstrap handle the
action

opw-3278906

closes odoo/odoo#123579

X-original-commit: 5f569eedf9ed4e19b1fab1c83f7d315684097a7f
Related: odoo/enterprise#41906
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2023-06-02 23:39:24 +02:00
Hubert Van de Walle (huvw) 2d4634df5f [FIX] web: use field digits in grouped list view
Steps to reproduce
==================

- Enable debug mode
- Go to Settings / Technical / Database Structure / Decimal Accuracy
- Set the "Product Unit of Measure" to 3 digits
- Go to Inventory / Reporting / Locations
- Group by company

-> The "On Hand Quantity" is formatted with 2 digits

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

The field is declared as follows

```py
inventory_quantity_auto_apply = fields.Float(
    'Inventoried Quantity', digits='Product Unit of Measure',
    compute='_compute_inventory_quantity_auto_apply',
    inverse='_set_inventory_quantity', groups='stock.group_stock_manager'
)
```

Solution
========

We should fallback to the field digits if the digits are not set on the
arch, such as this

https://github.com/odoo/odoo/blob/1cd49304ef118e667bd14fd5fa78a0baba47bb4a/addons/web/static/src/views/utils.js#L152

opw-3328657

closes odoo/odoo#123543

X-original-commit: f4ecb7ff0c166c7e58ea99711868a30ea3a7fda7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-02 23:39:11 +02:00
Hubert Van de Walle (huvw) ea8e42cdba [FIX] web: parseMonetary of decimal value without leading 0
Steps to reproduce
==================

- Open a product form view
- Enter .5 in the Cost field

It is parsed as 5 but it should be 0.5

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

When trying to strip the currency symbol from the input, the leading
decimal separator was also removed

Solution
========

The decimalPoint can have multiple characters.
This means that we can't simply add the decimal separator inside the negated
character class.

Instead, what we can do is skip everything until we find a interesting
substring. (more details in the comment)

We then remove everything that is not a digit at the end.

Finally, we can pass that to `parseFloat`

closes odoo/odoo#123358

X-original-commit: fa466d75da3b30ac1e512a95436075ef1461a95c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-02 12:04:13 +02:00
Hubert Van de Walle (huvw) 5ec18c130d [REV] web: parseMonetary of decimal value without leading 0
This reverts https://github.com/odoo/odoo/commit/59dcd17c2d389d52365a2e2975de800284cd271f

Issue: With a comma as decimal separator, it is replaced by a dot
It is then ignored in parseFloat

closes odoo/odoo#120856

X-original-commit: 83de5424d1fa7013b212dcac9dee66c1cd89269a
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-05-09 18:27:07 +02:00
Hubert Van de Walle (huvw) 72646e00e9 [FIX] web: restore orderBy from state when using default order
Steps to reproduce
==================

- Enter debug mode
- Go to "Settings / Technical / User Interface / Views"
- Click on the "View Type" column header
- Click on any record
- Use the breadcrumbs to go back

Issue: the list is not sorted anymore by "View Type"

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

When there is an `orderBy` param passed to `DynamicList`, it takes
precedence over the previous exported state.

We should only use the params.orderBy if it is not the initial one.

Solution
========

In order to know if we are using the initial order by, we need to export
it. With that, we can check if the `params.orderBy` is the initial one.
If it is the same, use the `state.orderBy`
If not, use the `params.orderBy`

opw-3202088

closes odoo/odoo#120839

X-original-commit: 81dba0c1746ba579a01dead8e4712cf83cbaad28
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-05-09 07:08:56 +02:00
Hubert Van de Walle (huvw) 7d26f9e4b9 [FIX] web: allow to use the hour:minute on mobile for FloatTimeField
Steps to reproduce
==================

- Use an android phone
- Go to Timesheets
- Click on Add a line
- Click on the Hours Spent input

The keyboard is missing the colon `:` symbol

It is then only possible the enter a time in the float format.

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

The inputmode=decimal attribute prevents a user from entering a `:`
symbol

Note that this doesn't happen on IOS, since the inputmode is ignored for
other reasons.

opw-3278089

closes odoo/odoo#120824

X-original-commit: 8b919ae51d7deb34169b7c6970964056ef2eb632
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-05-09 07:08:51 +02:00
Hubert Van de Walle (huvw) 67606c7571 [FIX] web: disable limit for grouped kanban views
Steps to reproduce
==================

- Go to a kanban view with lots of records, for example products
- Remove any filter and group by name

There is only 80 groups, and there is no way to get the next ones

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

The `web_read_group` uses a limit, by default of 80

Solution
========

For kanban grouped views, we don't want to set a limit on the groups

opw-3283004

closes odoo/odoo#120758

X-original-commit: bf772181933ce5334da35c8368455963b2478399
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-05-09 06:07:25 +02:00
Hubert Van de Walle (huvw) 071ec7f8c4 [FIX] auth_password_policy: prevent crash when emptying password input
Steps to reproduce
==================

- Go to /web/signup
- In the password field, type something
- Clear the input

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

A bunch of conditions evaluates to NaN inside
`ConcretePolicy.score(password)` when passing en empty string as a
parameter.

Solution
========

An empty password should always have a score of 0 anyway, so we can
do an early return. (The lengthscore would be 0, and we multiply by it
at the end)

opw-3269555

closes odoo/odoo#120711

X-original-commit: 6aa16bb740af14fcebd8f05bdc19c9e8879d77ed
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-05-08 23:39:42 +02:00
Hubert Van de Walle (huvw) 1931f097d9 [FIX] web: parseMonetary of decimal value without leading 0
Steps to reproduce
==================

- Open a product form view
- Enter .5 in the Cost field

It is parsed as 5 but it should be 0.5

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

When trying to strip the currency symbol from the input, the leading
decimal separator was also removed

Solution
========

Adapt the regex by adding the decimal separator in the list of
characters to not exclude

For that, we first need to replace the decimal by a dot as it could be multiple
characters long. (The same is done in `parseNumber`)

opw-3270039

closes odoo/odoo#120693

X-original-commit: 59dcd17c2d389d52365a2e2975de800284cd271f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-05-05 18:08:15 +02:00
Hubert Van de Walle (huvw) a3a1043e22 [FIX] web: use the correct inputmode for fields
Steps to reproduce
==================

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

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

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

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

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

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

Solution
========

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

opw-3269275

closes odoo/odoo#120129

X-original-commit: fb37550715034e7a1fbe751889cd8ea2bd6e4128
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-28 17:23:06 +02:00
Hubert Van de Walle (huvw) 9fa61411c2 [FIX] sale_stock: allow to tab past an empty QtyAtDateWidget
Steps to reproduce
==================

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

The focus doesn't go past the Quantity widget

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

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

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

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

Solution
========

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

opw-3266063

closes odoo/odoo#120005

X-original-commit: 30fcb2e60fed17a473353b21bac4916e9ab77b10
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-27 18:25:37 +02:00
Hubert Van de Walle (huvw) a6d65cac43 [FIX] mass_mailing: unregister ResizeObserver on unmount
Steps to reproduce
==================

This only seem to happen on Firefox

- Go to Email Marketing
- Open a campaign
- Go back to the homepage by using the topleft square button

-> `$(...).offset() is undefined`

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

The ResizeObserver used in MassMailingFullWidthViewController is still
triggered, even though it shoudln't.

Solution
========

Disconnect the observer when the component is unmounted.

opw-3271101

closes odoo/odoo#118785

X-original-commit: d5f6bc2b33c3b83520ed2ed710610b69dbe67b75
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-17 16:35:03 +02:00
Hubert Van de Walle (huvw)andFrancoisGe 671d96d118 [FIX] web: pressing tab quickly with slow network responses
Steps to reproduce
==================

- With the Chrome devtools, add a network delay of 1 second
- Go to Purchase
- Create RFQ
- Add vendor
- Add products and navigate by using the 'TAB' key
- Add another product line
- Repeat process quickly

`this.list.editedRecord is null`

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

Order of events:
- First tab pressed
- onchange_1 triggered
- Second tab pressed
- onchange_2 triggered
- onchange_1 resolves
- The editedRecord is switched to readonly
- onchange_2 resolves
- There is no more editedRecord

opw-3115650

closes odoo/odoo#118760

X-original-commit: af5cedf078b439710e8801374ace524de54f3b66
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
2023-04-17 14:14:27 +02:00
Hubert Van de Walle (huvw) 27c90b95ff [FIX] web: allow to unregister multiple listener from the same target
Steps to reproduce
==================

- Register two events listener on the same target
- Unregister them

Only the first one is unregistered

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

`cbs` is used instead of `listeners`. This means that after any `.off`
call, the target is removed from the Map and it is not possible anymore
to unregister any events for it

closes odoo/odoo#118739

X-original-commit: 345dd30fdc627ada212a8eaa6f9817bbdaf5d3a3
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-17 13:09:42 +02:00
Hubert Van de Walle (huvw) 3f962d3754 [FIX] website_slides: reponsive design
Steps to reproduce
==================

- Go to elearning
- On the "Trees, Wood and Gardens" card, click on "view course"
- Click on Main Trees Categories

The slide name is outside the view
Also, the XP badge is cropped

opw-3225999

closes odoo/odoo#117595

X-original-commit: 1d5a92a04ba8e52099715cf782cecbb2c73feb14
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-04 13:35:50 +02:00
Hubert Van de Walle (huvw) af064c1914 [FIX] web: ImageField size attribute not applied correctly in CSS
Steps to reproduce
==================

- Go to the product page
- Open studio
- Click on the picture and set the size to large
- Save and quit studio
- -> The size doesn't change

Port of https://github.com/odoo/odoo/pull/87087

opw-3217741

closes odoo/odoo#117423

X-original-commit: 63a3466c805c09989e5e022519e1ba450ecb1053
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-01 17:03:57 +02:00
Hubert Van de Walle (huvw) 6ca723dee4 [FIX] web: group pager: use correct count
Steps to reproduce
==================

- Go to the products list view
- Remove every filter/group by
- Search for "bolt"
- Group by > Add Custom Group > Active
- Remove the bold filter
- Expand the group

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

The group pager is not displayed because the condition was incorrect

A group pager should only be displayed when the group limit is less than the
group count. The list count was used instead, meaning the total count
was the number of groups and not the number of item in the group.

opw-3221226

closes odoo/odoo#117267

X-original-commit: 4caab25d182bc2b5d1a2c315795a79d286a4491e
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-03-31 10:53:13 +02:00
Hubert Van de Walle (huvw) 15a202c976 [FIX] stock: PopoverWidgetField json parsing error without value
Steps to reproduce
==================

- Access a company with no records in transfer model (IT Company, SE Company, etc.)
- Go to transfers menu
- Click Studio
- Click form view button
- Click view tab on the left
- Click Show invisible elements
- Error "The requested change caused an error in the view. It could be because a field was deleted, but still used somewhere else"

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

Since we are not editing an existing record, the PopoverWidgetField
component is loaded without a field value (it is an empty string).

This means that JSON.parse will fail

opw-3249161

closes odoo/odoo#117148

X-original-commit: ddb36467b401ec401b813182d172f5aab329baa7
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-03-30 15:09:50 +02:00
Hubert Van de Walle (huvw) 7b368df0fe [FIX] web: binary field filename in form view not updated with pager
Steps to reproduce
==================

- Go to a form view with a binary field, or add one with studio
- Upload a file a.txt to a record
- Upload a file b.txt to another record
- Switch between both records with the pager
- The filename is not updated

opw-3208810

closes odoo/odoo#116323

X-original-commit: 90515916e8adb3edb560d73ec8889ad52319cc1d
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-03-24 07:44:59 +01:00
Hubert Van de Walle (huvw) 9b136383c2 [FIX] web,mrp,stock: don't call action buttons for virtual records in x2manys
Steps to reproduce
==================

- Make sure the "Work Orders" setting is enabled
- Manufacturing > Products > Bills of Materials > New
- Select a random product
- In the Operations tab, add a line
- Type something in the Operation field
- Set the workcenter to Assembly line 1
- Save and close
- Click on the "Show Instructions" action button

```
Traceback (most recent call last):
  File "/home/hubert/src/16.0/odoo/odoo/models.py", line 5108, in ensure_one
    _id, = self._ids
    ^^^^
ValueError: not enough values to unpack (expected 1, got 0)
```

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

The action is called without in id because the record is not yet created

Solution
========

The button should display a warning in x2manys when the record is virtual.
This was actually the case before Odoo 16 but there was an option on the
button `options='{"warn": true}'`. With this commit, it will be the
default behavior.
We also remove this option from the xml since it isn't used.

sentry-3950549982

closes odoo/odoo#114505

X-original-commit: 9fc0424a4450923aa8582bdb6766e1b19cb68546
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-03-07 18:02:53 +01:00
Hubert Van de Walle (huvw) 0b335ad510 [FIX] web: settings view: call server actions with the resId
Steps to reproduce
==================

- Go to settings
- Search for IAP
- Click on View My Services

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

In the settings view, there is a specific hack which removes the resId
from the record

https://github.com/odoo/odoo/blob/e4fe05ac07dbafb993922ff28dc3f7705c639dff/addons/web/static/src/webclient/settings_form_view/settings_form_view.js#L35-L39

This means that the records is not defined in the server action and so
nothing is done

https://github.com/odoo/odoo/blob/cd356f29abcaa1029e8a79ae76c2561f4833232a/addons/iap/views/res_config_settings.xml#L9

Solution
========

Instead of removing the res_id to mark the record as new, override
BasicModel.isNew

opw-3120995

closes odoo/odoo#110679

X-original-commit: ffb09c4ba5a4fb521a242adb0541595bd3ec1524
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-23 13:19:02 +01:00
Hubert Van de Walle (huvw) 38fbdec503 [FIX] web: restore drag&drop in Firefox
Steps to reproduce
==================

- Go to a kanban view
- Drag a card by the title to another column
-> The record is opened instead of being moved

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

The `.o_kanban_record_headings` elements have a `overflow: hidden` rule
There is a bug [0][1] in firefox from 17 years ago were the
mouse{enter,leave} events are not fired in that case.

Solution
========

The previous attempt [2] to fix the issue is not working (anymore ?)

Thanks to a comment in the issue, we know that we can call
`.preventDefault` on the mousedown event.

[0]: https://bugzilla.mozilla.org/show_bug.cgi?id=339293
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1352061
[2]: https://github.com/odoo/odoo/pull/104128

opw-3120973
opw-3121312

closes odoo/odoo#110282

X-original-commit: 713026806fa712afd85cb2530006f0f880dfa240
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-01-18 17:38:31 +01:00
Hubert Van de Walle (huvw) c7208ecaee [FIX] web: Date{Time,}Field formatting empty values
Steps to reproduce
==================

- Install mrp_product_expiry
- Go to Inventory > Products > Lots/Serial Numbers
- Add the column "Expiration date"
- Remove the groupby if any
- Select 2 records, set an expiration date
- Confirm
- Select the same records, remove the expiration date
-> TypeError: value.setZone is not a function

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

When entering the readonly mode after changing the date, the function
`formattedValue` is called. But `this.props.value` is equal to `""`.
`formatDateTime` only handles `DateTime | false`

The field is rendered from this template https://github.com/odoo/odoo/blob/1d8f6359bbf55983a9582282d12a187c67cdf509/addons/web/static/src/views/list/list_renderer.xml#L233-L236

When `canUseFormatter` returns true, formatDateTime is called with
false, coming from `record.data[fieldName]`

opw-3111869

closes odoo/odoo#109436

X-original-commit: 5b26a080ae28fab2a78e92a838472578591eef17
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-09 15:29:07 +01:00
Hubert Van de Walle (huvw) c5e324cbe4 [FIX] web: attach_document widget now works when triggered from a dropdown
Steps to reproduce
==================

- Use a mobile viewport
- Go to Expenses
- Create a record
- Enter a description and a category
- Click on Action
- Click on Attach Receipt
-> Nothing happens

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

When the button is clicked, the dropdown is closed. This means that the
AttachDocumentWidget and FileInput Components are both destroyed.

Solution
========

Instead of using the FileInput Component, use an input element outside
the DOM.

We also use `this.env.services.orm` instead of `useService("orm")`
because the last one does nothing when the widget is destroyed

opw-3065590

closes odoo/odoo#108897

X-original-commit: 84d50b40f150f251a81e128fa9645d7fcc729dab
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-02 13:55:50 +01:00
Hubert Van de Walle (huvw) d918d27ede [FIX] hr_expense: mobile app link now working
Steps to reproduce
==================

- Go to Expense
- Type some random string in the search bar in order to have no match
- Click on one off the app button
-> An error occurs

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

The QRModal was not ported to owl

opw-3070434

closes odoo/odoo#108898

X-original-commit: d3b3e6ebb228453938aeac8286f7e3a916b6a027
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-02 12:56:28 +01:00
Hubert Van de Walle (huvw) 2e497b886e [IMP] web: Add QUnit.debug type definition
closes odoo/odoo#107856

X-original-commit: 409fc809bafec2507342534bcdf4810ebffe9228
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-12-13 17:03:21 +01:00
Hubert Van de Walle (huvw) 96b4aac704 [FIX] web: conflict in qunit type definition
In the QUnit type definitions, there is a QUnit namespace and a QUnit
interface. When using a jetbrains IDE, it is confused between the two
and thinks the global QUnit is the namespace.
This means that it can't resolve QUnit.test, QUnit.module, etc

This fixes this issue by disambiguating between the two.

X-original-commit: 26dc799f841e51a6d57d427e095b662a45bc7e5a
Part-of: odoo/odoo#107856
2022-12-13 17:03:21 +01:00
Hubert Van de Walle (huvw) 355b004775 [FIX] web: many2one field autocomplete not cleared on blur
Steps to reproduce
==================

- Create an invoice
- Add a line
- Type storage in the product field
- Ctrl+A then press backspace
- Press escape to close the autocomplete dropdown
- Click elsewhere
-> The first suggestion is now selected

opw-3055185

closes odoo/odoo#107302

X-original-commit: e0613bc06ba9f2653dd0cfc4057ba93abf8513f7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-12-07 10:02:17 +01:00
Hubert Van de Walle (huvw) cc547da0f8 [FIX] website_slides: allow unsanitized html in the course description
Steps to reproduce
==================

- Install website_slides
- Go to eLearning > Basics of Gardening
- Enter edit mode
- Drop the tabs section from the right to the purple header
- Save
-> We can't switch tabs

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

The `description` and `description_short` were converted from Text
field to Html fields in 6d914c005183aa5ae69650e3002a5a85ca83b4a6

Solution
========

Set the `sanitize_form` and `sanitize_attributes` to False

See odoo/odoo#47318

opw-2950825

closes odoo/odoo#107314

X-original-commit: e7f0f0a33bdee8520838a128e42cd4bdbd75267d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-06 14:34:45 +01:00
Hubert Van de Walle (huvw) e23f0e1125 [FIX] web: kanban: add a onPagerUpdate callback
Use case:
in the reconciliation widget, we need to know when the pager
is updated before the next render because we need to select the
appropriate id to use.

cf the following PR: https://github.com/odoo/enterprise/pull/33631

opw-3031131

closes odoo/odoo#106581

X-original-commit: 19523b511d54278613a3d3e7389a51665dcc3fc1
Related: odoo/enterprise#34408
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-25 18:55:54 +01:00
Hubert Van de Walle (huvw) 7562ff4915 [FIX] account,sale_management: Uom should not be displayed when disabled
Steps to reproduce
==================

- Use a mobile phone / mobile view in devtools
- Go to Accounting > Customer invoices
- Click on one item
-> A traceback occurs, the uom is missing

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

The field is declared as
  `<field name="product_uom" groups="uom.group_uom"/>`

The raw value is accessed with
  `<t t-esc="record.product_uom.value"/>`

Solution
========

Add the missing group

opw-3070671

closes odoo/odoo#106066

X-original-commit: 6563e7b077ade8da333b710578a23ee8ac23a025
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-18 17:03:59 +01:00
Hubert Van de Walle (huvw) fdd60894ae [FIX] web: rtl assets in ltr language in debug mode
Steps to reproduce:

  - Switch to `?debug=assets`
  - Change the user language to Arabic and back to English
  -> The page is still displayed in rtl mode

Cause of the issue:

  The css is retrieved like this

  ```py
  >>> self.env['ir.attachment'].sudo().search([('url', '=like', '/web/assets/%/web.assets_common.css')])
  ir.attachment(212, 189)

  >>> self.env['ir.attachment'].sudo().search([('url', '=like', '/web/assets/%/web.assets_common.css')]).mapped('url')
  ['/web/assets/212-5d47380/rtl/web.assets_common.css', '/web/assets/189-5d47380/web.assets_common.css']
  ```
  Only the second one should be matched.

Solution:

  Check for the absence of an extra parameter in the url

opw-2892012

closes odoo/odoo#105127

X-original-commit: 539427fa2a099b29adf099c2b48d4f1d2fd4ebd2
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-17 10:57:10 +01:00
Hubert Van de Walle (huvw) 94392f8947 [FIX] purchase: Uom should not be displayed when disabled
Steps to reproduce
==================

- Use a mobile phone / mobile view in devtools
- Go to Purchase > Purchase Orders
- Click on one item
-> A traceback occurs, the uom is missing

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

The field is declared as
  `<field name="product_uom" groups="uom.group_uom"/>`

The raw value is accessed with
  `<t t-esc="record.product_uom.value"/>`

Solution
========

Add the missing group

opw-3033650

closes odoo/odoo#105487

X-original-commit: bc6c2d8d15e22f6af720db6a28e21739defede94
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-14 09:28:36 +01:00
Hubert Van de Walle (huvw) b214c62e26 [FIX] web: mobile: scroll in selection mode
This is a port of https://github.com/odoo/enterprise/pull/30046 for wowl

Steps to reproduce:

On a mobile device:
- Go to Inventory > Product Variants
- Switch to the list view
- Long press on a record
-> We can't scroll to select records below the current screen

closes odoo/odoo#105545

X-original-commit: cd874593b2390efba8e92228f85e9cf07c0e1a8c
Related: odoo/enterprise#33861
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-10 17:53:54 +01:00
Hubert Van de Walle (huvw) 3de9e58239 [FIX] project: grouped by personal stages in kanban -> user == current user
Steps to reproduce
==================

- Go to project > My tasks
- Click on load More on the first column
- Nothing is loaded

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

The orm groups by stages for each stage where the user is
the current one or null
-> This returns a null stage when the left join has not match
   But we only want stages linked to the current user

Solution
========

When loading project kanban groups and isGroupedByPersonalStages is true:
Add the user_id to the domain

This is the same solution applied in saas-15.3

https://github.com/odoo/odoo/blob/f463d9a6ba95c0df64268b1c577f1b9d1c5bcb25/addons/project/static/src/js/project_kanban.js#L342

opw-3033943

closes odoo/odoo#105367

X-original-commit: 1294ff85aa54aa195e2f1554c6ef426869b90c75
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-08 20:45:44 +01:00
Hubert Van de Walle (huvw) a11033d42c [FIX] mrp: division by 0 when computing the production capacity
Steps to reproduce
==================

- Create a BOM
- Add a line with a product of type product
- Set the quantity to 0
- Save and click on overview

-> ServerError: Division by 0

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

Lines with a quantity of 0 should be excluded from the computation

opw-3053167

closes odoo/odoo#104980

X-original-commit: b0f5170252ed73d31543b8d1dcf114ae6f0b65bc
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-04 13:00:55 +01:00
Hubert Van de Walle (huvw) 95024f8bcb [FIX] project: applychanges for personal_stage_type_ids
Steps to reproduce
==================

- Go to Project > My tasks
- Drag a card to another column
-> An error occurs

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

`personal_stage_type_ids` was not changed to `personal_stage_type_id`

opw-3036820

closes odoo/odoo#104442

X-original-commit: 3afc32af953556227dc07f8c65b5301d10fa92fe
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-10-28 13:23:06 +02:00
Hubert Van de Walle (huvw) 7b948a731f [FIX] web: discard rejected reloadProms in magicReload
Steps to reproduce:

  - Go to a list view with multiple items
  - Click on an item
  - Delete it
  - Go back in history twice (Using the browser navigation) to return to the list view
  -> We can't click on another record

opw-2854113

closes odoo/odoo#103808

X-original-commit: 92c90823139b413c8289d1c323ad694fc8220a61
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-21 17:17:19 +02:00
Hubert Van de Walle (huvw) e7fd6bedf6 [FIX] calendar: duplicated emails when creating allday meeting
Steps to reproduce:

  - Switch to debug mode
  - Go to calendar
  - Create an allday event in the future named test
  - Add an attendee with an email address
  - Save
  - Go to Settings > Technical > Email > Emails

  Two emails have been sent:
  * Invitation to test
  * test: Date updated

Cause of the issue:

  The method `_inverse_dates` is called when creating an event,
  triggering a write on the start field.
  This then causes an update email to be sent

Solution:

  Add a context key and don't send the update email if it is present

opw-2841276

closes odoo/odoo#100925

X-original-commit: d1e55727d010de2cd05bd2871b60d0e95caaaebf
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-09-23 07:21:40 +02:00
Hubert Van de Walle (huvw) c1809ab7dc [FIX] mrp_workorder, sign: missing styles for the pdf_viewer
The class for the pdf_viewer field changed from o_field_pdfviewer to
o_field_pdf_viewer

closes odoo/odoo#100014

Related: odoo/enterprise#31237
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-09-16 19:17:08 +02:00
Hubert Van de Walle (huvw) 04b3a890d4 [FIX] web: duplicated breadcrumbs when discarding settings
Steps to reproduce:

  - Go to settings
  - Click on discard
-> the breadcrumbs contains twice the "Settings" entry.

This commit fixes the issue by restoring the legacy behavior in
the "Discard" button handler, that is, calling doActionButton with
the special="cancel" param. This had been changed by mistake during
the conversion of the settings form view.

To make the fix work, a slight changed has been done in the model
as well, as reloading a datapoint could lead to the creation of
a new datapoint (typically when it's a new record), so the handle
must be updated in this case.

closes odoo/odoo#99904

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-12 11:38:18 +02:00
Hubert Van de Walle (huvw) 50b47fee1b [FIX] web: innergroup separator should add a new line
Steps to reproduce:

  - Go to Accounting > Configuration > Chart of account
  - Click on the setup button on the "Current Assets" line
  - items are not correctly aligned

Cause of the issue:

  `<separator/>` should take an entire row
  The separator was on the same row as the field label.

closes odoo/odoo#99641

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-09-12 10:07:20 +02:00
Hubert Van de Walle (huvw) f592c67c37 [FIX] web: missing styles on o_form_nosheet
Steps to reproduce:

 - Go to reconciliation models
 - Click on Line with Bank Fees
 - Click on a x2many line
 -> The popup is missing some padding

closes odoo/odoo#99539

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-05 18:35:51 +02:00
Hubert Van de Walle (huvw) e173961afb [FIX] web: mobile: highlight for selected record in list view
Steps to reproduce:

  - Load odoo on a mobile view
  - Go to Inventory > Products > Products Variants
  - Switch to the list view
  - Long press a record to enter the selection mode
  -> The selected records should be highlighted in blue

closes odoo/odoo#98186

Related: odoo/enterprise#30465
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-20 09:12:53 +02:00
Hubert Van de Walle (huvw) a5752e1e65 [FIX] web: parseMonetary with NBSP as a thousands separator and no currency
Steps to reproduce:

  - Switch language to french
  - Refresh the page
  - Create a new payment
  - Select a partner
  - Enter an amount of 100000,00
  - Save the record
  -> The following field is incorrect: amount

Cause of the issue:

 Since https://github.com/odoo/odoo/pull/97425 ,
 `parseMonetary` wrongly assumed that a currency was always passed in
 the parameters

opw-2937403

closes odoo/odoo#97861

X-original-commit: 9d518f847d2204fc5159a92bc4e4de655acf88fa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-08-10 01:59:48 +02:00
Hubert Van de Walle (huvw) 92e700fc08 [FIX] web: parseMonetary with NBSP as a thousands separator
Steps to reproduce:

  - Switch odoo language to french
  - Create a client bill for Azure Interior of $1 000 000
  - Confirm it
  - Go to the accounting dashboard
  - On the bank, click on reconcile
  - Select Azure interior
  - Click on the correct bill
  - Switch to Manual operations
  -> $1 000 000 is not a correct monetary field

Cause of the issue:

  Recently in https://github.com/odoo/odoo/pull/94126 , `formatMonetary`
  switched from joining the currency and symbol from `&nbsp;` to a non
  breaking space, NBSP.
  To parse monetary values, the behavior was to split around NBSP to
  get the symbol on one side and the value on the other which is then
  passed to `parseFloat`.

  For the following examples, NBSP is replaced with an underscore.
  So `$_1000` becomes `$, 1000`
  But some languages such as french uses the same char as thousands
  separator.

  In that case, `$_1_000` becomes `$, 1, 000` and then the parse fails.

opw-2937403

closes odoo/odoo#97513

X-original-commit: 9d36722797669498dfd1ad4659e5f29347ba30f3
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-08-05 04:44:56 +02:00
Hubert Van de Walle (huvw) f848b9f59b [FIX] l10n_in: studio: Unable to edit the GST Treatment field
Steps to reproduce:

  - Install Studio, Contacts, l10n_in
  - Go to Contacts, open studio on the form view
  - Edit the GST Treatment field name
  -> No changes are made

Cause of the issue:

  When combinings views to generate the final arch, extensions are
  ordered by priority. Studio edits have a priority of 99 but in this
  case, there is an override with a priority of 100.

opw-2899654

closes odoo/odoo#96713

X-original-commit: b97daa993347acd763c080eb8f5f4157a3359ab8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-27 23:38:50 +02:00
Hubert Van de Walle (huvw) 96c2716674 [FIX] stock: history back on the forecast report
Steps to reproduce:

  - Go to stock > Replenishment
  - Click on a forecast report widget
  - Go back using the browser arrows
  -> The page is redirected to another forecast report and the
  breadcrumbs are cleared

Cause of the issue:

  The forecast report action uses the `window.history.pushState` to
  add the active model in the url.
  When going back, the new url is the same one but without the active
  model.
  We can get the correct behavior by doing `window.history.go(-2)` in
  the console.

Solution:

  Use `history.replaceState` instead

opw-2917725

closes odoo/odoo#96487

X-original-commit: b39dc5488bacb704aaa60f1a502bf005d57f3276
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:47 +02:00
Hubert Van de Walle (huvw) c21101c161 [FIX] account: mobile: unable to add lines to misc journal
Steps to reproduce:

  - Load odoo on a small screen / mobile phone
  - Go to accounting > Miscellaneous Operations
  - Click on create
  -> The button to add a line in Journal Items is missing

Cause of the issue:

  On mobile, the kanban view is used for Journal Items
  The kanban view used [0] has an attribute `create="false"`

Solution:

  Override the `create` attribute when the kanban view is a subview

[0]: https://github.com/odoo/odoo/blob/93520cc291ffb76dd1425e413f29653df37b4062/addons/account/views/account_move_views.xml#L94

opw-2870637

closes odoo/odoo#96484

X-original-commit: 31ac34816e61d66479dbd11ebb9c5348c3f12886
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-21 01:53:44 +02:00
Hubert Van de Walle (huvw) 185662808d [FIX] calendar: event recurrence start date is not correctly computed
Steps to follow:

  - Set your timezone to New York
    In linux for example with: `timedatectl set-timezone America/New_York`
  - Verify that the user timezone is also set to NY
  - Create a reccurent event the 6 july 2022 (a wednesday)
  - In options, check the recurrent box
  - Set repeat to once every week
  - Thursday is the only day checked
  -> It should be Wednesday

Cause of the issue:

  When `_compute_recurrence` is called, `event.recurrence_id` has not
  yet been set
  -> `event.recurrence_id.event_tz` is False
  => Copy the defaults before computing the start date and check the
  timezone of the event itself

opw-2886253

closes odoo/odoo#96049

X-original-commit: 7186dbad38ef1f05919c398f3c0c5f5d8f8b2219
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-15 19:16:00 +02:00
Hubert Van de Walle (huvw) 9392129e96 [FIX] mail: update record after activity edit
Steps to follow:

  - Go to a crm.lead
  - Schedule an activity
  - Click on edit
  - Click on mark as done in the popup
  - Move the lead to a new stage
  -> A missing record error is displayed for the activity

Cause of the issue:

  Once the activity has been mark as done (deleted),
  The crm.lead record is not updated. The old activity is then
  passed to the server where an error is thrown

Solution:

  Update the main view after editing an activity

opw-2878984

closes odoo/odoo#95748

X-original-commit: 0a740e819b7f2aa7feb527bb3223b272e4c9f967
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-11 20:25:23 +02:00
Hubert Van de Walle (huvw) 5212b01cfd [FIX] mail: permission error when editing a mail.message
Steps to follow:

  On a runbot,
  - Login as Mitchell Admin
  - Set the Administration permission of Marc Demo to Access Rights
  - Login as Mark Demo
  - Go to the Discuss App
  - Edit a message from someone else by clicking on the pencil
  -> A Traceback occurs

Cause of the issue:

  - The pencil button is only displayed for another user if the logged in user
    is admin. This is done by checking if the user is superUser or if he
    has the group `base.group_erp_manager`
    This is the case here
  - When editing the message, the `base.group_system` is checked.
    In this case, it is not present.

Solution:

  Check the `base.group_erp_manager` in both cases

opw-2892740

closes odoo/odoo#95502

X-original-commit: bd8ed439d1d9342b24926eee332e8c26c6f0cd7c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-07 14:44:37 +02:00
Hubert Van de Walle (huvw) 91d58bd260 [FIX] web: owl_compatibility: force status 1 on attach callback
When a widget is detached form the DOM, we manually set the owl status of
the corresponding node to 0 (new), but we before this commit, we didn't reset it
to 1 (mounted) when the widget was re-attached. As a consequence, event handlers
were not bound anymore.

Steps to reproduce:
  - Open Inventory
  - Click on Products > Lots/Serial Numbers
  - Open a product
  - Click on the Traceability smart button
  - Click on a reference (eg: Inventory Adjustment)
  - Click on the Traceability Report breadcrumb
  -> Breadcrumbs are not working anymore

opw-2838994

closes odoo/odoo#95375

X-original-commit: 7945f7c40045def5e46e8a2f91bdfcc3a42d9f78
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-07-06 09:30:43 +02:00
Hubert Van de Walle (huvw) 2a9ee1307a [FIX] point_of_sale: close popup buttons hidden on mobile
Steps to follow:

  - Use a mobile view in the browser dev tools
  - Open the POS app
  - Perform a Sale
  - Close the session

opw-2788751

closes odoo/odoo#94587

X-original-commit: 654cdb5b8a46c9b44d432f05bcaf29d20fe3e306
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-06-27 10:10:40 +02:00
Hubert Van de Walle (huvw) a499263dd3 [FIX] web: mail.MessagingMenu isn't always added in the systray
Steps to follow

  - Use chrome
  - Connect to a runbot with the demo account
  - After a couple refreshes, the mail.MessagingMenu isn't displayed

Cause of the issue

  The navbar should be updated when there is a new item added to the systray registry.
  For that, the navbar listen to the update event with the `useBus` function.
  `useBus` itself uses `useEffect` which only starts listening after a component has been mounted/patched.
  -> The update callback is never called in this case because new items are added before the callback is registered.

opw-2801467

closes odoo/odoo#92768

X-original-commit: c2fd26881ceae95417e2a0afc71fdf8567e3b8c0
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-06-02 16:54:25 +02:00