Commit Graph
155805 Commits
Author SHA1 Message Date
nda-odoo 3246fe4d38 [FIX] purchase: remove unnecessary JOIN in purchase.report
This join is a leftover from https://github.com/odoo/odoo/pull/28248
and is not needed anymore since currency_rate is now stored on purchase.order.
Removing it allows to greatly speedup purchase.report queries.

On a database with 7000 purchase order and 1100 res_currency_rate:

From:
Planning Time: 4.411 ms
Execution Time: 19815.754 ms

To:
Planning Time: 16.914 ms
Execution Time: 77.433 ms

opw-2973044

closes odoo/odoo#104301

X-original-commit: 4ffa967eecfd930da7a0051122ed746af38ce709
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-27 15:41:18 +02:00
Samuel Degueldre c989ff339d [IMP] web: report module loading errors in the DOM
Previously, if there were module loading errors, they would typically
happen before the error service was ready, and so there is almost always
no user-facing error that shows up even though the application state may
be severely corrupted. This can be very confusing for developers who are
not used to working with JS and might not check the devtools console.

This commit makes it so that the module system will replace the contents
of the body with an error when some modules were unable to be loaded,
with the list of modules and the reason, so that the developer is not
confused as to why things aren't working as expected.

closes odoo/odoo#104155

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-10-27 15:41:15 +02:00
Romain Derie 84ef92fef7 [FIX] website_blog: fix misusage of t-attf
This commit fixes wrong usage of t-attf of [1].
It would output in the DOM `rel="len(active_tag_ids) and 'nofollow'"`

[1]: https://github.com/odoo/odoo/commit/0f2cada32319b3910d6ace6d412cfa94a646c9c7

closes odoo/odoo#104306

X-original-commit: 79ea8540c63c652f117237609ef7b477c7c17bb3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-27 14:41:35 +02:00
gawa-odoo 43c870ab19 [FIX] sale_project: fix smart button traceback for invoice/bill
Clicking on a smart button on the project button to access invoice/bill returned a traceback.
It was because the fields in the ORDER of the query don't appear in the SELECT with the DISTINCT.
We just remove the order of the query, as it serves no purposes here.

opw-3040389

closes odoo/odoo#104303

X-original-commit: 71a2b06b9b4205c34a3869ddc67dd6d840a5eccf
Signed-off-by: William André (wan) <wan@odoo.com>
2022-10-27 14:41:33 +02:00
Thomas Lefebvre (thle) 6d910be313 [FIX] website_sale: base unit price not updated with pricelist and tax
Steps to reproduce:
- set a price on the product form;
- set a base unit count on the product form;
- define at least a pricelist with an other price;
- go to website on the product page;
- change the selected pricelist;
- change the Tax-Excluded/Included option.

Issue:
The base unit price ignores the tax included option.

Solution:
Update the display of the base unit price taking into consideration that it is not possible to set the "base_unit_price" field (otherwise we risk an AccessError).
Calculate the base unit price using "list_price" (which takes into account the tax) when we need to display it without saving.

opw-2995474

closes odoo/odoo#104302

X-original-commit: b766d68287b73b70a784e7291c567fb2e59de0c3
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-10-27 14:41:31 +02:00
Panagiotis Kyriakou 7c06316aac [FIX] sale_project: fix project invoice traceback
In this commit we fix two tracebacks that are returned
when the user tries to click on the invoice/vendor bills smart
buttons in the "project updates" view.

Also added credit notes to the "invoices/vendor bills" smart button
of the "project update" view.

task-3033278

closes odoo/odoo#104300

X-original-commit: 4f1981fb54fe726801318ad66b941a20affa0d4a
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-10-27 14:41:28 +02:00
Pierrot (prro) 6acc85639a [FIX] web: adapt bold layout to new header
The previously created company_details field was introduced to allow
customers to manually edit part of their pdf headers. Only the bold
layout was not updated with this field.

closes odoo/odoo#104299

X-original-commit: 16ece79ea5305a2e427024a43313096fa200901f
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-10-27 14:41:26 +02:00
Alexandre Kühn a820570abc [IMP] mail, *: Rename component to match model (step 1)
*: calendar, website_slides

[IMP] mail, *: rename component Activity to ActivityView
*: calendar, website_slides
Task-3045361

Task-3046089

closes odoo/odoo#104261

Related: odoo/enterprise#33300
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-27 14:41:19 +02:00
Joseph Caburnay c412f11c02 [REF] web,web_*: import owl features using "@odoo/owl" module
In @odoo-module files, we do the following conversion:

`const { ... } = owl;` -> `import { ... } from "@odoo/owl"`.

While in legacy odoo module (odoo.define):

`const { ... } = owl;` -> `const { ... } = require("@odoo/owl");`.

closes odoo/odoo#104260

Task-id: 3032274
Related: odoo/enterprise#33298
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-27 14:41:17 +02:00
Joseph Caburnay d650ab6a9b [IMP] web,im_livechat: introduce @odoo/owl module
This is done so that using owl features and functions is done using
the standard import syntax, instead of destructuring properties out
of the owl global object.

So instead of just:

`const { Component } = owl;`

inside an odoo-module, we now do:

`import { Component } from "@odoo/owl";`

Note that we haven't removed the global `owl` object so existing
code will work as is.

Furthermore, we also augmented the tsconfig.json that's generated
from the tsconfig subcommand to take into account the path
of owl.js.

Task-id: 3032274
Part-of: odoo/odoo#104260
2022-10-27 14:41:17 +02:00
rhe-odoo a0639cd152 [IMP] point_of_sale: error handler belgian blackbox
This commit aims to handle the belgian blackbox error properly just as the sweden blackbox do.
Add an error code of 701 to handle the error messages.

closes odoo/odoo#104233

Part-of: odoo/odoo#96583
X-original-commit: 7d1e52bcd11a1c20a6c6829c56d3fabe5b0f0fef
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-10-27 14:41:11 +02:00
Antoine Guenet 9b60a1bfc1 [FIX] web_editor: prevent deleting content outside the editable area
When checking whether an element was removable or not, we failed to
check whether it was within the editable area. As a result it was
sometimes possible to accidentally delete something outside of it. To
reproduce the bug, insert a link in a blank editor, then press delete
repeatedly until the whole link is gone, and then one more time. This
deleted an element from Odoo's UI.

task-2993740

closes odoo/odoo#104268

X-original-commit: 55e4e0577ac8a62d57f759572b8a5e608c7582b2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-10-27 13:37:49 +02:00
Sébastien Theys bade59a3a7 [IMP] mail, test_mail: convert legacy code from activity view cell
task-3026018

closes odoo/odoo#103326

Related: odoo/enterprise#32853
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-27 12:40:09 +02:00
Pierrot (prro) e2fe60e717 [IMP] account: update Jitems partner edit condition
The condition for multi-editing the partner has now changed.
The partner cannot be changed on a line that has parts in a
(partial) reconciliation.

closes odoo/odoo#104258

X-original-commit: 1b30777ab63998d1c0b64b655e717d74b3648bcf
Signed-off-by: William André (wan) <wan@odoo.com>
2022-10-27 11:38:55 +02:00
Wolfgang Taferner 7f684fcac0 [FIX] website_form: prevent crash on form many2one attachment upload
The current implementation of the many2one file upload in website form
will lead to a traceback in case of m2o fields.
It is currently only working with x2many fields. Note that it was
introduced as such with [1].

Step to reproduce:
- install website_sale
- drag & drop form snippet and click on it
- select "create customer" as action option
- add new existing field
- select "Main attachment" and save
- try to submit the form with a file uploaded in that new field
-> Traceback `ValueError: Wrong value for..`

This commit makes it work for all type of relational field.

[1]: https://github.com/odoo/odoo/commit/a77f5cf42faa75a2dd3931d83ad8ea86648248c0

closes odoo/odoo#104241

X-original-commit: addea33a8cb6c47bacdbfad0f3082f88763b59ef
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-27 11:38:50 +02:00
Joseph Caburnay bcf2cf7d65 [FIX] web: introduce parser for many2one_reference field
ISSUE: When in debug mode, user have access to the "External
Identifiers" view. The search bar allows searching using "Record
ID" which is a `many2one_reference` field. When user inputs
a search query that can't be converted to number, "Record ID"
option is still available to the user. It results to traceback
when it's selected because the UI is creating an invalid "domain"
which makes the server search for a string on an integer
(many2one_reference) field.

Check the video for illustration: https://youtu.be/XEPUXHcjeRI

SOLUTION: We make sure that many2one_reference field is properly
converted when generating the domain from the search_bar by
using the integer parser. This basically excludes many2one_reference
field from the search options when the input query is not a valid
integer. See it in action: https://youtu.be/NQ-YrK6tDH0

closes odoo/odoo#104183

Task-id: 3005837
X-original-commit: bc9e8709309379bdd9191323cb015c89be7da1f9
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-27 11:38:47 +02:00
Ivan Yelizariev c2536e1f0b [FIX] web: handle apps store actions neatly
Apps store menus currently don't work and they are redirected to local Apps
menu. Because the warning message says "Odoo Apps will be available soon", user
may click such menu few times and notice growing breadcrumps, which looks buggy:

Apps / Apps / Apps / Apps / Apps / Apps / Apps / Apps / Apps / Apps / Apps

To reproduce: activate debug mode and click menu Apps / Updates

opw-2985389

closes odoo/odoo#104158

X-original-commit: a8481b73449db65eaca0b1e34a49a15a46d3d1f9
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-10-27 11:38:45 +02:00
Alexandre de Pape (alpa) ca8f33b961 [IMP] website_sale: change mandatory checkout labels
This commit changes the label of the checkout button if the user is not signed in and the option is mandatory.

closes odoo/odoo#103072

Task: 2991670
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-27 11:38:42 +02:00
Louis Wicket (wil) 4513998b13 [FIX] mail: do not pin chat for correspondent if no message
Opening a DM chat with someone for the first time automatically pins
that chat for correspondents (i.e. the chat appears in Discuss), even if
no message has been sent yet. This can be unsettling for the person who
didn't create the chat but finds themselves with an unsolicited chat
pinned with no message.

This commit solves the problem by explicitly writing is_pinned to False
for the member that is not the current user.

Task-3028156.

closes odoo/odoo#104243

X-original-commit: 395bbc0ab2c2fc2eaee9d2bbe42b507fc84ee83a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-27 10:37:45 +02:00
svs-odoo 0ebbc8f1d5 [FIX] purchase(_stock): don't recompute price unit
Before this commit, when the quantity of a PO line is changed, its unit
price is recomputed, which means it will be set to 0 if there is no
compatible vendor price for the selected partner/product.
It can be annoying because if the price unit was set manually by the
user, this info is lost.
To avoid that, we don't recompute the unit price if the PO line matches
the following conditions:
- The PO line has already a price unit;
- There is actually no vendor price list for the partner (in such case,
  we prefer to avoid to stick to a price who doesn't match that list);
- The UoM wasn't changed, because if the UoM was changed, the price
  should obviously recomputed (the price unit for 1 unit is not the same
  than for 1 dozen).

How to reproduce:
- Install Stock and Purchase modules;
- In purchase settings, enable "Purchase Agreements";
- Create a product and in its vendor price list (in "Purchase" tab), add
  a price for Partner A (e.g. 10$);
- Create a PO for Partner B, add a PO line for the created product and
  set the `price_unit` higher than the created vendor price (e.g. 15$);
- Confirm the order and go in the "Alternatives" tab;
- Click on "Create Alternative" and select Partner A as the vendor;
- Click on "Compare Product Lines" and choose the line for Partner A;
- Go back in the first created PO (with Partner B as vendor)
  -> the PO line's quantity is to 0, which is good, but its unit price
     is also set to 0 which is annoying.

Additionnaly, in `_get_stock_move_price_unit`, `float_round` the value
just before it was returned because previously, the rouding was done
before the multiplication by the UoM's factor which can cause some
rounding issue if the rouding is not done after that.

closes odoo/odoo#104206

X-original-commit: f5a24b10cb3a4cf32c6c185df65f3099c8da3ff1
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
2022-10-27 10:37:40 +02:00
Kevin Baptiste 7017150d7d [FIX] hr_expense: correctly align fields
The fields were not correctly aligned.

task-3040395

closes odoo/odoo#104195

X-original-commit: f5cec113222db06f427f17a0170d45e2022b5b39
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-27 10:37:37 +02:00
Philippe Wauthy 6b4f2711d5 [FIX] hr(_holidays)(_attendance): display the presence bubble
The presence bubble on the employee form is hidden while it is shown on the kanban view of the employees.
This commit fixes the presence bubble to have a consistent behaviour between the employees kanban view and the employee form.

task-2945615

closes odoo/odoo#103884

X-original-commit: f26f2356ecfcc293bbc6c844882b40a58c21062f
Related: odoo/upgrade#3985
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-10-27 10:37:34 +02:00
Sergey Shebanin d00cfd62b8 [FIX] form control panel: display long breadcrumbs correctly
UI improvements for form control panel to correctly display long breadcrumbs.
It touches both desktop and mobile views.
Before this commit Action menu, Pager and Create button shifted by long breadcrumbs outside the screen.

closes odoo/odoo#104208

X-original-commit: f2b71d51aa409eae435f31d433dac4290c2b80ab
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-10-27 09:39:38 +02:00
Victor Piryns (pivi) 6778fb177c [FIX] product, sale, stock: remove deleted product from demo data
Current behaviour:
When installing Sales, then PoS, we get an error when loading the modules.

Expected behaviour:
No error should be present when installing PoS just after the Sales app.

Steps to reproduce:
(With demo data)
- Install Sales
- Install PoS
- Get Error

Reason for the problem:
When installing Sales, there is the Product dependency that creates a product variant,
named product_product_4d.
Then in the Sales demo data there is the addition of an "exclude_for"
record (basically an exclusivity rule for variant attributes, for ex: A AND B cannot be together).
In our case it happens to be the attributes which product_product_4d was based of. Therefor the ORM
deletes said record (from the database).
Then when installing PoS, it installs Stock as a dependency, which demo data references product_product_4d,
which is not present anymore in the database.

Fix:
Remove the creation of product_product_4d and all the records that reference it.

Affected versions:
- 14.0 (separate PR)
- 15.0
- saas-15.2
- saas-15.3
- 16.0
- master

opw-2999180

closes odoo/odoo#104184

X-original-commit: 3e49e533892f94eeb094a436fa34cbac3ed7ad6d
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2022-10-27 08:44:49 +02:00
Audric Onockx (auon) 5dd5fec563 [FIX] web: format float time correctly
Steps:
Go to timesheet (grid view).
Launch the timer.
Got to list view and check the new line.

Issue:
Few seconds before the minute, the seconds are negative.

Fix:
Convert hours decimals in milliseconds before calculating minutes and
seconds.

Also deleted the unnecessary condition for abs().
Also changes some `${...}` to String(...) to reduce noise.

closes odoo/odoo#104209

X-original-commit: 9d3e7ab4e903d2ada99693aa23e024d3ff84f5fb
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-10-27 07:15:47 +02:00
Paolo Gatti 2b80646ccb [FIX] l10n_it_edi: downpayment document type selection fix
TD02 is the only document type in l10n_it_edi that requires
the invoice to be a downpayment, but this doesn't mean that
downpayments are limited to it.
The condition has been adapted to allow downpayments to fall
under the other document types cases.

opw-3033403

closes odoo/odoo#104242

X-original-commit: 197dbf7a8d14b619d19ff5904eb07d53c1fd97d2
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2022-10-26 21:51:54 +02:00
FrancoisGe b305128323 [FIX] web: DateField dropdown disappears on scroll
Before this commit, the Datefield dropdown did not close when you
scrolled on the page.

How to reproduce:
- Go to a form view with a date field
- Click on the date field input (datepicker is opened)
- Scroll down the page

Before this commit:
 The datepicker is still open

After this commit:
 The datepicker is closed.

closes odoo/odoo#104160

X-original-commit: d93ed838fdf0a721426dc56e26b5a83b3af6a66f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-10-26 21:51:51 +02:00
Renaud Thiry 84b4af755d [FIX] mass_mailing: remove gold color in stats
Commit a170b7265e158323d3769f1631314f06c96a6e4b
applies the star color to all stars in the form view

The star in the stats bar should remain black.

task-3044832

closes odoo/odoo#104210

X-original-commit: b2f37a06546638fde69d392dfec3d76fc15ca0e3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-26 19:03:58 +02:00
niyasraphy f642bad7ef [FIX] data_recycle: alert in form is not aligned
closes odoo/odoo#104207

X-original-commit: ab83e52314d459532e75f26e219329410a174ad9
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-10-26 19:03:55 +02:00
xmo-odoo c9356b3582 [REM] core: SQL compiler helpers deprecated since 14.0
closes odoo/odoo#98138

Related: odoo/enterprise#33244
Related: odoo/documentation#2844
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-10-26 19:03:48 +02:00
xmo-odoo 6a343a32ef [REM] core: deprecated TestCase classes
Part-of: odoo/odoo#98138
2022-10-26 19:03:47 +02:00
xmo-odoo 84e6be4150 [REM] core: deprecated osv-memory-age-limit option
Part-of: odoo/odoo#98138
2022-10-26 19:03:47 +02:00
xmo-odoo 110770b7c1 [REM] core: openerp.addons alias and legacy ad_path
Part-of: odoo/odoo#98138
2022-10-26 19:03:47 +02:00
xmo-odoo e98b44998f [REM] base: legacy autovacuum API (power_on method)
Part-of: odoo/odoo#98138
2022-10-26 19:03:47 +02:00
xmo-odoo d200dcfb2c [REM] core: exceptions bits deprecated since 14.0
And formally deprecate the contents of `odoo.osv.osv` so we can
eventually finally remove it.

Part-of: odoo/odoo#98138
2022-10-26 19:03:46 +02:00
xmo-odoo e806427d23 [REM] web: deprecated dataset methods
Part-of: odoo/odoo#98138
2022-10-26 19:03:46 +02:00
Xavier Morel 18446f23f1 [REM] core: support for the deprecated <report> and <act_window> tags
Part-of: odoo/odoo#98138
2022-10-26 19:03:46 +02:00
Xavier Morel 6c6ca16626 [REM] core: deprecated Environment methods
Part-of: odoo/odoo#98138
2022-10-26 19:03:46 +02:00
Aurélien Warnon 0c56a58888 [FIX] survey: make the badge fields more visible
Currently, the fields associated to the badge on the survey form are not
visible following the changes with the "always edit" feature.

This commit simply adds a placeholder on the badge field to let the end user
know that there is something to fill in.

We also used that opportunity to sneak in a few additional placeholders.

Task-3028991

closes odoo/odoo#104182

X-original-commit: 2df6ce4708554d3dad59a9b9b15f03057c204c43
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-10-26 17:07:28 +02:00
Arthur Detroux (ard) 10f1c9b222 [FIX] website_blog: restore styles post BS5 migration
[1] migrated to Bootstrap 5 and in doing so, changed the way badges are
styled. Now to give correct styles to badges, utility classes must be
added.

This commit fixes that by adding .text-primary and .text-decoration-none
to the badge.

[1]: https://github.com/odoo/odoo/commit/1fcd098af5fa18e848c66bb83bdceb6ba0308512

task-3001319

closes odoo/odoo#104180

X-original-commit: b606df22ecd07e4acf87feadd1e6f20ed730f058
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2022-10-26 17:07:23 +02:00
Arthur Detroux (ard) 08c2251070 [FIX] website_blog: properly render the sidebar
Commit [1] introduced t-cache for values inside blogs. It also broke the
sidebar template by removing the call to nav_list.

This commit adapts the call to be lazy and follow the cache principles.

[1]: https://github.com/odoo/odoo/commit/b0a2a41d78292cb8b9e53788d40c6dc5915a466d

Fixes #103199, fixes #103888

task-3001319

X-original-commit: ae76b89fbbf947a79bdcdbcc200f65b2ddb457b0
Part-of: odoo/odoo#104180
2022-10-26 17:07:22 +02:00
Alexandre Kühn daac0cdd51 [IMP] mail: remaining move code to models (MessageComponent)
Task-3000365

closes odoo/odoo#104004

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-26 17:07:19 +02:00
Nicolas Martinelli 5c80ca4d1d [FIX] http: nodb fallback in case of connection error
When calling a `auth=none` route with a non-existing DB name, the server
redirects to `/web/database/selector`. Such a route can be called
without database, therefore it is expected to work if the database
doesn't exist as well.

Before the HTTP refactoring, the fallback was `_dispatch_nodb` [1]. We
roll back to the same behavior since there is no good reason to redirect
to `/web/database/selector`.

Commits 4b330f3173 and de4e67dcc529163 are reintroduced as well.

[1] https://github.com/odoo/odoo/blob/b3199e949ae70307e8181ba0d6237871d6d07af7/odoo/http.py#L1529

closes odoo/odoo#104174

X-original-commit: 1565e85890f1d14e067edd1c198c7199ab536307
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-10-26 16:07:31 +02:00
Tom De Caluwé c18ce5d535 [FIX] mail: remove related mail activities on model removal
Unlinking a model during uninstallation can potentially fail when the query
removing any related mail activity types fails. This happens when such a record
is still referenced in the mail_activity table. Explicitly removing related
mail activities (as is done for the activity types and other related mail data)
resolves the issue.

Two tests are added, one that demonstrates the general flow and a regression
test triggering the behavior that caused a bug in the uninstall procedure of
the hr_holidays module.

closes odoo/odoo#104152

X-original-commit: b315f7f562fc84a09d99d6e7676567eb6f285402
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: De Caluwé Tom (tdc) <tdc@odoo.com>
2022-10-26 16:07:29 +02:00
Jorge Pinna Puissant 886f3de768 [IMP] web,*: force props validation for components
*: base_automation, lunch, mail, mrp, project, web_editor, website

This commit adds a warning if the props validation is not set for a
component.

The props validation is important to tell how a component should be
used, by looking at its code, it's a good documentation of the component.
It's also critical, to test if the component is correctly used, if all
the obligatory props are passed and that there are of the correct type.

For more information, see: https://github.com/odoo/owl/blob/master/doc/reference/props.md#props-validation

closes odoo/odoo#103723

Related: odoo/enterprise#33044
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-10-26 16:07:18 +02:00
William Henrotin 36158fe17a [FIX] mrp: force context in computes
Computed stored fields should not be depending on context. In this
particular case, compute_bom_id will make a 'search' on mrp_bom table
with sometimes 'active_test=False' in the context sometimes not.

This commit force the context to exclude archive records to ensure we do
not set an archived bom on a production order.
In a futur versionm it would be nive to have the ORM ignoring the
context in such case.

closes odoo/odoo#103055

Task: 2991906
X-original-commit: 6274f23a673fe073157d0f975adcb2b0c917b02f
Related: odoo/enterprise#32700
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-26 15:06:51 +02:00
William Henrotin b71d3fa1c1 [FIX] mrp: ui improvement
- set monetary widget to align foat field with other monetary fields
  - use default production order in the list view to have the same order
    everywhere.

Task: 2991906
X-original-commit: 38b82230b75f972a7da5d4c53ea1a4c7359cd913
Part-of: odoo/odoo#103055
2022-10-26 15:06:51 +02:00
Valentin Vallaeys (vava)andValentin Chevalier 693511076d [IMP] Payment: hide the URL payment link
Since the generated payment link is not editable, it is hidden behind
the wizard copy button.

To help the users understand the button, the text on the button can now
be edited in the xml with a `label` attribute.

task-2683480

closes odoo/odoo#100261

Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
2022-10-26 15:06:48 +02:00
gawa-odoo c3eb3021c1 [FIX] analytic: only show plans from the company
Before this fix, user could include accounts in the widget from another company than the object's one when in multi-company mode.
It could cause problems with validation too.

Now we take the company of the object when getting the plans (or the current company if no object's company).

t-3040926

closes odoo/odoo#104150

X-original-commit: 21d754ddafee653d9958443accda2de747caed53
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-10-26 14:05:59 +02:00
Bruno Boi a0f4957304 [FIX] web: moment.js to luxon's conversions
The web client exposes an utility function that converts the tokens
of a luxon's DateTime format into a moment.js format.
While this function is not false (still it is uncomplete), the strategy
of using it to convert a luxon's DateTime object into a moment.js moment
is not good.

The daterange field make use of this bad strategy.

Because of the differences between luxon and moment.js locale handling.
Luxon relies on the native JavaScript Intl API.
Moment has its own implementation of locale handling.

So having to pass through formatters/parsers may yield to unexpected
results. For instance, when a locale does not have the same way (in
moment.js and Intl) to express i.e. months and we try to convert a
luxon's DateTime into a moment by formatting the first and then
parsing into the second, the second will be invalid. This is the same
the other way around.

This was in fact encountered with some locales, i.e.
- syrian arabic (ar-SY)
- albanian shqip (sq-AL)

This commit brings an alternative strategy by providing other utility
functions to directly convert a moment into a luxon's DateTime
and vice versa.

This is a better strategy for various reasons:
- it abstracts the way the conversions are done
- no need to play with timezone's offsets
- probably all libs that has moment as a dependency accept a moment
  object in their options, that may not be the case for formats

- The daterange field now use the new strategy
- The datepicker component now use the new utility functions as it had
  implemented locally something similar.

closes odoo/odoo#104138

X-original-commit: 9dedfcaa4ad1fb5ea24f604b40df1bf0830617cb
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-26 14:05:53 +02:00