This PR contains a few adaptations and fixes after the major design
refactoring.
closesodoo/odoo#137704
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Purpose of this commit is to try to detect and log 'email_from' invalid
values when sending emails based on outgoing 'mail.mail'. This implies
checking the returned messages when having a generic Exception when sending
the emails, as we distinguish two use cases that raise through a simple
raise: missing from and invalid from.
New failure types 'mail_from_missing' and 'mail_from_invalid' are also
added at 'mail.notification' and 'mailing.trace' level, as other failure
types.
Task-3547653 (Mail: Add error type for wrong email_from)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
closesodoo/odoo#138202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Extract some test preparation, cleanup and improvements before gradually
adding features that impact tests.
Add tests about 'copy()' behavior in 'mail.alias.mixin' as it will be
impacted by multi-company enabled aliases.
Task-3547653 (Mail: Add error type for wrong email_from)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
Part-of: odoo/odoo#138202
__Current behavior before commit:__
When changing the `display_type` of an attribute in the website editor,
the page is reloaded. However the template `website_sale.product` is
contained in a `t-cache` on "pricelist,product". This means that the
template will not be rendered again when the page is reloaded. Thus, the
change will not appear for the user.
__Description of the fix:__
Flush the cache from the `ir.qweb` model when the attribute display type
is edited. This way the template `website_sale.product` will be
refreshed.
__Steps to reproduce the issue on runbot:__
- Go on the website product page of *Customizable Desk*
- Open the website editor
- Click on the Legs attribute values
- Under the **Block** section, change the **Display Type**
The page is reloaded but the display type stays the same
([Video][1])
opw-3495159
opw-3493820
[1]: https://drive.google.com/file/d/142VP4prnHskfa7uFoEkadsoQfQVO-uyW/viewclosesodoo/odoo#137498
X-original-commit: cc8664973efd7ea3433b5ec5b741f0882fb17dc0
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
In a6fea37, escapeHTML was introduced to replace the corresponding
underscore.js function. It is very similar to the widely used escape
function, except it additionally escapes single (') and double (")
quotes.
The additional escaping is not generally harmful, and is necessary to
safely inject values into attributes. As escapeHTML is almost unused,
remove it and update escape to include quotes.
taskId : 3522892
closesodoo/odoo#137216
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Before this commit:
In the `mailings` when we enable the A/B testing and click on the "Create an Alternative" button,
the "Send final on" field doesn't copy to the new mailing.
Reason:
The related field are copy `false` by default.
After this Commit:
Now it will copy the "Send final on" into a new mailing
closesodoo/odoo#138195
Task: 3465887
X-original-commit: 3d6dd2402a65af40c77692250fd710d3355960e7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Issue:
======
We have a delivery order created by a sale order by another user.
A user with administrator access to inventory and sale : own documents
only ,can't deliver products of
that sale order without backorder , it shows access error.
Steps to reproduce the error:
=============================
- Create another user with admin access for inventory and own documents
for sale.
- Create a sale order with the current user.
- Change now for the inventory admin and deliver some of the products
and click on no-backorder.
- Access error will show.
Origin of the issue:
====================
The admin user should be able to deliver the products but when creating
no backorder he needs to write on the sale_order.
Solution:
=========
Added `sudo` to the function that logs in the sale_order.
opw-3380566
closesodoo/odoo#138176
X-original-commit: de2d889b053827e39b11a648797ad2f30e646ce6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
Follow-up of https://github.com/odoo/odoo/pull/132701
`@extend` was used to reuse classnames intended for styling,
such as `.btn`. However, this has the side-effect to increase
specificity on these classnames, which results in breaking style
on the website where the specificity on `.btn` must not change.
This commit fixes the issue by using a mixin rather than
`@extend`. Since using these mixins are not equivalent, we took
the opportunity to slightly improve the constrast of text color
and background.
closesodoo/odoo#138108
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The previous commit reverts the ORM fallback of `display_name`. Then the
`display_name` can legitimately be `False` again. But the `Many2one` and
`Many2XAutocomplete` components don't handle this case (and generate a
traceback see task-3424154).
This commit adds the same fallback ('Unnamed record') for these two
problematic components; one when the name_search returns `False` as
`display_name` (autocomplete for Many2Xfields) and another when we read
the many2one `display_name`. This name is not user friendly, but for
the business model it shouldn't happen anyway. It is also better than
the empty string which is confusing with no value. Note that there is
already a fallback for `display_name` that is used in the broadcrumb
(https://github.com/odoo/odoo/blob/50b2a24f22cb470bcc1a9befe677cf794211d7b2/addons/web/static/src/views/form/form_controller.js#L282).
Part-of: odoo/odoo#138061
This reverts commit 4573ca0c83eb63785016f4389a5157efb21fa9a4.
Because now, `display_name` is implicitly on every form (last breadcrumb
item). Then it will be queried by `onchange` calls. When we create a
new record, `_rec_name` can be `False` and the display_name will be a
technical one: '<model_name>,<NewId0x...>' which is uglier than the
previous situation showing 'New'.
Part-of: odoo/odoo#138061
Some Qunit tests (in stock_barcode module) need to mock the barcode
service in order to be executed correctly.
This commit adds a new helper function that simulate the barcode service bus.
closesodoo/odoo#136236
Related: odoo/enterprise#48054
Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit removes some warning messages displayed in some wizard and
removes the fields used to display or not those warning
messages.
task-3356114
closesodoo/odoo#124820
Related: odoo/upgrade#4899
Related: odoo/enterprise#42472
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.
In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.
task-3356114
Part-of: odoo/odoo#124820
Co-authored-by: Kamlesh Pathekar <kpt@odoo.com>
In HBA's demo sheet, `markAsValueUsed` goes from more than 2% of the total
loading time to less than 1%
closesodoo/odoo#138166
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Instanciating an error is very slow.
In HBA's demo spreadsheet, `_assertDataIsLoaded` takes up to 17% of the total
spreadsheet loading time.
With this commit, it's reduced to less than 2%
Part-of: odoo/odoo#138166
`getReportMeasures` is called repeatedly for every pivot function.
In HBA's demo spreadsheet it takes up to 30% of the loading time.
Part-of: odoo/odoo#138166
On HBA's demo spreadsheet, `parseGroupField` takes more than 3% of the total
loading time.
This commit reduces to less than 1.5%
Part-of: odoo/odoo#138166
With this [commit](https://github.com/odoo/odoo/commit/adb8ec875c9b4e299147c46dc60a87fd26fff91f), we created a new 'Analytic Reporting' menuitem.
But no `search_view_id` was specified, so it was falling back on the one from `hr_timesheet` (when installed), which we don't want.
This commit fixes that by forcing the use of the one defined in `analytic`.
task-3463639
closesodoo/odoo#138165
X-original-commit: ed60f37205acf85c05338b0cd00f4e2f5056de60
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
The tempusdominus library has been removed by [1]. This commit
removes scss customizations of the library that have been forgotten.
[1] 910897fc97closesodoo/odoo#138129
Related: odoo/enterprise#48657
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Current behavior:
If you delete the default tip product, then activate tips in the PoS
config you will be blocked by a warning message saying that the tip
product is not set even if you set it. To fix this we only check if the
tip product exist if the tips are activated for the current config.
We also remove the compute on the tip product field so that we can set
any product as a tip product.
Steps to reproduce:
-Delete Tip Product
-Open PoS config
-Activate tips
-Try to save, you will be blocked by a warning message
-If you try to turn off the tips, you will be blocked by the same
warning message
opw-3519123
closesodoo/odoo#138109
X-original-commit: 715dd599baa4fec124c7ec84fee11df0550251b8
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
Merge l10n_pl_jpk as it is a functionality that every user that uses l10n_pl should have.
Especially, since the fields will be necessary for the e-invoicing.
Also merge l10n_pl_delivery_date and delivery_date on account_move.
This means the module l10n_pl_sale_stock is not necessary anymore.
closesodoo/odoo#135595
Related: odoo/enterprise#47445
Related: odoo/upgrade#5152
Signed-off-by: William André (wan) <wan@odoo.com>
As the comment says:
> This function must be removed when the WOWL env will be available in
> the form_renderer.
This code seems not needed anymore.
closesodoo/odoo#135273
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, when the user shares a portal link, the receiver
has to click on the link to understand what it is about.
This commit uses new key called `preview_object` inside
`portal.frontend_layout` template.
When it is defined, it will add some useful information for the
preview link.
This commit also defines `preview_object` in portal view of project
and task to be able to have the preview link to prevent the user
from having to click on the link to understand what it is about.
task-3186692
closesodoo/odoo#113622
Related: odoo/enterprise#37514
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit:
On applying background or on remove background color, strange padding
is added on the text.
After this commit:
Now, padding is not added when background is colored is applied or background
color is removed.
task-3237693
closesodoo/odoo#138143
X-original-commit: 29a40a30f3bf7a4a3a205e54fb84e569691d961f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
account_edi_ubl_cii, account_peppol
Problem
---------
Currently, the tree view for customers does not include information
about the EDI format. Only a custom `group_by format` is present which
is not user firendly.
Objective
---------
As we have more and more EDI format following each type of customer, we
should add an easy way to manage that directly in the customer list.
Solution
---------
1. Extend the `res_partner` search view to add a group_by option on the
format.
2. Extend the `res_partner` tree view to add a optional hidden column on
the format, and one for the PEPPOL eas, endpoint and endpoint validity.
3. Create a server action that executes
`button_account_peppol_check_partner_endpoint` on the selected records
in the list view.
task-3531419
closesodoo/odoo#137567
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Before this commit, diagnosing websocket handshake error was
cumbersome since the only information available was the return
code of the initial HTTP request (400).
The HTTP stack does not log `werkzeug.exceptions.HTTPException`
and derivated classes since they are valid responses. This commit
adds a log in order to provide more insight about what went wrong.
closesodoo/odoo#138083
X-original-commit: 50af40302c2849b99e8e501bc170cf887ca8e6fa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Description of the issue/feature this commit addresses:
When opening a view with the quick filters available with a domain which
returns no data, a message shows up saying that no filter is available for
the data that has been retreived and tells the user that updating the filters
will allow him to display more records and maybe make the quick filter
available. This message is displayed in a way which is not so great for user
experience as it is written in a very thin column making the text being
written one word per line. The example used to point out that problem is using
the mexican localization, going in the accounting app, in the tax report
and clicking on any value equals to zero.
Desired behavior after the commit is merged :
This commit replaces that message with a "All" button like it would be if the
domain had returned data and some filters were available. Only this time, no
filter is available under the button as there is still no data to filter.
Adding this fix, there is no messy message showing up in the quick filters
column when the query was not able to rertrieve any data with the given domain.
task-3462024
closesodoo/odoo#138060
X-original-commit: 262b71aad23296f059938496a740ba61e71daea8
Related: odoo/enterprise#48636
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
Step:
- Install project app
- Activated Task Dependencies
- Create project and task
- Add sub-task
- Click sub-task action
issue:
In the commit below we have passed the default_project reference so we get the
current project stage.
Fix:
we pass 'subtask_action' context to subtask action and we checked that context
in _read_group_stage_ids method if subtask_action context is found then we will not
fetch project's stages.
Side effect of this commit-https://github.com/odoo/odoo/commit/23cf9318084c8a00f37ffcefefa3e056583d2d77
task-3390279
closesodoo/odoo#138024
X-original-commit: 82c29c03cbaa351600b782082554378b4a320b73
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Previously, mobile self-order was not available when restaurant mode was
deactivated.
Now it's possible to activate self-order mode without the restaurant
option activated. Self-order will then be forced to "pickup zone" mode
and pay after "each order".
---
Previously, when the self-order was closed, a popup indicating this
appeared in full screen.
Now, this popup has been replaced by a banner at the top of the screen,
so that the self-order can still be used in read-only mode.
---
Previously, when the kiosk was loaded and there was no product available
in the pos_config, a traceback was raised. Now, when we are in this
case, we display a message indicating to first add products in full
screen.
---
Fixed a traceback when trying to start the POS by clicking on the image
of the landing page. The function start() had been removed. It is now
restored.
closesodoo/odoo#137671
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
Steps to reproduce:
- Activate "Eat in / Take away" (`pos_self_ordering_takeaway`) setting.
- Set the alternative fiscal position.
- ISSUE: When selecting take away in the app, the take away price is not shown.
FIX: The issue is because during the loading of the products, only the default
price is computed. In this PR, we are now computing the take away price as well.
And in the ui, depending on the choice, we are showing the correct price.
closesodoo/odoo#137653
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Step to reproduce:
- Install `Elearning` module
- Go to any course and a content as document
- Upload a pdf with more than 1 page
- Go to the website and click on the course then on the content with
the document
- Go to last page and click on next button (should display suggested
slides page)
- Click on previous button
Issue:
Page displayed is not the last one, but the one before.
Cause:
When clicking on the previous button, the current page is still the
last page (just with the suggested slides page on top of it as
overlay), and therefore will decrease it to the page number before
last page (nb last page - 1).
Solution:
When clicking on previous button, if we are on the suggested slides
page (by checking if overlay is not hidden since no attribute is set
on `EmbeddedViewer` to know if we are on that page), hide it.
opw-3482712
closesodoo/odoo#137644
X-original-commit: 422625615b2f6708667fa44d2a9e83ad3e66e5af
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
This service was used to redirect legacy service requests to the
wowl service infrastructure. It has been incrementally simplified
with the codebase getting converted. It now only allows to redirect
calls to the effect service, which doesn't seem useful anymore.
This commit thus removes it.
Part of task~3439226
closesodoo/odoo#138120
Related: odoo/enterprise#48654
Signed-off-by: Géry Debongnie <ged@odoo.com>
The commit https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa introduced a way to update the
useragent used to request openstreetmap nominatim service.
It was introduced as a bad fix to prevent an erroneous blacklist from the
service. Once the blacklist has been removed, this fix was not necessary
anymore. It also allows to abuse the free service which is against the
osmfoundation policy. The best solution would be to decrease the amount of
request. The Google Place Map service is also available to avoid using the
openstreetmap service with large database.
closesodoo/odoo#138078
X-original-commit: 2726d2724e06e5818eaf2d0010971554372c4727
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Steps:
- Open Helpdesk
- Enable the 'forum' feature on a helpdesk team
- Open the help webpage
- Search for something
- Traceback appears
Issue:
- When we search for something, we get a traceback instead of search results.
Cause:
- In the template, we do not get the value of create_uid.id as we are trying to
compute it from post_id.
Fix:
- Instead of computing the value from post_id, we need to compute it from post
hence we will obtain the values by writing post.create_uid.id
closesodoo/odoo#138086
Task: 3461563
X-original-commit: 068d81d4466e2293153f1f7c71e32ee7e3ad33c0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Install auth_oauth and via the /web/login, click the "Log in using
Odoo.com" button. You are redirected on odoo.com which ask you for your
odoo.com login and password. When the login form on odoo.com is
submited, you are redirected back on your local database.
The problem is that, in case a new account was created on-the-fly, then
the login fails with a cryptic error. The actual error is that
`request.env.user._is_internal` fails because `user` is an empty
recordset where it should had been the just-authenticated user.
The problem is an inconsistent transaction state between the cursor of
the request, the cursor used with `auth_oauth` (which created a new
user) and the cursor used with `authenticate` (which authenticated the
new user). Yes, there are 3 cursors. The newly created user just isn't
present in the transaction of the request's cursor.
Here is the lifetime of the 3 cursors:
* request.env.cr, it begins when the http request enters Odoo, it is
commited when a http response exits Odoo.
* /auth_oauth/signin, it begins roughly at the beginning of the
controller, it is commited once after the user is created (so before
the authenticate transaction begins but AFTER the request transaction
begun), it is commited again when the controller exits.
* authenticate, begins when authenticate is called, is commited when it
returns.
Because the request transaction started before, it cannot access user
created by /auth_oauth/signin.
Because the route is `auth='none'`, if system administrators append the
`auth_oauth` module via `--load` (cli) or `server_wide_modules` (odoorc)
then the controller can be accessed without database. This is the reason
for the explicit registry/cursor/environment inside this controller, we
needed to make sure we are connected to a database, we cannot rely on
request.
The new approach used in this work is to benefit from `ensure_db()`, the
function that is used by various web `auth='none'` controllers such as
/web and /web/login. It makes sure that the database we want to connect
to is already present on the request, otherwise it repeats the request
but this time connecting it to the database. Using this approach we can
have a `auth='none'` controller whose request.env is guaranteed to be
connected on the right database. We can avoid to create explicit new
registry/cursor/environment within the controller and just use request's
ones.
Because the /auth_oauth/signin controller now simply use the request
transaction, the above point:
> Because the request transaction started before, it cannot access user
> created by /auth_oauth/signin.
just doesn't stand anymore as the user is created within the same
transaction. The extra `cr.commit()` must still be present for
`authenticate` to see the newly created user.
opw-3421701
closesodoo/odoo#138051
X-original-commit: e165568f9795af213c8467a7f17948ed781b0799
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
This commit removes the organizer's name in the mail template when booking
an appointment scheduled based on resources.
Task-3458881
closesodoo/odoo#138043
X-original-commit: ca08d996c2ca0f6de6eeddc44609b96f844d8d25
Related: odoo/enterprise#48625
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This traceback arises when the user changes the 'end_date' without the employee
value, while creating a new 'Work Entry'.
To reproduce this issue:
1) Install 'hr_work_entry_contract'
2) Open 'payroll' and create a new 'Work Entry'
3) Select 'Work Entry Type' as 'Unpaid' and change the 'To' date
Error:- 'KeyError: False'
On the '_get_duration_batch' method, when the user is not given employee value,
there will be no 'contract_id' as it is getting value from 'employee_id'.
It leads to the above traceback as 'result[work_entry.id]' is getting value
through 'employee.id'.
See:- https://github.com/odoo/odoo/blob/a277faa2ffab7559fcbad95fcc1e8fd6a26d756b/addons/hr_work_entry_contract/models/hr_work_entry.py#L110-L112
Will resolve this issue by calculating duration without employee
sentry-4514970596
closesodoo/odoo#138033
X-original-commit: cc3898ad109e9dfdb220a7245936693197ed79b1
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
This SIRET is valid according to `stdnum` but does not correspond to any
existing company.
closesodoo/odoo#138008
X-original-commit: 283e12353008812787711a664c3bc700b6f8982d
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Issue:
Reading on the field `tasks_ids` of the `sale.order` model in some
context can be slow, leading to really slow creation and duplication
of tasks on a medium sized database.
Analysis:
After creation of a task, when the ORM flushes the model, it
recomputes all the inverse dependencies that needs to be recomputed.
Currently `task_ids` doesn't implement a `search` routine on the
field, so `task_ids` needs to be recomputed for *all* sales orders,
since we don't know which sales order needs computation. So for
*all* sales orders, we trigger the compute `_compute_tasks_ids`,
which is badly implemented using the general performance anti-pattern
```py
for record in records:
field = self.env['model'].search(domain)
```
which makes 1 query per record that we are computing.
Solution:
Correct the implementation of `_compute_tasks_ids`, which now uses a
`_read_group` instead so we do 1 query for the whole recordset.
And implement the `search` on the non-stored `tasks_ids` field,
which speeds up the context of re-computations. This allows the ORM
to know for which sales order the field `task_ids` needs re-computation.
Results:
In the context a mid-size database (less than 10k records for the
concerned models)
Task creation/duplication:
| | Before | After |
|-------------|--------|-------|
| Time | 1 min | 1 sec |
| Query count | 40k | 300 |
Reference:
opw-3445565
closesodoo/odoo#138007
X-original-commit: 81ae499ce975a96c12b6e379581ba40167d025db
Related: odoo/enterprise#48610
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>