diff options
| author | Florent de Labarre <florent.mirieu@gmail.com> | 2019-03-19 23:30:03 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-08-05 13:57:34 +0000 |
| commit | c8fca2d0525495cb49400bcf8cb2e912ae6e4a04 (patch) | |
| tree | 07d7e9302f89fec207ecde1a20c410584becf773 /odoo | |
| parent | 8a8126126efc317a469bc4494314f6b77a12500b (diff) | |
[IMP] base: add more information for incorrect dependencies
If a dependency was wrong in the triggers, it was hard to debug
Co-Authored-By: Olivier Dony <odo@odoo.com>
closes odoo/odoo#31958
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/fields.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index 8d866204765..1d1b51225cb 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -703,7 +703,9 @@ class Field(MetaField('DummyField', (object,), {})): _logger.warning("Field %s depends on itself; please fix its decorator @api.depends().", self) model, path = model0, path0 for fname in dotnames.split('.'): - field = model._fields[fname] + field = model._fields.get(fname) + if field is None: + raise KeyError(_("Field %s depends on unknown field %s") % (self, dotnames)) result.append((model, field, path)) model = model0.env.get(field.comodel_name) path = None if path is None else path + [fname] |
