Commit Graph
152817 Commits
Author SHA1 Message Date
Michael (mcm) df966f5fde [IMP] web,fleet: convert FleetFormController
This commit converts FleetFormController with the new FormController

closes odoo/odoo#96781

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-03 02:26:39 +02:00
Zelong Lin 3ee2363a56 [REF] discuss: rewrite tests on test_mail_channel
rewrite some asserts on test_mail_channel.

task-2893661

closes odoo/odoo#94510

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-02 23:56:54 +02:00
Zelong Lin d072e6a860 [REF] discuss: rewrite setup classes on mail tests
rewrite setup classes on test files. Making it clear
for adding asserts in the future.

task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Zelong Lin 692ba8dc03 [IMP] discuss: adding groups into channel_create
task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Zelong Lin e3dcad0fb7 [REF] discuss: rename variables on mail tests
rename some variables on test files to make a better sense.

task-2893661

Part-of: odoo/odoo#94510
2022-08-02 23:56:53 +02:00
Romain Derie 701a775ec4 [FIX] website: add longer timeout to long website form test
This test is quite long as it is testing all the website form behaviors
in edit mode.
It is sometime failing due to the tour taking longer than 60 seconds.

runbot-4257

closes odoo/odoo#97336

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-02 18:44:02 +02:00
Adrien Widart 65d5e7900f [FIX] {sale_,}stock: decrease the SOL qty with MTSO rule
To reproduce the issue:
1. In Settings, enable "Multi-Step Routes"
2. In the Routes, unarchive the route R called "Replenish on Order
(MTO)"
3. Create a storable product P
4. Update its quantity: 10
5. Create and confirm a sale order with one line:
    - Product: P
    - Quantity: 10
    - Route: R
6. Update the SO line:
    - Quantity: 8

Error: Once the SO is saved, 2 new deliveries are created:
- One from Customers to Stock with 2 x P (this one should be merged with
the existing one)
- One from Stock to Vendors with 2 x P (his one should not exist)

The route R only contains one rule, which is a MTSO one. On step 5, when
confirming the SO, `_run_pull` will be called and will create a stock
move SM01 based on that rule. In case of a MTSO rule and because there
are already some available P, the procure method of SM01 will be MTS
(see [1]). Then, once SM01 is created, we will confirm it and we won't
do anything more.

The process is not the same on step 6. When saving the SO, `_run_pull`
is called again but this time, because the needed quantity is negative
(-2), the procurement method is set to MTO (see [1]). Therefore, when
confirming such a stock move, two undesirable consequences occur:
- Because its procure method is not the same than SM01, we won't merge
the stock moves (this explains why a picking is created from Customers
to Stock)
- Because its procure method is MTO, we will create and run a
procurement to get -2 x P at Stock. It will find a rule thanks to the
route "Receive in 1 step". The rule creates a receipt from Vendors to
fulfill the need. This explains why an unexpected picking is created.

When processing a procurement with a MTSO rule and a negative quantity,
if we want to know the procurement method of the new SM, we should try
to find and copy the decision we took for the positive move (if it
exists). That way, we ensure that the 'returning phase' (the quantity
decreasing) will follow the same behavior as the initial one (when we
confirmed the SO).

[1]
https://github.com/odoo/odoo/blob/20e0ad13afa2a0ff85d555ab57a6800d3db30341/addons/stock/models/stock_rule.py#L244-L254

OPW-2885751

closes odoo/odoo#97332

X-original-commit: 8c6d282de13b205436a7c5c49facd3efc71a740f
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-02 18:43:56 +02:00
Julien Van Roy 5cb18d286e [FIX] delivery: avoid invisible product_uom_id
Since commit 5ccc32fcf7, it's no longer
possible to write on invisible fields.

Make sure the field product_uom_id is visible to avoid a traceback.

closes odoo/odoo#97313

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-08-02 18:43:50 +02:00
Ivan Yelizariev 7b56fc4c71 [FIX] web: fix space symbol in monetary field's title in list view
Browsers don't render html entity in the "title" attribute and we cannot use
them. Otherwise we may get values like "$&nbsp;100".

Fix it by using special character and not html entity. It works both in html
strings and attributues

The problem was reported here:
https://github.com/odoo/odoo/pull/90191#issuecomment-1156034355

STEPS: open invoice and put pointer over monetary field in the list.

Note, that to reproduce the problem, the widget should not be specifed
explicitly. See
https://github.com/odoo/odoo/blob/5b9fada39913cd456a3659faef1160f84ae19860/addons/web/static/src/js/views/list/list_renderer.js#L436-L439
https://github.com/odoo/odoo/blob/5b9fada39913cd456a3659faef1160f84ae19860/addons/web/static/src/js/views/list/list_renderer.js#L452-L456

closes odoo/odoo#97323

X-original-commit: e4ff65b8d9b46dcddab100e5eb4901eaa94e7009
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-08-02 15:49:54 +02:00
Dardenne Florent (dafl) 20369e46e1 [FIX] tooling,base_setup: fix whitelist syntax
closes odoo/odoo#97234

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-02 15:49:50 +02:00
Dardenne Florent (dafl) fc7b8bccb0 [REF] purchase: convert toaster button widget
Part-of: odoo/odoo#97234
2022-08-02 15:49:50 +02:00
Dardenne Florent (dafl) 7b7ece114a [IMP] tooling,purchase: whitelist purchase module js
Part-of: odoo/odoo#97234
2022-08-02 15:49:50 +02:00
Lucas Perais 6e18fb3c35 [FIX] web: field: relational: search more: _view_ref passed in context
Have a x2many field with a _view_ref (ie tree_view_ref) in its context
Open the select create dialog (Search More) of that field

Before this commit, there was a crash because the _view_ref string was passed to the get_views
as if it were an Integer ID.

After this commit, there is no crash, and the select create dialog opens correctly.

closes odoo/odoo#97224

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 15:49:44 +02:00
Sébastien Geelen (sge) 59f45f7c47 [FIX] web_editor: correct link behaviors
* Broaden the valid URL pool by including some URL without subdomain
 if they have a white listed TLD.

* Change a link 'href' when we change the link label,
 if the new label is a valid URL.

* Ensure the domain extension cannot be only digit.

task-2858621
task-2901795

closes odoo/odoo#97297

X-original-commit: 500bc6dc9958fe8a9ca396f87544e8866efa744b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-02 13:06:45 +02:00
Sébastien Geelen (sge) bacda923e2 [FIX] web_editor: adapt link unit tests
Change the unit test to reflect new spec:

* Some TLD are white listed to not required a subdomain to be considered a valid URL.
 => .com, .net, .org + all ccTLD

* URL of a link need to be changed to equal the label, is the label is a new valid URL.

* Domain Extention cannot be only digit

task-2858621

X-original-commit: c13ba3ec771334c9cd7708305b40b9bf1a234bcc
Part-of: odoo/odoo#97297
2022-08-02 13:06:45 +02:00
David Monjoie 0a4fcbfb68 [FIX] web_editor: fix insertText test util for multiple characters
task-2858621

X-original-commit: 308a039d96e709bc0ef27ba77af20abfde881ea3
Part-of: odoo/odoo#97297
2022-08-02 13:06:44 +02:00
Nicolas Pierre 92744b7895 [FIX] mrp: allow creation of QC for MO backorders
Since https://github.com/odoo/odoo/pull/77254, Quality Checks are not
created on the backorders of a MO because the moves of the backorders
are not confirmed anymore. We therefore create the QC of the backorders
at the confirmation of the workorders.

closes odoo/odoo#97296

Task-id: 2901900
Enterprise-pr: https://github.com/odoo/enterprise/pull/29476
X-original-commit: 702dd5c902c40972e4362d28c8f10a1eb911a241
Related: odoo/enterprise#30033
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-08-02 13:06:36 +02:00
Romeo Fragomeli 18b4d919df [IMP] mail: add support for RTL in discuss public
As `discuss_public_channel_template` is sandboxed for the `webclient`
the following CSS rule is not applied anymore.
```css
.o_web_client {
  direction: ltr;
}
```

This commit adds it specifically for this template to reflect the
language direction in this sandboxed environment.

closes odoo/odoo#95893

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-02 13:06:33 +02:00
Samuel Degueldre b099b0cb35 [IMP] web: tooling: abort commit if tooling is outdated
Currently, if your tooling is not up to date, the pre-commit hook will
happily just format your code with the outdated config. This is
undesirable because the next person to touch the file with an up-to-date
config will introduce a bunch of linting noice in their commit.

This commit adds some basic checking by comparing the config files and
aborting the commit if they are out of date, and suggesting a refresh
when the eslint/prettier config files have changed or a full reload if
the package.json has changed.

closes odoo/odoo#97286

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-02 11:49:17 +02:00
Samuel Degueldre 4d380f8753 [IMP] web: tooling: add a refresh script
This commit adds a refresh script which is a lightweight alternative to
the reload script in case the package.json hasn't changed but some
eslint/prettier files have been changed (new rules or ignored files).

Part-of: odoo/odoo#97286
2022-08-02 11:49:17 +02:00
Samuel Degueldre 4949829e20 [IMP] web: enable prefer-const and curly rules in eslint config
The prefer-const rule disallows using const on variables that are never
reassigned, this improves readability by allowing the reader to know in
advance that all variables that are declared with const are never
reassigned and all variables declared with let will eventually be
reassigned.

The curly rule disallows braceless if/else, for and while which is a
rule we have thus far been enforcing by hand.

Part-of: odoo/odoo#97286
2022-08-02 11:49:16 +02:00
Lucas Perais 6be7d3ee4a [FIX] web: views: basic relational model: can save without any dirty translatable fields
Be in another language, edit and save a record which has translatable fields.

Before this commit, there was a crash because no changes were done on the record, making
a programming error.

After this commit, we can edit and save a record with translatable fields without changes.

closes odoo/odoo#97240

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 11:49:07 +02:00
FrancoisGe f10d5b665d [FIX] web: leave a listView with an empty new record
Before this commit, in a list view, if you create a new record without
modifying it and then exit the action then your new empty record will
be saved.

This causes two problems:
- you don't want to save a new empty record
- you get a "View can't be saved" error if there is a require field

The solution is to abandon new invalid records if they have not yet
been modified.

closes odoo/odoo#97169

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 11:49:00 +02:00
Martin Trigaux ffc525419a [IMP] base: avoid render with env mixup
The render API was confusing as mixing the access to the report and
the rendering env.

The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.

This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value

This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.

Task-id 2670865

closes odoo/odoo#91341

Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-02 11:48:46 +02:00
FrancoisGe 96d7fd67e1 [FIX] web: duplicate translation alert
Before this commit, it is possible to have duplicate field names in an
alert translation.

How:
- enable multi-language
- go to a form view with at least one translatable field
- edit the value of that field
- click on save (the translate alert displays the field name once)
- edit the same field a second time
- click on save

Result Before:
The translate alert displays the field name twice.

Result After:
The translate alert displays the field name once.

closes odoo/odoo#97287

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 10:32:14 +02:00
jjbenavaz c724126791 [IMP] base: add index and unaccent to store_fname field on ir_attachment model
Improves the odoo garbage collector for large amounts of attachments.

The odoo garbage collector takes around 20 sec to process 1000 records. In one of our deployed projects with production data, there are 790,000 records. According to our tests, each batch of 1000 records takes 20 seconds and hence the whole process is currently taking around 4 hours to complete, as shown below:

(790,000 records / 1000) * 20 sec *(1 min / 60 sec) * (1 hour / 60 min) = 4.38 hours.

Since the Odoo garbage collector routine runs periodically and currently takes more than 4 hours, this behavior is not acceptable in this application, because if there is any other app that tries to use attachments at the same time (for instance invoicing), it will not be able to do it since the Odoo garbage collector will lock the table, leading to a deadlock.

After adding the index parameter to the store_fname field the total time decreased drastically from 4 hours to 10 seconds since now each batch of 1000 k records takes only 13 ms.

closes odoo/odoo#97281

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-02 10:32:11 +02:00
Nicolas Seinlet b2b370062f [FIX] stock_dropshipping: lack of picking type
Sometimes, no picking type match the domain, but picking_type_id is a required field.

closes odoo/odoo#97278

X-original-commit: afcad067bccc7676b4e40cc57f8d9b5792068802
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-08-02 10:32:07 +02:00
Andrea Grazioso (agr-odoo) dba09e4874 [FIX] l10n_it_edi: attachments from xml missing res_model/res_id
Install Documents
Open Settings > Documents, enable 'Accounting' files centralization
Configure 'Journals' with a single line
- Journal -> Vendor Bills
- Workspace -> Finance / Supplier Invoices
Now in go to Accounting>Vendor>Bills
Upload an xml representing a vendor bill, including an attachment
encoded in the <Allegati> tag
Open created bill

Traceback. The error is caused by the attachment included in the xml
registered without res_id/res_model.
In the document flow the attachment will receive a res_id, but not the
res_model, causing the traceback when retrieving the attachment

opw-2919610

closes odoo/odoo#97277

X-original-commit: 377e8eedb2ceb444d6b331debdffa17c47e4a898
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-08-02 10:32:04 +02:00
Antoine Vandevenne (anv) 011567782e [FIX] payment: fix the condition for the "Manage payment methods" button
The button should only be shown if a tokenization-capable acquirer is
enabled (or if a token already exists), but a typo made the button being
shown regardless of that (first) condition.

closes odoo/odoo#97276

X-original-commit: b301844cbdcb07b4e13186cae85257b18ca54654
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-08-02 10:32:00 +02:00
William Braeckman 2179401726 [FIX] sale_loyalty: fix invalid invoice status
The invoice status was badly computed since the loyalty refactor due to
the use of the wrong value when comparing to the previous state.
(to_invoice instead of to invoice)

TaskId-2936708

closes odoo/odoo#97002

X-original-commit: e88dcd26eebf0e527929a0c48e259895822cf23e
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-02 10:31:54 +02:00
Bruno Boi ab3032465c [FIX] web: invalid date/datetime value/range/domain in mockReadGroup
The mock server's mockReadGroup function would not properly compute the
value, range and domain of the returned groups for date/datetime fields.
The value should be expressed in the local timezone,
and the range/domain shoulb be expressed in UTC timezone.

Consider the following:
- a record with a datetime field of value "2016-12-14 12:34:56" (expressed in UTC)
- a user with an UTC+2 timezone offset
- a read_group with groupby "['datetime:hour']"

The corresponding group would have had the following metadata:
- value: `"12:00 14 Dec"`
- domain: `[["datetime", ">=", "2022-12-14 11:00:00"], ["datetime", "<", "2022-12-14 12:00:00"]]`
- range: `{ from: "2022-12-14 11:00:00", to: "2022-12-14 12:00:00" }`

It now has the following valid metadata:
- value: `"13:00 14 Dec"`
- domain: `[["datetime", ">=", "2022-12-14 12:00:00"], ["datetime", "<", "2022-12-14 13:00:00"]]`
- range: `{ from: "2022-12-14 12:00:00", to: "2022-12-14 13:00:00" }`

closes odoo/odoo#96946

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-02 09:19:57 +02:00
Bruno Boi 9d1786c361 [IMP] web: account for local timezone when formatting dates
formatDate and formatDateTime had their default 'timezone' option set to
false but this was changed to true in order to have the same behavior as
the legacy formatDate and formatDateTime functions.

Part-of: odoo/odoo#96946
2022-08-02 09:19:56 +02:00
Bruno Boi 400ffa0861 [IMP] web: update luxon from 2.4.0 to 3.0.1
See [upgrade guide](https://moment.github.io/luxon/#/upgrading?id=_2x-to-30)

Part-of: odoo/odoo#96946
2022-08-02 09:19:56 +02:00
Ipsita Borisagar c365ed3925 [FIX] mass_mailing: should not land on top
Before this commit:

When the page is expanded and try to add any block with an image, try to change
the image using replace button. It lands the user at the top of the page instead
of staying image place.

After this commit:

The user will stay at the image place after clicking on replace button.

Task-2753302

closes odoo/odoo#97266

X-original-commit: da4fdd90622b1f6ba2e45e717fcb4fdde09033af
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-02 08:09:41 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Alvaro Fuentes 45c3121ce7 [FIX] stock: fix KeyError for archived warehouses
The below line raises a KeyError when `warehouse` refers to an archived
warehouse.
https://github.com/odoo/odoo/blob/01cc43b0578ecc9d1fed37a12b2468ffc9d4aedd/addons/stock/models/stock_orderpoint.py#L396

The reason is that the SQL view created on
https://github.com/odoo/odoo/blob/01cc43b0578ecc9d1fed37a12b2468ffc9d4aedd/addons/stock/report/report_stock_quantity.py#L28-L37
doesn't take into account whether the warehouses are archived or not.

The solution proposed here is to fetch all warehouses to ensure the
lookup doesn't fail. Alternatively the view could be updated but that
will be a bigger change.

This issue was detected during the upgrade 226754

closes odoo/odoo#97259

X-original-commit: aaa7fb8f2de6d2a0310215f694c5b1cd5d813ebe
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
2022-08-01 20:41:11 +02:00
Guillaume (guva) 57b7c4ddd3 [FIX] account: customer address show in invoice report
When printing an invoice, the customer address
was not displayed if there was no delivery
address specified.

As the address should be displayed at the same place
than when the delivery address and customer address
are the same, we just paste the code from the related
condition.

opw-2899259

closes odoo/odoo#97248

X-original-commit: c0544097d38fae25decb096808dbbdec0cdb5c4d
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2022-08-01 20:41:08 +02:00
Andrea Grazioso (agr-odoo) f80d3924fa [FIX] account: reconciliation of 0 balance line in automatic entry
Open Accounting>Journal Items
Select 1+ items with 0 credit/debit
Hit Actions>Automatic Entries
In the wizard choose 'Change Period', select an Accrued Account with
'reconcile' flag and confirm

Error will raise 'You are trying to reconcile some entries that are
already reconciled.'
This occurs because new entries, with 0 balance, will be created to match
the selected one. The flow include a reconciliation step in which the 0
balance will raise the error.

With this patch the problematic lines will be created but not reconciled

opw-2909058

closes odoo/odoo#97228

X-original-commit: 2433d5daec851293abcd04332dcbb589ceba92c1
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-08-01 20:41:04 +02:00
Touati Djamel (otd) 48a6f88c50 [FIX] product: prevent printing labels for archived products
Steps to reproduce the bug:
- Create a storable product
- Archive it
- Try to print labels

Problem:
A traceback is triggered, Because when we click on print the label
we have to open the wizard, so we load the wizard model
`product.label.layout` via an onchange:
https://github.com/odoo/odoo/blob/15.0/odoo/models.py#L6357-L6360
thanks to the context, it will find the concerned product
(via default_product_id) Except that the product is archived,
so ignored in the result returned by the onchange

therefore, in the confirmation, we will create the wizard,
but it will not have a product filled, so in the `_prepare_report_data`
function we do not enter in the if or the elif:
https://github.com/odoo/odoo/blob/d9f45ba6941939b3d4b40beb5abbc330be84d695/addons/product/wizard/product_label_layout. py#L49-L54

it will therefore raise a traceback when we want to iterate on it:
https://github.com/odoo/odoo/blob/d9f45ba6941939b3d4b40beb5abbc330be84d695/addons/product/wizard/product_label_layout.py#L60

opw-2855659

closes odoo/odoo#97226

X-original-commit: 6dcec12074014434ce1283449700aa352993ac0c
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-01 19:37:20 +02:00
mafo-odoo bccd2f3f09 [FIX] website_sale_comparison : error when entering number of item in product
Steps to reproduce:
- Install eCommerce with product comparator
- Open the product in </shop>
- Change the product quantity
- Click on the <Enter> key

Current behavior:
En error message appears.

Expected behavior:
No error message appears.

Explanation:
The productComparison widget overrided the submit with a selector
that was not specific to the comparison so its _onFormSubmit function
could be called from other pages creating errors. To solve the issue
we add a specific class to the form and to the selector.

opw-2936994

closes odoo/odoo#97221

X-original-commit: 600e6f3c7ab10b97684fa4268ce5501a3b61e628
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-01 19:37:17 +02:00
Alexandre Kühn 6c7f178bdc [IMP] im_livechat, *: Refactor JS Public Livechat (step 11)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2939083

closes odoo/odoo#97219

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-01 18:21:00 +02:00
Adrien Widart 47734939b4 [FIX] sale_stock,stock_account: avoid COGS generation if owned
When a delivered product was owned by an external partner, we should not
generate any COGS line

OPW-2884211

closes odoo/odoo#96882

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-08-01 18:20:57 +02:00
Adrien Widart 5c34cd00af [REF] sale_mrp: extract anglo-saxon tests
Part-of: odoo/odoo#96882
2022-08-01 18:20:57 +02:00
Michael (mcm) cbc8676dd0 [IMP] event: convert field IconSelector
This commit rewrites IconSelectorField using the new framework.

closes odoo/odoo#96782

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 18:20:53 +02:00
Adrien Widart bcb8434de7 [FIX] stock: get product qty in specific location
When getting the on hand quantity of a product in a specific location,
the result may be incorrect.

To reproduce the issue:
1. In Settings, enable "Storage Locations"
2. Create a storable product P
3. Update its quantity:
    - 5 x P at WH/Stock/Shelf 1
4. Inventory > Reporting > Inventory Report
5. Apply the following filters:
    - Product: P
    - Location: WH/Stock/Shelf 1
    - => There is a line with 5 x P at WH/Stock/Shelf 1, which is
correct
6. Click on Inventory at Date, set <Today>, confirm
7. Apply the following filters:
    - Product: P
    - Location: WH/Stock/Shelf 1

Error: There is a line for P but its on hand quantity is 0, which is
incorrect (should be 5)

In the first search, we let the ORM handle the domain conversion. When
searching for `('location_id', 'ilike', 'WH/Stock/Shelf 1')`, it will
use the `_rec_name` of the model to find the record. In case of a stock
location, its `_rec_name` is the field `complete_name`:
https://github.com/odoo/odoo/blob/94a8ad3fae914b046064bb7ce17572be8280f6e0/addons/stock/models/stock_location.py#L19

However, for the second search, when getting the on-hand quantity of the
product, we force the use of the field `name` to find the location.
Because the `name` of the searched location is "Shelf 1", using
"WH/Stock/Shelf 1" as key search will not work.

OPW-2920904

closes odoo/odoo#97187

X-original-commit: 9a651e13440d807ce3f455a3d334fa90caa3ce04
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-01 14:44:03 +02:00
dafl-odoo cc207bbe66 [REF] web,project: stacked line chart generalization
Add stacked option on line chart.
The option already existed in Project for burndown graph, so I exported
and adapted everything concerning stacked lines from Project to Web.

closes odoo/odoo#96833

Task-id: 2929576
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-08-01 14:44:00 +02:00
John Laterre (jol) 012c84cc62 [FIX] l10n_ch: fix typo in PDF export
Just fixing a typo in _render_qweb_pdf_prepare_streams().

closes odoo/odoo#97182

X-original-commit: 9cf1061b9a463e67e46468b5bf83a0e2059ded77
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-08-01 13:26:41 +02:00
Tom De Caluwéandqsm-odoo faff8ddb30 [FIX] web_editor, *: fix animations on transformed images
*: website

Setting transformations on images is handled by the jQuery transfo
plugin. This plugin, however, also manipulates animations related css
properties allowing the plugin to work on animated images.

After closing the transformation tools these properties stay in the DOM,
preventing the animation options to work properly. Animations are not
played when previewing or selecting a choice from the dropdown list.
Instead they remain stuck in their initial keyframe.

To avoid complications from the interaction between both options, this
commit hides either option when the other is activated. Additionally,
css properties added by the transform option are cleaned, avoiding
potential interactions after the transform option is reset again.

opw-2765529

closes odoo/odoo#97137

X-original-commit: 3ac59a7f841b528a32c14a2111e7a1a7e11c830a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-08-01 13:26:38 +02:00
Michael (mcm) e181eb6dd6 [IMP] hr: convert field WorkPermitUpload
This commit rewrites WorkPermitUploadField using the new framework.

closes odoo/odoo#96783

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 13:26:34 +02:00
Romeo Fragomeli a1dbac0f9b [FIX] web: adapt checkbox and boolean_toggle for BS5
In the BS5 migration, the legacy `checkbox` and `boolean_toggle` widget
were adapted but not the OWL Component.

Also, we have tweaked the old widget and the component to have better
positioning and margins.

Note:
the CSS for the print is already done in BS5
```css
@media print {
  .form-check-input {
    color-adjust: exact;
  }
}
```

Also we change `offsetWidth` by `getBoundingClientRect().width` in
`list_renderer` to avoid inaccurate rounding in columns width's
calculation.

Lastly a `.o-checkbox` class is added to the Checkbox component for a
more universal and context independent targetting.

closes odoo/odoo#96185

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-01 13:26:31 +02:00