Some actions were using `list` as value for the attribute `view_mode`.
This value is not valid, the list view is named `tree` server-side.
This was causing issues when setting `view_ids` (`ir.actions.act_window.view`)
on the action because `tree` and `list` were not matching correctly.
Closes#21056
This commit cleans mail tests in order to have less low-level tests and
to improve code coverage. It improves the tests of features and reduces
field-level checks. Some tests depending on implementation details are
wrapped inside methods. This way if implementation changes most tests
are still valid once assert methods are updated.
Common classes, tools and models are improved. More test models exist
in order to be able to test several features and prepare land to add
performance test. Each set of tests is updated in its own commit.
Finally tests are moved to test_mail. This way tables linked to test
models are not present in production database. Existing test_performance
module is split so that there is tests for base and tests for mail.
Purpose is to lessen noise and make tests less low-level. Including :
* clean and remove most of old tests, low-level and not very useful;
* add tests for several cases, like simple tracking, tracking linked to
a mail.message.subtype, trackink automatically sending emails based
on some template;
Purpose is to lessen noise and make tests less low-level. Including :
* add test for the various auto subscription cases, notably through
umbrella (like project -> task auto subscription);
* remove low-level tests; there is no need to test the output of add
followers method as it is only an implementation details;
Purpose is to lessen noise and make tests less low-level. Including :
* move mail_mail model specific tests to its own file;
* move feature specific tests to its own file;
* add missing loggers to lessen noise;
Purpose is to lessen noise and make tests less low-level. Including :
* tests should be more about channel listeners than followers as
channels should not have followers;
* test email_send that trigger the mailing list behavior;
* currently add some join and leave channel methods are those are
missing in the base model:
* test joining and leaving channels that should not change
followers but members;
* use less preconfigured data;
* add some mute loggers to lessen noise;
* remove some old code about patching that is not necessary anymore and
could actually create funny bugs;
Purpose is to lessen noise and make tests less low-level. Including :
* remove unnecessary fail string;
* remove unnecessary method return value test as this is low level;
Purpose is to lessen noise and make tests less low-level. Including :
* remove test of emails content as this is too low-level and not really
interesting. Purpose of test is to check followers have been added
and not the content of a template;
* remove unnecessary fail string;
* remove unnecessary low level checks;
Purpose is to be less low level and improve code coverage by adding
tests if required. Duplicated or redundant tests are removed to lessen
number of tests. Notably content of notification emails, recipients and
specific chatter control through context keys are more tested.
Some more tests about buttons present in notifications emails should be
added. Maybe in a near future. I hope so.
This is some remains of old message_read / message_fetch tests linked to
the old chatter using threaded display. Tests have been removed when the
feature was changed. Only the setup was left. Let us get rid of it.
This commit improves common classes and add helpers for mail tests.
Future commits will use this new stuff to improve the tests.
* improve existing models and add some of them. There are now several
models
* mail.test.simple: chatter-enabled record without any really advanced
feature. Can be used everywhere standard chatter and communication
tests are required;
* mail.test.track: chatter-enabled record with basic value tracking
and responsible tracking;
* mail.test.activity: chatter-enabled record using activities;
* mail.test.full: complete chatter-enabled record with advanced
tracking, automatic subscription and automatic email send based on
templates and tracking;
* mail.test: chatter-enabled record having an alias. It can be used
where umbrella record like projects or teams has to be used in
tests;
* add MockEmails test class: this class mocks the mail gateway so that
tests can work on emails without actually sending them. It is taken
out of TestMail class to clearly separate features from class;
* improve created data in the various classes and prepare work to
lessen created data during tests;
* add helpers on base test class, notably
* sudoAs: context manager to run a code snippet using a given user;
* assertNotifications: assert notification content, aka Inbox or email
notification and their content; may be subject to change depending on
mail evolution;
* assertEmails: check content of sent emails;
Purpose of this commit is to reorganize the mail tests. Containing
* move test models into mail/tests/models/;
* move data into mail/tests/data even if it is python code, as it is
likely that some additional data will appear soon;
* split test_mail_features into test for discuss app and test related
to message post and composer, to better identify test target;
* split and remove test_portal, those tests are now integrated in the
other tests;
There is no change in this commit. Only some renaming and file move or
split.
mergeup: remove / split test portal
Test performance will now hold the base class for performance tests as
well as tests related to the ORM, depending only on base. A new module
test_mail is introduced at this commit that contains performance tests
related to mail module. This commit contains only code move and should
not impact anything.
Future commits will move mail tests into test_mail so that all mail
related tests are located in the same optional module. This allows
notably to avoid creating a lot of unnecessary tables when installing
mail module on production databases.
addTypeEqualityFunc does not work for subclasses. Therefore if we want
to be able to compare html trees we have to add the equality check for
html elements which are children of _Element.
related to rev 0d19ee989d
It was broken following the refactoring done in saas16, resulting in
barcodes being handled on all the displayed forms and it was problematic
in the case of a form dialog openned over a "fullscreen" form view.
This was particularily problematic for the scrap dialog in the
stock_barcode module.
Before this commit, it was not possible to choose the user you want to
chat with in a chat window anymore. This was because the dropdown that
suggest the users appeared under the chat windows since commit
https://github.com/odoo/odoo/commit/7b965a9673a9124e6e045b8a290a156eed402ad5
Indeed, the mentioned commit changed the z-indexes so that chat windows
are still usable when a modal is opened. This was done by making the
chat windows always have the greatest z-index... forgetting this would
make them appear on top of their own autocomplete dropdowns.
This commit restores the feature while keeping the ability to talk while
a modal is opened. See code comments for details.
opw-785162
When expensing a service product, an SO line is created
on the SO from the hr expense. This creation triggers
the service object creation (task and/or project), and
should not.
To avoid this, we check if the ordered quantity
is not zero to avoid use the expense policy (or
any expensable product will not be able to create
task/project).
The same mecanism is used in stock to avoid picking
creation when expensing stockable product.
When we create an analytic account, a project is automatically
generate, and it should not. This is a bug coming from
the removal of 'use_tasks' field. See eb4ad33513.
We can now remove all the 'project_create' and
'project_creation_in_progress' context key.
When searching a SO line, we want to search on its own
description in case of 2 product with the same name
are present on the SO. This help user to differenciate
them.
When a datetime was selected in a search filter, the time wasn't
converted to UTC to the server.
So, there were unexpecting records due to the wrong query domain.
When we retrieve the value from the datepicker, we need to convert
it to UTC before sending it to the server.
Steps to reproduce the bug:
- Login as demo user on runbot 11.0e
- Open a contact
- schedule an activity, "todo" , assigned to Administrator
- Clicking on the "i" icon next to the planned activity,
you see that the "Created by" is "Administrator" , which is incorrect
Since this commit: 53ad585bfc, the field
create_uid is always 1.
opw:783650
It could happens that an SO is canceled once the
associated PO has been confirmed/shipped.
In this case it could be usefull for the end user
to notify him in order to process manual actions.
Use case to reproduce:
- Create a SO with a product MTO and confirm the PO
-> PO -- Stock -- SO
- Cancel the SO
-> PO -- Stock canceled SO
- Set the quotation to draft and confirm it again
-> PO -- Stock
RFQ -- Stock -- SO
- If the user cancel the RFQ we will get this diagram:
-> PO -- Stock
Stock -- SO
The user can't reserve the chain correctly. Also a new RFQ will be
generated each time the user delete the existing one even if the PO
already exists.
It happens because the move keep the procure methode MTO although
the moves origin and destination links are broken.
This commit changes the move destination from purchase order
line to MTS if the RFQ is deleted. This implies that RFQ are
not automatically generated by the scheduler.
Purpose
=======
Currently if a project doesn't use pads, the created and duplicated tasks will initialize/copy them. That could be a real issue when migrating customers if we create a task for all the existing issues, since the models have been merged.
Specification
=============
Avoid this falsy behavior. We're forced to crappy fix with a context key as the project.task model 'inherit' from pad.common.