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
closesodoo/odoo#104301
X-original-commit: 4ffa967eecfd930da7a0051122ed746af38ce709
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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.
closesodoo/odoo#104155
Signed-off-by: Samuel Degueldre <sad@odoo.com>
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
closesodoo/odoo#104303
X-original-commit: 71a2b06b9b4205c34a3869ddc67dd6d840a5eccf
Signed-off-by: William André (wan) <wan@odoo.com>
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
closesodoo/odoo#104302
X-original-commit: b766d68287b73b70a784e7291c567fb2e59de0c3
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
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
closesodoo/odoo#104300
X-original-commit: 4f1981fb54fe726801318ad66b941a20affa0d4a
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
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.
closesodoo/odoo#104299
X-original-commit: 16ece79ea5305a2e427024a43313096fa200901f
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
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
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.
closesodoo/odoo#104233
Part-of: odoo/odoo#96583
X-original-commit: 7d1e52bcd11a1c20a6c6829c56d3fabe5b0f0fef
Signed-off-by: Masereel Pierre <pim@odoo.com>
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
closesodoo/odoo#104268
X-original-commit: 55e4e0577ac8a62d57f759572b8a5e608c7582b2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
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.
closesodoo/odoo#104258
X-original-commit: 1b30777ab63998d1c0b64b655e717d74b3648bcf
Signed-off-by: William André (wan) <wan@odoo.com>
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/a77f5cf42faa75a2dd3931d83ad8ea86648248c0closesodoo/odoo#104241
X-original-commit: addea33a8cb6c47bacdbfad0f3082f88763b59ef
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
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-YrK6tDH0closesodoo/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>
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
closesodoo/odoo#104158
X-original-commit: a8481b73449db65eaca0b1e34a49a15a46d3d1f9
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
This commit changes the label of the checkout button if the user is not signed in and the option is mandatory.
closesodoo/odoo#103072
Task: 2991670
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
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.
closesodoo/odoo#104243
X-original-commit: 395bbc0ab2c2fc2eaee9d2bbe42b507fc84ee83a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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.
closesodoo/odoo#104206
X-original-commit: f5a24b10cb3a4cf32c6c185df65f3099c8da3ff1
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
The fields were not correctly aligned.
task-3040395
closesodoo/odoo#104195
X-original-commit: f5cec113222db06f427f17a0170d45e2022b5b39
Signed-off-by: Kevin Baptiste <kba@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#104208
X-original-commit: f2b71d51aa409eae435f31d433dac4290c2b80ab
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
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
closesodoo/odoo#104184
X-original-commit: 3e49e533892f94eeb094a436fa34cbac3ed7ad6d
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
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.
closesodoo/odoo#104209
X-original-commit: 9d3e7ab4e903d2ada99693aa23e024d3ff84f5fb
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
closesodoo/odoo#104242
X-original-commit: 197dbf7a8d14b619d19ff5904eb07d53c1fd97d2
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
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.
closesodoo/odoo#104160
X-original-commit: d93ed838fdf0a721426dc56e26b5a83b3af6a66f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Commit a170b7265e158323d3769f1631314f06c96a6e4b
applies the star color to all stars in the form view
The star in the stats bar should remain black.
task-3044832
closesodoo/odoo#104210
X-original-commit: b2f37a06546638fde69d392dfec3d76fc15ca0e3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/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>
[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
closesodoo/odoo#104180
X-original-commit: b606df22ecd07e4acf87feadd1e6f20ed730f058
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
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#L1529closesodoo/odoo#104174
X-original-commit: 1565e85890f1d14e067edd1c198c7199ab536307
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
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.
closesodoo/odoo#104152
X-original-commit: b315f7f562fc84a09d99d6e7676567eb6f285402
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: De Caluwé Tom (tdc) <tdc@odoo.com>
*: 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-validationclosesodoo/odoo#103723
Related: odoo/enterprise#33044
Signed-off-by: Géry Debongnie <ged@odoo.com>
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.
closesodoo/odoo#103055
Task: 2991906
X-original-commit: 6274f23a673fe073157d0f975adcb2b0c917b02f
Related: odoo/enterprise#32700
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
- 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
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
closesodoo/odoo#100261
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
Co-authored-by: Valentin Chevalier <vcr@odoo.com>
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
closesodoo/odoo#104150
X-original-commit: 21d754ddafee653d9958443accda2de747caed53
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
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.
closesodoo/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>