Prior to this commit, when the user was hovering on colors in the
web editor, the cursor would stay with its default appearance.
Some users weren't able to tell if this was an interactive
element or not.
With this commit, we change the cursor to the pointer cursor when a user
is hovering the element so that they have a visual element indicating
that it's interactive.
task-2687469
closesodoo/odoo#80933
X-original-commit: 40fec954a369c94576b5ed88eade5d3ff120ca4a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the account reset would fail with the following traceback:
```py
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'res.users' object has no attribute '_set_auth_tokens'
```
This commit allows to use the wizard.
opw-2705169
closesodoo/odoo#80918
X-original-commit: 9f2aa5c87a9809899cba872e6a0428f86c687b9a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
Within portal, subscriptions/sales orders presented in list view have their URL
containing the access_token as a GET param. However, when clicking on a
subscription and using the pager to navigate between records, the access_token
is not present in the URL. In order to keep consistency between the links and
views, this PR adds the access_token as a GET param in the pager as well.
task-2512070
closesodoo/odoo#76673
Related: odoo/upgrade#2752
Related: odoo/enterprise#20357
Signed-off-by: Arnaud Joset <arj@odoo.com>
Before this commit, unlink-all would sometimes fail to unlink more than one
record.
This seems to be the case in particular for x2many relations with isCausal true.
Indeed, the delete from isCausal is itself calling unlink-all on the inverse
relation (the same record that was being unlinked-all in the first place) which
would pre-emptively remove it from the same Set that was used during the initial
iteration.
The solution is to make a copy of the Set before iterating it to ensure all
records that were planned to be removed are actually removed.
Candidate fix for task-2410314 and definitely necessary for data integrity in
general.
closesodoo/odoo#80913
X-original-commit: 0077b93fea6f8c39ee535f19426c3f95a0e97e9f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Whenever opening the codeview from mass_mailing and then directly
saving the document did not work.
Task-2704335
closesodoo/odoo#80899
X-original-commit: d9fe1e22b4f645f1732283ab558de170716a7434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The call to `addRowBelow` was not updated to the new API.
Task-2698729
closesodoo/odoo#80896
X-original-commit: f7fb967cd8ada702e298d097ea107fda802fa6a4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
VAT check error message says 'record_label' instead of real partner name
Steps to reproduce:
1. Install the Contacts app and the VAT Number Validation module
2. Go to the Contacts app
3. Create a contact and define his country and an invalid VAT number
4. Save
Solution:
Modify the error message with the correct placeholder
OPW-2692320
closesodoo/odoo#80660
X-original-commit: 0aff6adc03c2d7cd6b3d29848e895cd258e42348
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
In preparation for using OWL v2 in discuss code.
(`shouldUpdateBasedOnProps` will be removed)
Task-2695743
closesodoo/odoo#80615
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Using <a> with 'download' attribute to download the attachment.
Prevent calling .navigate() interrupting the current call.
task-2692597
closesodoo/odoo#80903
X-original-commit: 97fa88c2e8407972c83c93d4d2198633a5560ecc
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In preparation for using OWL v2 in discuss code.
(shouldUpdateBasedOnProps will be removed)
Task-2695743
closesodoo/odoo#80616
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The website is now referenced to Odoo's website, with the most updated documentation.
closesodoo/odoo#80514
X-original-commit: 98025e4919e8a907419794b03d0386648c31343f
Signed-off-by: Josse Colpaert <jco@odoo.com>
When using AVCO and subcontracting without any additional cost, the
valuation of the finished product is incorrect
To reproduce the issue:
1. Create a Product Category PC:
- Costing Method: AVCO
2. Create two products P_compo and P_finished:
- Both:
- Type: Storable
- Category: PC
- P_compo:
- Cost: 10
- Routes: Resupply Subcontractor
3. Update P_compo's quantity: 2
4. Create a Bill of Materials BO:
- Product: P_finished
- Type: Subcontracting
- Subcontractor: a partner P
- Component: 1 x P_compo
5. In Inventory, create a planned Receipt R:
- From: P
- Operations: 1 x P_finished
6. Mark R as To Do
7. Process the delivery of P_compo
8. Validate R
9. Repeat steps 5-8
10. Open the Inventory Valuation
Error: There are two valuation lines for P_finished: one line has a
value of $10, which is correct (this is the cost of the component).
However, the value of the second line is $20, it should be $10 too.
Here are a part of the values used to generate the related MO:
https://github.com/odoo/odoo/blob/2d12fb8fb94c0f2acade7222cfedbec34114a8e9/addons/mrp_subcontracting_account/models/stock_picking.py#L21-L25
In the above case, an extra cost is defined on the MO and is based on
the unit price of the subcontracted SM. However, `_get_price_unit` will
return an incorrect value:
https://github.com/odoo/odoo/blob/251be6b943ea8c3f274bb0863d0af3f7c6b8d10d/addons/stock_account/models/stock_move.py#L39
After step 8, the standard price of P_finished is $10. Also, in the
above case, there isn't any subcontracting cost, so there isn't any unit
price defined on the SM. Therefore, `_get_price_unit` returns the
standard price of P_finished ($10). As a result, when computing the
value of the finished stock move:
https://github.com/odoo/odoo/blob/4fc2ec31861d4602357f130066ec3507b96d8dc8/addons/mrp_account/models/mrp_production.py#L39-L42
It uses the extra cost of the MO + the component cost. This explains
where the $20 come from.
OPW-2641339
closesodoo/odoo#80889
X-original-commit: 0567536f8b66c71f6860041926542f88026793b1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.
closesodoo/odoo#80815
X-original-commit: c2a72c268e6a28d7448b6dbf96fed4e36d24b3fe
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Current behaviour :
In POS, pricelist are based on the day and not the current moment so if a pricelist item start on day X at 01:00, it's not taken into account at day X at 02:00.
Behaviour after PR:
Pricelist are taken into account based on full time.
opw-2691883
related to b3149d84a0closesodoo/odoo#80779
X-original-commit: c0c968063bf791a13117434e8cdd0e3c8120eaa3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
Even though `uom_id` is required by product.template, it's still
possible for users to delete it within the product view and trigger a
compute that depends on it before saving.
Steps to reproduce:
1 - install sale_timesheet + activate UoM
2 - open any product form, click on uom_id and delete the uom
Expected result: No UoM + user cannot save
Actual result: traceback + user can appear to save (but uom defaults
back to last selected UoM
While this isn't a blocking problem since users won't be able to save
no UoM being selected, we would still rather avoid the traceback so we
default to no service_upsell_threshold_ratio message in this case and
properly prevent the saving.
Task: 2689438
Also fully fixes: odoo/odoo#78693closesodoo/odoo#80868
X-original-commit: f60786a7490cc09a31fe0dd0d74cf97368184bd9
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
In debug mode, the FieldDomain displays a textarea to allow the
manual edition of complex domains. However, when those domains
contain dynamic content (e.g. datetime stuff), the evaluated
version of that content was displayed, which isn't what we want.
We want to see the raw version of the domain as written in db,
and be able to edit it. This commit fixes that issue. Moreover,
we also ensure to keep whitespaces and new lines, which can be
useful for large domains.
closesodoo/odoo#80866
X-original-commit: 15301a1ddaf00e51688d8134b7cb19baf386577c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, sometimes component do not properly
render changes in the models. Although the modeling is correct,
there is a problem in the component not re-rendering itself.
The shouldUpdateBasedOnProps component hook did not consider
update attempts that could be canceled. This commit adds this
consideration, so that it ensures component is eventually
rendered correctly
Task-2410314
Task-2705078
closesodoo/odoo#80877
X-original-commit: 12c77f52c5a16c95e57de31587d67eda4d582bde
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, changing a filter in the dynamic snippet could
cause errors because the option wasn't awaiting an asynchronous
call.
This commit fixes that by using the same mechanism used in the
s_website_form snippet, relegating the rerenderXML call to updateUI
task-2654924
closesodoo/odoo#80867
X-original-commit: 8a4391a7d6e6988da7b62f6caa91e49c831da774
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Prior to this commit, any add 2 cart would rerender the dynamic
snippet, making it flicker and in the case of the carousel, resetting
to page 1.
With this commit, only filters that require the snippet to reload will
do so.
task-2654924
X-original-commit: 7f84a10cc5ff7ba4c65c249dfb2fe546968e2a7c
Part-of: odoo/odoo#80867
Prior to this commit, when using a ir.filter on a dynamic snippet,
the filter would not use the product context defined in itself.
This would cause unexpected behaviour like ignoring
the 'display_default_code: False' in the website_sale ir.filter.
This commit adds context to database record lookups.
task-2654924
X-original-commit: d10d406739239e8d8fc240b2c6b2596b1ee6e610
Part-of: odoo/odoo#80867
Before this fix there is no real way to influence the VAT validation.
This can be problematic though as in some cases external platforms push data to you
on which you don't really have control. If an external software pushes an invalid VAT
and your database has the option 'Verify VAT Numbers' checked on there is no way
for you to bypass this though.
This means that before this commit you have to always run VAT number checks on all data,
no matter if they come through the frontend or backend.
After this commit you can supply a context key 'no_vat_validation' though.
This way you could skip doing VAT number validations on (some) records while still
enforcing this in the UI.
This allows you to have crons/external API's push any VAT number while enforcing full
validation through the UI.
This opens up the best of both worlds.
closesodoo/odoo#80843
X-original-commit: d31bf866e1556327f634e20d6d845d67143e2a06
Signed-off-by: Olivier Colson <oco@odoo.com>
As part of loading orders, we need to make sure we load the missing
products. This process relies on the existence of the `product.product`
model declaration in the PosModel. However, since we are loading
products differently here in pos_cache, the `product.product` model
is removed from the list of models.
We are now return the `product.product` model to the list of models
after loading.
closesodoo/odoo#80844
X-original-commit: ccac36b353fb1f1ffc1905808765464c0cbba3e1
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
After this commit, the tests launched from the debug tools or the
command palette will be in debug=assets mode.
This commit adds the "Run JS tests" and "Run Mobile JS tests" commands.
closesodoo/odoo#80842
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The mockSearch function should not return the list of records for a
domain and a model but the list of ids.
The path "/web/dataset/search" does not exist.
closesodoo/odoo#80835
X-original-commit: 5f6d72e43eaec803eea76927433706dfd5e2be73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Small side effect of commit https://github.com/odoo/odoo/commit/b19dc634684aab239575b9a9e784c7420d110b7d
When deleting old attendees, we are removing the partner id associated with the email
from the partner_ids set on the event.
As the same partner can be set on more than one event, we need to loop only once
on each attendee email, otherwise we will face the error "Record does not exist
or has been deleted."
Also, when deleting partner_ids on an event, the attendee is already automatically
removed as well in _attendees_values method, there is no need to do it manually, as
it will raise the error a second time.
opw-2694428
opw-2695915
closesodoo/odoo#80828
X-original-commit: 766a1ad50a9dbc85ed2f9083f881781b7d5ec96c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
Previously, when a main component errored during rendering, we would
remove it from the list of main components that should be rendered by
the MainComponentsContainer to avoid it erroring again on a subsequent
rendering (which can cause infinite error loops).
Unfortunately, since we did not rerender the MainComponentsContainer
after this removal, the erroring main component would remain, and could
cause such error loops anyway. This commit fixes that.
closesodoo/odoo#80822
X-original-commit: 0a2fa98086dfdaa36b01ca8ef3e22b8b8ffef60c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
1. Install the Expenses and Contacts Apps
2. Go to the Contacts App
3. Add a bank account to the private address linked to a specific employee
4. Go to the Expenses App
5. Create an expense for the employee and try to register the payment
6. The bank account will not show up
Solution:
If the employee doesn't have a bank account selected in the Employee form, we select the first bank account of his private address
OPW-2655450
closesodoo/odoo#80774
X-original-commit: cb998c804a0e7b14393637f372f1f32051fd548d
Signed-off-by: Olivier Colson <oco@odoo.com>
When Chrome is spawned, the `DevToolsActivePort`file is awaited to read
the port. Sometimes the file is read but is still empty, resulting in a
ValueError when trying to cast into integer. This happens when Chrome
did not have time yet to write into file.
With this commit, we expect the file to contain at least 5 bytes which
is enough to contain the max port number.
closesodoo/odoo#80791
X-original-commit: aab53fbb4e02461e0f23cf202d393e30a73fbc92
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
It is more intuitive that application_count smartbutton has
the label 'x Other applications'.
task - 2695252
closesodoo/odoo#80551
X-original-commit: f1a2f51fec0a31b80a20c78a5b3d11561dce7164
Signed-off-by: Kevin Baptiste <kba@odoo.com>
>>> u1 = self.sudo(False).browse(1)
>>> u2 = self.sudo().browse(2)
>>> (u1 + u2).env.su
False
>>> (u2 + u1).env.su
True
Ensure all attachments are always in sudo
Before this commit, a portal user could not go in debug asset
Introduced at 3a98996eed
closesodoo/odoo#80807
X-original-commit: 9f0ce611b2acf5927a7703a7811081c4adbc3f41
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When the public user is connected, allow him to print the report of
the open cart.
Since 61b4b6777d64 the sudo is not enough but with_user(1) is
required.
closesodoo/odoo#80803
X-original-commit: a4021965f1f049c69186e1f2acbc55ae59ee8730
Signed-off-by: Olivier Dony <odo@odoo.com>
This commit focuses the url input from the link tools when double
clicking on the link.
It introduces a focusUrl public method on the Link widget, triggered
from the SnippetsMenu after activating a snippet, if the link tools are
shown.
task-2680461
closesodoo/odoo#80796
X-original-commit: add3e05840869d4a885ca18a2bbabfcb61c7a83d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Prior to this fix:
- Archived users are no more shown in the assignees
After this commit:
- All users, including archived ones will be shown in the assignees.
task-2703358
closesodoo/odoo#80783
X-original-commit: d6092e318e04619313851276865b333afd264aad
Related: odoo/enterprise#22689
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
A bug was introduced in FR localization after the implementation of
refund feature in point_of_sale module, that is, any order can now
be deleted. However, we don't want this in the localization.
This fix restores the error message that prevents the deletion of
of any order made under the FR localization. However, this time,
instead of only preventing the current order to be deleted, we
keep every order with orderlines from being deleted.
closesodoo/odoo#80773
X-original-commit: 30b48094fb59f564b923e34a3df379f8ff0610de
Signed-off-by: Masereel Pierre <pim@odoo.com>
Before this commit, there was an issue with the edition of links that
were already in the page, via the link tools.
1/ In edit mode, drag and drop the s_image_text snippet and save,
2/ Click on edit, click on the "learn more" button,
3/ From the link tools, change the style to secondary,
4/ Click on save again, the button is still styled with as primary.
[1] added a history step to the link creation via the link tools. As the
editor observer is set to unactive at the start of the link tools, the
changes made to the link with the link tools were not processed by the
EditPageMenu observer, and the block was not set as .o_dirty (the
changes were therefore not saved).
This bug was hidden by our use of bootstrap popovers. The
aria-describedby attribute, managed by bootstrap when showing/hiding a
popover, would be recorded as a change from the EditPageMenu observer,
which would set the view as dirty.
Also, changing any other element of the page would set the page as dirty
and hide the bug.
It only became visible when [2] changed the popover initialization from
'focus' to 'manual'. With that, the aria-describedby attribute was
modified inbetween the LinkTools.start and LinkTools.destroy (and was
therefore not recorded at the EditPageMenu level).
To record correctly the changes made from the link tools to the link, we
activate the editor observer when applying the changes to the DOM.
This commit also introduces some tests for the link tools.
The listener on customizable links from the wysiwyg was changed from
mousedown to click for simpler tests.
task-2680461
[1]: 6db6134f97
[2]: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5
closesodoo/odoo#80763
X-original-commit: c29fe9fa8fc8ff4a5e6f042607ef9b3070d1d339
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When editing the link label from a website page, and then changing its
url from the link tools, the label was reset to what it was before the
edition. This commit fixes it by keeping the label consistent when
changing the link options from the link tools.
task-2680461
X-original-commit: 5f5b9dfa1bdfb6c814e68e355503a8820bb8b452
Part-of: odoo/odoo#80763
It was painful to add an inline snippets, or move elements inside mega
menus. The dropdowns are now behaving as modals: if they are shown, the
user can only add or move snippets inside them, but not outside.
task-2668908
closesodoo/odoo#80757
X-original-commit: edc5c8d69fb5fc6da0b0012abc6539c21ffc421e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Performances issues have been noticed in account_fleet when computing
the move_ids of vehicles.
This change has been made in order to fix this issue.
Task id #2700407closesodoo/odoo#80755
X-original-commit: 2860051b3cbfa7bcd7df76d05b4e5770e9a4c2d0
Signed-off-by: William André (wan) <wan@odoo.com>
When a rating is posted in the chatter, the alt text for the image is displayed as a score out of 10.
However, the maximum score a rating can have is 5.
This commit changes the alt text to display a score out of 5 instead.
closesodoo/odoo#80753
X-original-commit: 42848c6c3d17de59adb85bf6622f629809cb37c4
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Purpose
=======
This is the first step of a technical cleaning of the sales
application. The final goal is to reduce the technical debt
and improve the performances / readability of the related
applications.
Some complex onchange methods containing purely business code
are defined, and called manually wherever the modifications
should be applied. This is a bad practice as there could be
a different business logic when making the same flow in the
interface or with python code.
Since #80449, it is now possible to add the precompute attribute on
stored computed fields to compute them before the insertion into the
database.
The idea is to convert this business code into compute methods to
apply it every time this is needed.
This is quite useful in our case in the sales application, as some of
the computed fields are required, and request some hacky overrides:
- in the create method, to simulate the onchange on new records, and
to update the values dictionary
- in the default_get method, to set a default value, which has to
side effect to prevent the field to be recomputed afterwards, which
could also lead to inconsistencies.
This made impossible to convert the onchange methods into compute
methods.
Now, that is possible to precompute the fields before the database
insertion, it is now possible to remove all this crappy overhead,
to benefit from the batch method definitions, and to avoid creating
fake records to simulate the values that we should have computed
before.
On the other hand, this is the occasion to write some methods
(create, ...) in batch, to remove some dead code, to simplify
the api, to reorganize the code using our coding guidelines.
Results
======
The benefit of calling the computes in batch doesn't only bring
functional consistencies, it also allow to improve the performances
without changing any existing features.
For example, let's have a look at the execution time and queries to
generate 1000 sales orders with 10 products lines each + 1 section
line, for 1000 different customers and shared between 2 salesmen.
We consider the "batch" time, aka the time to call the "create" method,
the flush time and the number of SQL queries.
In master:
BATCH: 121.97 seconds
FLUSH: 24.05 seconds
# queries: 53103
Now:
BATCH: 113.07 seconds
FLUSH: 1.22 seconds
# queries 22057
This means a reduction of:
- 7.2% for the batch time
- 95% of the flush time
- 21.7% for the total time
- 58.5% for the number of SQL queries
Note that the effect of the precompute, the onchange methods
conversions, and the optimizations on this PR are emphasized
when the sales orders are related to the same partners.
If we take a look at the flamegraphs when creating 100 sales orders
of 3 lines each, we directly spot that the methods are now called once,
which also justify the large decrease of execution time and SQL queries.
Master:

Now:

closesodoo/odoo#79093
Taskid: 2679099
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Victor Feyens vfe@odoo.com
Before this revision, when a payment was declined,
for instance because the authorization is declined by the bank,
or the credit card amount limit is exceeded,
the error was marked as
"Received data with invalid payment status: 2"
which is not very meaningful for the users.
This revision aims to set the reason why the payment
was declined with the meaningful error from ogone.
closesodoo/odoo#80742
X-original-commit: 758f94a173379ba7bd22813b2050e3a6f98210a9
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>