summaryrefslogtreecommitdiff
path: root/odoo/addons/test_new_api/tests/test_schema.py
AgeCommit message (Collapse)Author
2020-04-03[IMP] core: reflect models, fields and selections in batchRaphael Collet
This saves 4.5% of the total installation time. X-original-commit: 8519064dce975af542ccd30dc14c56b9bb36d07b
2020-03-30[IMP] core: introduce mechanism for selection_add cleanupAdrian Torres
- Let A and B be two different modules. - A defines a required Selection field F of model M and B extends it through the `selection_add` argument. - Create records of model M and have some of them have any of the options introduced by module B selected for field F. - Uninstall module B. The result will be records of Model M with an option for field F that no longer exists, this makes the registry inconsistent and prone to crashing (it is sufficient to access the form view of such a record to trigger a crash). This commit introduces a mechanism similar to the `ondelete` argument found in Many2one fields, the argument name is the same but it's different both in behaviour and in implementation. The `ondelete` mechanism for Selection fields is enforced for **any** Selection field with required set to `True`, this means that the developer is required to set a cleanup behaviour for when their module is uninstalled. For possible cleanup options, see fields.Selection's docstring. As far as implementation goes, everything is implemented in Python unlike with Many2one fields where the behaviour is delegated to PostgreSQL. The `ondelete` setting will be processed during `ir.model.fields.selection.unlink()` to ensure that the registry is left in an appropriate state after module uninstall.
2020-03-04[FIX] orm: fields x2m are not sortableLucas Perais (lpe)
Before this commit, x2m fields were described as 'sortable' This was odd since: - When actually sorting on one of those fields through the webclient the sorting was gibbrish - Even the orm silently warned in the log that the field was not a sql column and therefore was not sortable After this commit, only a field which is column (and a few other conditions) can be sorted Task 1863492 closes odoo/odoo#46921 X-original-commit: dd3094378fc322447d1aef994f6bace3f0c24288 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-12-03[IMP] test_new_api: add subtests (to ease debugging)Raphael Collet
closes odoo/odoo#40574 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-19[REF] fields: use ir.model.fields.selectionMartin Trigaux
The selection values of a selection field are now stored in database in the model ir.model.fields.selection This will allow to have a modular approche on selections and each selection is now linked to the module that declared it. Previously to this change, the selections were linked to the field, meaning uninstalling a module had no impact on the selections stored on database. With this change, the selections will now be translated in the correct module (having an external id) and the records having a used selection will now be reset to null. closes odoo/odoo#30228 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Co-authored-by: Raphaƫl Collet <rco@odoo.com>
2018-09-14[FIX] base: avoid clash between field and method `copy`Raphael Collet
2017-04-11[FIX] base: fixing test_new_api after previous commit.qdp-odoo
New test introduced at https://github.com/odoo/odoo/commit/3214ca98206e5f99e2ab1d471ce1ef543057c9f6 tested the type of a column we changed from datetime to date in https://github.com/odoo/odoo/commit/01142701cc566b3084326af9649fd85db02b4220. Picked another datetime field to do the test
2017-02-22[ADD] test_new_api: add checks on a model's schemaRaphael Collet