Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5187 Zobrazení

Hi everyone

I have definided many2one fields in my table, when I look at my table appear only ids of records:

These are my field definitions:

'brand': fields.many2one('cm.brand', 'Marca', ondelete='restrict'),

'model': fields.many2one('cm.model', 'Modelo', ondelete='restrict')

In my table, I have something like this:

brand integer      model integer

1                        2

2                        1


Instead of these integers(ids), I would like to have name value stored in the database, I tried adding a related field in my model:

'model_name': fields.related('model', 'name', readonly=True, type='char')

However, it doesn't make any change.

Any suggestions?




Avatar
Zrušit
Nejlepší odpověď

Dear Diego,


in this case you must add store="True" if you need to see this related field in the database.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 19
3432
2
bře 15
8678
1
bře 15
5077
3
říj 23
4232
3
dub 21
13743