From 3513e599a7aa02c7a21ff10b064a2dfe1d3c81d1 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 6 Aug 2018 17:12:48 +0200 Subject: [PATCH] [FIX] base: show char field size in form view The char field has a size attribute that is displayed in the interface: - if the field is added with code, the size is always 0 even tough the size limit is set correctly in the database. - if the field is a custom field, the size is correct and can be updated With this commit, a base field show the correct size. opw-1869282 closes #26204 --- odoo/addons/base/ir/ir_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/addons/base/ir/ir_model.py b/odoo/addons/base/ir/ir_model.py index 2833aac61ac..e0935a1a574 100644 --- a/odoo/addons/base/ir/ir_model.py +++ b/odoo/addons/base/ir/ir_model.py @@ -750,6 +750,7 @@ class IrModelFields(models.Model): 'readonly': bool(field.readonly), 'required': bool(field.required), 'selectable': bool(field.search or field.store), + 'size': getattr(field, 'size', None), 'translate': bool(field.translate), 'relation_field': field.inverse_name if field.type == 'one2many' else None, 'relation_table': field.relation if field.type == 'many2many' else None,