diff options
| author | Achraf (abz) <abz@odoo.com> | 2020-10-12 19:08:48 +0000 |
|---|---|---|
| committer | Achraf (abz) <abz@odoo.com> | 2020-10-12 19:08:48 +0000 |
| commit | 8af2dbb06723213163ee3ad617e5c9309099b4bc (patch) | |
| tree | 1de28236ee512e2143c66a7d6417e32af0acd2d5 | |
| parent | bd95b7174bdf6c0e6a0dfcd394b69a519fde25be (diff) | |
[FIX] manufacture: Automation rules raise traceback
Issue
- Install `Manufacture` and `Purchase`
- Go to `Manufacture`
- Enable Studio
- Create new rules
- Select `Purchase Order` model
- Try to select autocomplete proposition with `Deliver to` field
Traceback raised.
Cause
The _search function does not return indexable value.
Solution
Cast _search to a list.
PS: search can be used (instead of _search) to get iterable value.
opw-2357391
closes odoo/odoo#59812
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | odoo/addons/base/models/ir_actions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/addons/base/models/ir_actions.py b/odoo/addons/base/models/ir_actions.py index aa047379b73..4287870db26 100644 --- a/odoo/addons/base/models/ir_actions.py +++ b/odoo/addons/base/models/ir_actions.py @@ -662,10 +662,10 @@ class IrServerObjectLines(models.Model): try: value = int(value) if not self.env[line.col1.relation].browse(value).exists(): - record = self.env[line.col1.relation]._search([], limit=1) + record = list(self.env[line.col1.relation]._search([], limit=1)) value = record[0] if record else 0 except ValueError: - record = self.env[line.col1.relation]._search([], limit=1) + record = list(self.env[line.col1.relation]._search([], limit=1)) value = record[0] if record else 0 line.resource_ref = '%s,%s' % (line.col1.relation, value) else: |
