Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3557 Переглядів

I have a model where a functional field of type many2one, partner_id,  is pointing to res.partner object.

This field is stored in database so that I can group by in the view. The group by function works well, however the partner name is not displayed on top of the group. Instead of having for instance "John Doe (10)" in my group view, I see "(10)". If I expand the group I can see that the partner_id field is set and contains John Doe in every record.

It seems that the label is not correctly reported in the group view. I tested with different objects and relations and I always have this problem. Do you know if it is a bug or if I have to configure something to tell what to display in the groupped line ?

Here is my code :

<filter string="Partner" domain="[]"  context="{'group_by':'partner_id'}"/>

_columns = {
        'partner_id': fields.function(
            _get_partner_id, type='many2one', obj='res.partner',
            string=_('Partner'), store=True),
    }

Аватар
Відмінити
Найкраща відповідь

you  need to define _fnct_search on your functional field... 
refer to documentation here


 

Аватар
Відмінити
Автор

No, it doesn't help. Since the field is stored in database, fnct_search is useless. I tried to add it but it is never called.

Related Posts Відповіді Переглядів Дія
0
трав. 24
1618
1
лип. 21
2634
1
лип. 18
3940
0
квіт. 16
4144
6
січ. 16
7690