The checks of Odoo 20.0 (test_base, base, test_lint) that look at every installed model
or view, which this series of Odoo does not have yet or only runs on demand
(tags migration, render_all_views), run on the modules of the repository under
test (repo_to_check_quality, see test_viin_pylint):
- the currency of a stored monetary field has a SQL representation (or the field
is not summed in the lists and reports)
- the views the modules define or extend are valid once combined with all
their extensions
- these views load (get_views) as the administrator and as a regular user
- no super() call to a method no parent defines
- write() overrides do not read translated fields from vals
- the many2one fields dependencies go through are indexed, the declared constraints
and indexes exist in the database
Editions Supported
- Community Edition
- Enterprise Edition
Test Base Viin
test_base_viin runs, on the modules of the repository under test, the
checks of Odoo 20.0 (test_base, base, test_lint) that look at every
installed model or view, which this series of Odoo does not have yet or only
runs on demand (tags migration, render_all_views). The checks of
test_lint reading the registry run here, not in test_viin_pylint: the
runbot runs the tests of test_viin_pylint in a database where it installs
nothing else. It ships no user interface: it is
driven by running its tests, after the installation of every module
(post_install).
What it checks
- test_all_models - the currency of every stored monetary field has a SQL
representation: Odoo sums such a field in the lists, the pivots and the
graphs (read_group) per currency, and drops its sum without a word when
the currency cannot be aggregated in SQL (Monetary._description_aggregator).
- test_ir_ui_view (TestAllViews) - every primary view a module of the
repository defines or extends is valid once combined with all its
extensions. Installing a module only validates the nodes of its own views,
not the nodes of the other modules whose context it changes: a field used in
a modifier that another module restricts to some groups... The warnings of
the validation fail too.
- test_ir_ui_view (TestRenderAllViews) - these views load as the web
client loads them (get_views: the view, the description of its fields,
its toolbar, its filters), as the administrator and as an internal user with
the lowest group of every application: a view override, a selection
function or a toolbar action reading what a regular user cannot read only
fails for that user.
- test_override_signatures - no method calls super() when no parent
defines the method: the call fails as soon as the code runs.
- test_override_translated_fields - no write override reads a translated
field from vals (it is the value in one language only).
- test_index - the many2one fields the dependencies of a stored field go
through are indexed, and every declared table object (models.Constraint,
models.Index, models.UniqueIndex) and field index exists in the
database.
This series runs some checks of Odoo 20.0 on every model already, so they are
not repeated here: the computed fields on a new record and the form of every
model opening on a new record (base, TestEveryModel), the signature of
the overrides, the ids/context parameters of the public methods and the
index of the inverse of a one2many (test_lint: TestLintOverrideSignatures,
TestNaming, TestIndex, which the runbot runs in the database where it
installs every module), the customized ORDER BY of a many2one keeping
read_group valid (test_read_group) and the removed model attributes
(base, test_deprecation).
The repository under test is the one of test_viin_pylint
(repo_to_check_quality).
This software and associated files (the "Software") may only be
used
(executed, modified, executed after modifications) if you have
purchased a
valid license from the authors, typically via Odoo Apps,
or if you
have
received a written agreement from the authors of the
Software (see the
COPYRIGHT file).
You may develop Odoo modules that use the Software as a library
(typically
by depending on it, importing it and using its
resources), but
without
copying any source code or material from the
Software. You may distribute
those modules under the license of your
choice, provided that this
license
is compatible with the terms of
the Odoo Proprietary License (For
example:
LGPL, MIT, or proprietary
licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell
copies of the
Software or modified copies of the Software.
The above copyright notice and this permission notice must be
included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT
SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.