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