Incorporate Andrea Arce (andreaarce) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr
closesodoo/odoo#87218
X-original-commit: 89a086c8fe06a4823f405e4f14a77396b520fe88
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
There is a concurrency issue in the action service:
1) be in an action with several views
2) execute another action (e.g. by clicking on a menu)
-> [calls the route "/web/action/load", and it takes a while]
3) meanwhile, click on another view in the view switcher
If the call to "/web/action/load" is long enough, it may happen
that the view requested in step 3 is briefly shown before the
action associated with the menu clicked in step 2.
In this scenario, the action of step 2 should never be displayed,
because the user requested something else afterwards (in this
case a switch view).
One can produce a similar issue when restoring a previous action
of the breadcrumbs instead of switching view.
This commit fixes those two issues by registering a resolved
promise in the keepLast (concurrency utils), s.t. it "cancels"
the potential current operation (in this case, the call to
"/web/load/action").
closesodoo/odoo#87204
X-original-commit: fb9c8cd6fee476d2506b8c1338bf88c4520ea7b6
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit
When trying to open the linktool on link that are not
`isContentEditable`, the linktool was initialized and not
showed in the sidebar.
After this commit
As it does not make sense to edit a link that is not editable,
prevent the linktool from being initialized in the first place.
task-2802592
closesodoo/odoo#87203
X-original-commit: 4a634f2c5bfceb3f2dc200f9b391ef1cdbc0e697
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This prevents a traceback when no closest block to the root node can be
found in the sanitizer.
task-2796371
closesodoo/odoo#87187
X-original-commit: 2104f33985472cd59f067d2f1403518a332fac6d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Until now using a groupby on a view containing a reified field added
with studio was not possible.
Because `read_group` uses these pseudofields as simple fields when they
are not actually columns in the table.
With `read`, `write`, `create` and `fields_get` it was already
supported.
This commit solves this problem by ignoring reified fields in an
override of `read_group`
opw-2793148
closesodoo/odoo#87186
X-original-commit: a25e25aeab3ed6aa1af57fac13312346b723dbf8
Signed-off-by: Raphael Collet <rco@odoo.com>
To reproduce
============
- In a belgian company, set legal time type as no need approval
- as admin, take a day in the future with this time off
- in the time off form, a cancel appears (near refuse)
- Cancel the time off
The day of the time off, the flight icon is set on the employee
Purpose
=======
When cancelling a time off, we set it's `active` field to False, but its state remains `validate`,
but when fetching for users on leave, there is no check on the `active` field.
Specification
=============
To solve the issue a check on `active` field was added to the query.
opw-2784173
closesodoo/odoo#87183
X-original-commit: 5d80d7c91fe05716602e2182515a4e26ea957e41
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The journal in a cut-off has to be of type general. But there is an
issue at the moment where a default_journal_id would be provided in
the context (coming from the dashboard for example) and thus, fill
the journal in the cut-off wizard with a wrong value (vendor bill for
example).
This change make sure no default values are provided to the wizard.
closesodoo/odoo#87179
X-original-commit: 5b099bf6135b2ff517078d1839b513da7830f718
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
Steps to reproduce the issue:
- create product P
- create a Engineering Change ders ECO in PLM app
- attach documents to ECO and apply changements
Bug:
- go to the product, try to open uploaded documents. they are not found
This bug happened since odoo/odoo@114b71f
opw:2762448
closesodoo/odoo#87176
X-original-commit: 779a0df6732db51af652d6c282490187d11244a1
Signed-off-by: Simon Goffin <sig@odoo.com>
Co-authored-by: mart-e <mat@odoo.com>
This adds options to the "Design" tab of mass_mailing so the user can
edit its stylesheet directly.
task-2789287
closesodoo/odoo#86881
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Prior this commit, the `ChatWindowHiddenMenu` had a fixed width and the
`windowCounter` was truncated when the number was higher than 9.
Also, when the `unreadCounter` was displayed, it was partially hidden by
the chat windows.
After this commit, this element uses a fluid width and is in front of
the chat windows to correctly display the `unreadCounter` badge.
task-2781992
closesodoo/odoo#86244
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
PURPOSE
Cleanup and improve test coverage in test_mail(_full), notably about composer,
message_post API (and its sub-methods) and attachments management.
SPECIFICATIONS
Improve tooling of mail tests. Use SMTP mockup class available in base tests
in mail tests to have a better and simplified mock tool when dealing with
mail tests. Remove old fashioned code.
Add tests related to mail failure management and its effect on mail.mail
and related mail.notification records.
Cleanup and improve composer-related tests. As composer will soon be improved
better ensure we don't break flows.
Cleanup and improve post-related tests. As composer and posting methods will
soon be improved better ensure we don't break flows.
Add some first tests about rating and rating mixin:
* rating preparation: token, information from the record to rate;
* rating apply: posting message, author;
See sub commits for more details.
LINKS
Task-2673913 (TestMail: Cleanup and improve test coverage)
Task-2704390 (TestMailFull: add first rating tests)
Prepares Task-2088884 (Mail: Composer Onchange to Editable Computed Stored)
Prepares Task-2710804 (Mail: Clean MailThread API)
Prepares Task-2684479 (Mail: Better send errors management)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
closesodoo/odoo#86393
Related: odoo/enterprise#25267
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to add some first tests about rating and rating
mixin. Indeed those are not really tested by standard python unit tests.
In this commit we add tests about
* rating preparation: token, information from the record to rate;
* rating apply: posting message, author;
Task-2673913 (TestMail: Cleanup and improve test coverage)
Task-2704390 (TestMailFull: add first rating tests)
Part-of: odoo/odoo#86393
Purpose is to add some query counters tests in test_mail_full that allows to
test more complete flows. Soon portal and rating will be added as dependencies
to see their potential impact. This also serves as a basis for adding new
tests with all sub mail modules in a near future.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
PURPOSE
Cleanup and improve post-related tests. As composer and posting methods will
soon be improved better ensure we don't break flows.
SPECIFICATIONS
Cleanup tests added for message_post and the related API (notify, log, with
view or template, ...) as well as sub-methods (notify, recipients computation
and classification, ...).
Use existing tools, reorder and add some details check on content. Add some
tests with attachments, notably with main_attachment management.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
PURPOSE
Cleanup and improve composer-related tests. As composer will soon be improved
better ensure we don't break flows.
SPECIFCIATIONS
Cleanup existing tests: rename, make it use tools, reoder them.
Add some tests about composer in order to better spot changes and differences
as well as to help debugging mail composer code update. Notably add tests
with Form tool, add tests for reply-to computation, auto-delete, mail server.
Performance tests about composer are added, notably using the Form tool. This
helps determining differences between creating / manipulating a composer in
code and in UI. Indeed notably onchange and some side effects may lead to
different query counters, which is the case as highlighted here. Tests
involving attachments are also added to see their impact on posting process.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
PURPOSE
Purpose of this commit is to add a company field on test mail models used to
replicate ticket / project behavior (``mail.test.ticket`` and ``mail.test.
container``).
SPECIFICATIONS
To avoid messing with existing tests and ease comparison through all Odoo
versions (notably performance) this is done by adding new models inheriting
from current mail models. A company_id field is added as well as MC rules.
Those models will be used to add tests for mail thread behavior in a multi
company environment (aliases management, performance, emails and notification
layouts, ...).
In this commit we also update ACLs for ticket-like models to add rules for
portal users, based on followers. This mimics classic rules from Odoo used
notably in a light project-like environment. This allows to test a bit more
in details recipients, access tokens, links in emails, ...
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
PURPOSE
Add tests related to mail failure management and its effect on mail.mail
and related mail.notification records.
SPECIFICATIONS
Test wrong configurations when sending emails (email_from, email_to) and/or
use mocks to enable sending issues (SMTP issues, Memory errors, assertion
errors, ...) that may happen when sending emails.
Add unit tests for as much use cases as possible to assert current behavior
even if some tests show that it is not always accurate. Notably
* invalid / missing email failure types that are not correctly distinguished
even if it should;
* email_from invalid value goes a bit incognito;
* sometimes mail is marked as sent even if it was not sent;
Future commits will (probably) fix or improve behavior while impacting as
less as possible the global behavior of the outgoing gateway that is quite
tricky to modify.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
PURPOSE
Improve tooling of mail tests. Lessen custom code, try to use same tools
in all tests.
SPECIFICATIONS
Use MailCommon as a base class for performance test. It now uses the same
boilerplate as other tests, leading to easier to reproduce and understand
testing setup.
This notably now adds outgoing mail servers which means adding one query
to some tests involving emails.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
mail_* = mail, test_mail, test_mail_full, test_mass_mailing
PURPOSE
Improve tooling of mail tests. Use SMTP mockup class available in base tests
in mail tests to have a better and simplified mock tool when dealing with
mail tests. Remove old fashioned code.
SPECIFICATIONS
Include ``MockSmtplibCase`` directly into ``MockEmail`` so that we re-use
existing components for mocking outgoing emails. Also make parameters for
gateway coherent between those two classes (use same test values).
Remove 'sim_error' weird parameter of Mail ``mock_mail_gateway`` and use
standard mock 'side_effect' instead in some specific tests, notably on
SMTP.connect() mock.
Add some assert / tools method and improve existing tools, used for creating
or improving test data. This will be used in future commits when adding new
tests.
Add outgoing mail servers data in mail tests, allowing to make tests closer
to real life use cases.
Remove unnecessary calls to ``_init_mail_gateway`` as it is automatically
done in ``MailCommon.setUpClass()``.
Try to consolidate starting test data, notably with countries, phone numbers
or email in mind to be sure test mail are deterministic.
Task-2673913 (TestMail: Cleanup and improve test coverage)
Part-of: odoo/odoo#86393
Activity-level feedback method accepts attachment_ids but not its mixin-level
counterpart. This commit fixes that by adding the parameter. The activity-level
action_feedback_schedule_next method now also accepts attachments in addition
to the feedback, making the API coherent through all entry points.
At activity level ``action_done`` now goes through ``action_feedback``. This
means it now has two main methods
* ``action_feedback``;
* ``action_feedback_schedule_next``;
All methods finally end up calling ``_action_done`` and correctly propagate
feedback and attachments. We have a bit less entry points with possible API
changes.
Test mail models are updated to be able to use this small addition.
Task-2710804 (Mail: Clean MailThread API)
Part-of: odoo/odoo#86393
This fixes the how general discounts and product discounts are represented in the Italian EDI.
Previously, discounts were erroneously calculated and represented on several invoice lines not linked to the product.
Now, cascading discounts are summaries as 1 percentage discount for products and 1 amount for the general discount.
closesodoo/odoo#85863
Task: 2764978
X-original-commit: 5769f13e48c5b68bf19fc82377b9ea716ea4a85e
Signed-off-by: Josse Colpaert <jco@odoo.com>
The contact widget supports displaying VAT but it was added manually in the reports after contact. This commit fixes this behavior and results in fewer code and an easier way for the l10n modules which may modify VAT display.
closesodoo/odoo#83733
Related: odoo/enterprise#25195
Signed-off-by: Laurent Smet <las@odoo.com>
Have a CL company setup
Issue an invoice
Then generate the credit note via 'Add Credit Note' wizard
Add a reason (credit method is locked to 'partial refund') and confirm
Error will raise “You can not use a invoice document type with a refund
invoice”
This occur after
https://github.com/odoo/enterprise/commit/9e049b833b23809e4287ef61ddf7482413debefd
We now fall back to the logic of l10n_latam_invoice_document
which, in turns, fall back to the l10n_cl, ignoring the 'credit_note'
case.
opw-2794515
closesodoo/odoo#87116
X-original-commit: c9ff9d28ab75c02093ca54d9fbd1d2e203c5ee2e
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Now that message list view exists, it should be used whenever possible, in
preparation of future commits.
Part of task-2801089
closesodoo/odoo#87113
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
From the last refactoring #78857 it was no longer possible to run the odoo server on an iot
With this commit we change the override of the db_list function
And and reload the driver controllers
closesodoo/odoo#86665
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Before this commit, if the user has read only access to a record:
- User could see 'Add Followers' button, which raised AccessError
- User could see edit and remove icons but performing these actions
for followers other than one related to logged in user, it also
raised AccessError.
With this commit, we are restricting it based on the user rights, if
the user has read only access to a record:
- 'Add Followers', subtype edition(pencil icon) and follwer removal
buttons will be visible only for the follower related to logged in
user, not for others. This way we can avoid the unexpected
AccessErrors.
Note that if user is having write access for the record, nothing
changes.
task-id-2447776
closesodoo/odoo#70575
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The test `test_assign_count` may fail randomly leading to the error:
```
self.assertEqual(self.sales_team_1_m3.lead_month_count, 14)
AssertionError: 12 != 14
```
Since BUNDLE_HOURS_DELAY is 0 (during tests), the domain becomes
`[('create_date', '<', fields.Datetime.now()]`
Depending of the time when the transaction starts, and the tests is
executed, the domain could match more or less records when executed one
second earlier or later. This is especially True for single module build
where there is less logic and the execution is faster. The domain may be
tested earlier and match less records.
This error can be reproduced deterministically by setting
`BUNDLE_HOURS_DELAY = 1/3600`
A fix could be to ignore ignore the create_date domain if the
BUNDLE_HOURS_DELAY is 0, we want to match all records in theory
(except if some of them are created in the future...)
The chosen solution is to use cr.now and use a <= instead.
Some assertions where also added to the test in order to identify why
the count was different and give a more precise message when it fails.
```
AssertionError: Lists differ: [] != ['TestLeadInitial_0000', 'TestLeadInitial_[97 chars]006']
Second list contains 6 additional elements.
First extra element 0:
'TestLeadInitial_0000'
- []
+ ['TestLeadInitial_0000',
+ 'TestLeadInitial_0001',
+ 'TestLeadInitial_0002',
+ 'TestLeadInitial_0004',
+ 'TestLeadInitial_0005',
+ 'TestLeadInitial_0006']
```
task-2796579
closesodoo/odoo#87107
X-original-commit: 4a5b68f05c57ba36560d43733dfd04b67c3297a8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Currently, a cron is called once a day (by default)
to merge duplicated quants. Moreover, each
time the customer loads the Inventory Report,
the duplicated quants are also merged.
This is a bit overkill as duplicated quants
due to concurrent updates are quite rare. Also,
merging quants can be quite slow when the stock.quant
table is big (>1M).
This commit adds an ir.config_parameter to turn
off the merging of quants when accessing the
Inventory Report. It can be switched back on
for a specific DB if duplicated quants happen
more frequently.
opw-2574152
closesodoo/odoo#87119
X-original-commit: bb2cb76a724c1bc12aa7e515b1376b88ffd97b3d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Before this commit:
Attachment viewer download and print buttons not working for guests.
After this commit:
Attachment viewer download and print buttons will work for guests.
Task-2664842
closesodoo/odoo#87025
X-original-commit: 191a4b21a446d17a5090481b16f3de56a57f611e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Thread/hasComposerThreadTyping is always set to boolean, so never `undefined`.
Task-2793280
closesodoo/odoo#86965
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>