Commit Graph
152602 Commits
Author SHA1 Message Date
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
Jacky (trj) e49029406c [FIX] point_of_sale, pos_{loyalty,mercury}: restricting key to confirm or cancel popup
The "pressing a specific key to confirm/cancel a popup" behavior was added but the problem was that
some popups only had one button which was either confirm or cancel. It was thus possible to close
those popups by bypassing the default behavior (e.g. possible to "cancel" a popup which only
has one button linked to an overridden confirm method and vice-versa). Also, we normalize the use of
`confirm` and `cancel` methods in the popups so that when the specifics keys are pressed, the right
behavior is executed.

closes odoo/odoo#97069

X-original-commit: a14ade59744855a9dea8b16f23a3d61eb88678de
Related: odoo/enterprise#29957
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-08-01 12:12:17 +02:00
Simon Genin (ges) a63141bbd8 [REF] web: convert ribbon widget
closes odoo/odoo#96843

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 12:12:11 +02:00
Simon Genin (ges) 150f63c1b6 [IMP] web, *: add extract props for view widgets
To make cleaner code and keep a similar API than fields, the
extractProps static method is added to the the widgets.
extractProps allows making new props out of the attrs of the widget
node.

Part-of: odoo/odoo#96843
2022-08-01 12:12:11 +02:00
Ivàn Todorovich 46f9f0de87 [IMP] website_sale_delivery: Cleanup useless code around _remove_delivery_line.
No need to set carrier_id to False.
This is already taken care by `delivery` module since 448312173.

closes odoo/odoo#79231

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-01 12:12:03 +02:00
FrancoisGe 11d79784f6 [FIX] web: create a Record in a ListView with a context
Before this commit, in a ListView, the view context was not used when
creating a record.

This caused some problems:
- the record does not use "default_" to initialise its data
- server-side required fields that are not present in the arch and
 have a value given in the context return server errors

closes odoo/odoo#97165

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 10:55:56 +02:00
Guillaume (guva) 63d44ffd35 [FIX] account: keep statement line note
We keep the statement line note when changing
the partner in reconciliation widget

Steps:

- Create a Bank Statement, a Bank Statement
  Line BSL with a note (field narration)
- Save, edit, change partner on statement
  line and save.
-> The note on BSL is empty

With this commit we allow narration computation
only for sale documents.

opw-2832287

closes odoo/odoo#97125

X-original-commit: 19394d1971259933c5158139c56344c9c35bdaed
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2022-08-01 10:55:47 +02:00
Louis Wicket (wil) fc2118f5c3 [IMP] mail: remove Record/create
The way the code has evolved, `create` is now no more than an
unnecessary indirection for `insert`.

This PR removes `create` and replaces its uses with `insert` directly.

closes odoo/odoo#97058

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-01 10:55:44 +02:00
Jorge Pinna Puissant 52509f04eb [FIX] web: take into account invisible buttons
Before this commit, an error was raised when an invisible button was
found on a list view (for example, if it has a group).

Now, the invisible buttons are correctly managed.

closes odoo/odoo#96963

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-01 10:55:40 +02:00
jlzhou a04c2f134e [FIX] project, web_editor: fix user_id missing bug in this.getSession()
auth_totp module added user_id in session_info, but it's not in the depends of project and web_editor module.

To avoid traceback after uninstalling auth_totp module:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0'),

we should use uid instead of user_id in js code.

closes odoo/odoo#96880

X-original-commit: 81b92a61907028f71b1337b11d0d60ee98bb5775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-01 10:55:37 +02:00
momegahed c004067287 [FIX] delivery: tax calculations are wrong on delivery products
Steps to reproduce:

1- install sale, accounting
2- create a fiscal position fp that maps
tax inc t1 to any other tax t2
3- create a delivery product dp with t1 and mark it "can be sold"
4- create a new delivery method with dp
5- in a new sales order, choose fp, click on add delivery
6- the unit_price is wrong, it hasn't mapped t1 to t2
7- try adding the delivery as a product in a new sales order line
8- the unit_price is correct and the taxes are correctly calculated

Bug:

 `_create_delivery_line` is not using the same logic used
 when normally adding a sales order line although technically
 delivery product is still a product

Fix:

use `_get_tax_included_unit_price` to get the correct unit_price

OPW-2806965

closes odoo/odoo#96874

X-original-commit: 03bb18d12606447faaed0de04bb83dde5de53b96
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-08-01 10:55:34 +02:00
Julien Castiaux ad71d6d3ee [REM] website_utm: website depends on utm already
`_post_dispatch` is a late addition to the httpocalypse. It can be used
to alter the response object e.g. to inject headers or cookies. The
function is automatically called for regular, fallback and error
responses. On the other hand, `_dispatch` is only called when an
endpoint is matched and might not return a response in case of error.

task-2839031

closes odoo/odoo#96651

Related: odoo/upgrade#3710
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-08-01 10:55:29 +02:00
Florian Damhaut 183a966ab5 [FIX] website_sale_wishlist: correct variant selection
Step to reproduce:
- Create variants for product without grid
- Go to website
- Try to add variant of created product to wishlist

Current behaviour:
- Product ID is not properly fetched
- Product template is added to wishlist

Behaviour after PR:
- Product ID is properly fetched
- Product is added to wishlist

opw-2705883

closes odoo/odoo#96274

X-original-commit: f7ce60511c64002b84d3b4dbd66a2f52becc46fc
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-01 10:55:25 +02:00
Ivan Yelizariev 31c45b321b [FIX] web: fix css issue with rtl in calendar view
This commit fixes following html block [1]

``` xml
<div class="fc-content">
            <span class="fc-time">08:00</span>
            <div class="o_event_title">Mitchel Admin - Administrator</div>
</div>
```

`rtlcss` lib changes `padding-right` to `padding-left`, which doesn't work if we
use `span` block next to `div` block, because position of the blocks are not
changed (time is still on the left side and title is on the right). Adding the
`ignore` directive solves the issue.

[1]: https://github.com/odoo/odoo/blob/4a996060e6b922fecb299eca32d6763dbb12b831/addons/web/static/src/legacy/xml/web_calendar.xml#L16-L17

opw-2925491

closes odoo/odoo#97129

X-original-commit: e6807b75e33ab3a083c84ace0b6c337e7566e64b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-08-01 09:34:39 +02:00
Xavier Morel 1a65d18ef7 [IMP] core: increase timeout in watch mode & tell client
Currently, when enabling watch mode on a tour the tour's timeout does
not change. This is usually an issue because:

- watch mode makes tours a bit slower, so they can timeout even
  without doing anything
- trying to diagnose what's wrong, it's common to add check steps with
  a long timeout or even a `debugger` statement, which trips the
  python-side timeout and kills the tour

To avoid needing to remember to update the timeouts (then revert them
afterwards), just bump the timeout to 1h by default, or 10x the
original time for very long tours (e.g. qweb test suite, which
currently has a 30mn timeout).

While at it, forward the watch mode status to the client via the QS,
so we can eventually make use of it for one reason or an other.

closes odoo/odoo#96994

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-01 07:32:39 +02:00
nni-odoo fe6782c6bc [FIX] l10n_id_efaktur: fix price when tax is not included
Columns involving price within the downloaded e-faktur document is supposed to report prices that does not include tax.
When taxes are configured to not be included in price (account.tax field: price_include), result would be correct.
However, if the tax configurations is "Included in Price", the price columns will not respect the official e-faktur guideline. Consequently, it will also result to the discount column to be incorrect due to the calculation.

2889400

closes odoo/odoo#97049

X-original-commit: 633c89bcc00cea674f2582c25dadafb2792d9945
Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-31 18:00:13 +02:00