Hi every body,
i need to set with the fonction formatLang() function the style of date according to the user's language. So in the module l10n_hr_in_payroll, when i am trying to print advice payment report i get error. I know it concern the above part of code, so please help me :
in report.py code i have this funtion
def get_month(self, input_date):
payslip_pool = self.pool.get('hr.payslip')
res = {
'from_name': '', 'to_name': ''
}
slip_ids = payslip_pool.search(self.cr, self.uid, [('date_from','<=',input_date), ('date_to','>=',input_date)], context=self.context)
if slip_ids:
slip = payslip_pool.browse(self.cr, self.uid, slip_ids, context=self.context)[0]
from_date = datetime.strptime(slip.date_from, '%Y-%m-%d')
to_date = datetime.strptime(slip.date_to, '%Y-%m-%d')
res['from_name']= from_date.strftime('%d')+'-'+from_date.strftime('%B')+'-'+from_date.strftime('%Y')
res['to_name']= to_date.strftime('%d')+'-'+to_date.strftime('%B')+'-'+to_date.strftime('%Y')
return res
In the rml file i have :
<blockTable colWidths="539.0" style="Table2">
<tr>
<td>
<para style="P10">Payment Advice from [[ o.name ]] on our bank account N° [[ o.bank_account_id.acc_number ]] form period [[ get_month(o.date)['from_name'] ]] to [[ get_month(o.date)['to_name'] ]]</para>
</td>
</tr>
</blockTable>
So how can i obtain my report in french with date style (ex : 30 juin 2015)?
Thanks.