Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4347 Widoki

Hello.

i want to define a filter which is based on a fields.function but i have always this error  results.group_by is undefined

my code xml is the following:

<field name="historique_id"  widget="many2many_tags" invisible="1"/>

<filter string="Historique" name="histo_user" domain="[('agenda_user_rel','in',historique_id[0][2])]"/>

historique_id is defined in python like the folllowing:

'historique_id': fields.function(itk_facturation_fct_get_historique,type='many2many',string=U'Historique',store=False,relation="itk.facturation.historiqueagenda"),

and my function is the following:

def itk_facturation_fct_get_historique(self,cr,uid,context=None):
        result={}
        for agenda in self.browse(cr,uid,ids,context=context):
            cr.execute("select emp_id from itk_facturation_historiqueagenda,histo_agenda_emp_rel where itk_facturation_historiqueagenda.historiqueagenda_user_id=%s and itk_facturation_historiqueagenda.id=histo_agenda_emp_rel.histo_id",[uid])
            liste=[]
            for r in cr.fetchall():
                liste.append(r[0])
            result[agenda.id] = liste
            print "***result>>>",result
        return result

please any help

Awatar
Odrzuć
Najlepsza odpowiedź

Function fields can only be used in domain, filter, group by, etc. if either stored or have fnct_search defined.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
mar 15
7778
5
wrz 20
12881
1
mar 15
5361
2
mar 15
7611
0
mar 15
4043