Skip to content

Commit e9bb9f4

Browse files
committed
[FIX] util/fields : Changing ttype for related fields to html
This commit aims to change ttype of the custom related field which are being converted to html as it fails views where this fields are being used. Part of odoo/upgrade#5172 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent c077e5b commit e9bb9f4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/util/fields.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,18 @@ def convert_field_to_html(cr, model, field, skip_inherit=()):
486486
),
487487
[ttype, "%s,%s" % (model, field)],
488488
)
489-
489+
cr.execute(
490+
"""
491+
UPDATE ir_model_fields AS imf
492+
SET ttype = 'html'
493+
FROM ir_model_fields AS f
494+
WHERE imf.related_field_id = f.id
495+
AND f.name = %s
496+
AND f.model = %s
497+
AND imf.state = 'manual'
498+
""",
499+
[field, model],
500+
)
490501
for inh in for_each_inherit(cr, model, skip_inherit):
491502
if not inh.via:
492503
convert_field_to_html(inh.model, field, skip_inherit=skip_inherit)

0 commit comments

Comments
 (0)