Hello guys!!
Please who can help:
My python functions:
def __init__(self, cr, uid, name, context):
super(journal_paie, self).__init__(cr, uid, name, context)
self.localcontext.update({
'get_lines': self.get_lines,
'cr':cr,
'uid':1,
'ctxt':context,
})
def get_lines(self,company_id,cr,uid, context=None):
print ('first test')
if not context:
context = None
ret = []
obj = self.pool.get('hr.payslip.line')
obj_ids = obj.search(cr, uid, [('company_id', '=', company_id)])
res = obj.read(cr, uid, obj_ids, ['id', 'employee_id'], context)
print res['employee_id']
And i call my unction get_lines in my mako file:
%for item in get_lines(company_id):
<td width=31.9 style='width:31.9pt;border:none;border-bottom:solid windowtext 1.0pt;
background:#FCE4D6;padding:0cm 3.5pt 0cm 3.5pt;height:14.65pt'>
<p class=MsoNormal align=center style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:center;line-height:normal'><b><span style='font-size:8.0pt;
font-family:"Arial","sans-serif";color:black'>${item['employee_id']}</span></b></p>
</td>
%endfor
Please, i need an answer who can help me.
Thanks a lot and Regards.
But why??