Ran
|
Files
4
|
Run time
0s
|
Badge
Embed ▾
README BADGES
|
travis-ci
[ADD] add_fields: Add a field definition This method adds all the needed stuff for having a new field populated in the DB (SQL column, ir.model.fields entry, ir.model.data entry...). It's intended for being run in pre-migration scripts for pre-populating fields that are going to be declared later in the module. NOTE: This only works in >=v8 and is not needed in >=v12, as now Odoo always add the XML-ID entry: https://github.com/odoo/odoo/blob/9201f92a4/odoo/addons/base/models/ir_model.py#L794-L802 :param: field_spec: List of tuples with the following expected elements for each tuple: * field name * model name * SQL table name: Put `False` if the model is already loaded in the registry and thus the SQL table name can be obtained that way. * field type: binary, boolean, char, date, datetime, float, html, integer, many2many, many2one, monetary, one2many, reference, selection, text, serialized. The list can vary depending on Odoo version or custom added field types. * SQL field type: If the field type is custom or it's one of the special cases (see below), you need to indicate here the SQL type to use (from the valid PostgreSQL types): https://www.postgresql.org/docs/9.6/static/datatype.html * module name: for adding the XML-ID entry.
12 of 312 branches covered (3.85%)
141 of 668 relevant lines covered (21.11%)
0.21 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|