Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
753 Prikazi

Please who can help me.

I have this function:

  def compute_n_1_info(self,cr,uid,payslip,context=None):
if tools['int'](payslip.date_from[5:7])==1:
value = {'assiette_irpp_anuel_reel_n_1': 0.0,
'irpp_reel_n_1': 0.0,
'cumul_brut_imp_reel_n_1': 0.0,
'cumul_retenue_source_n_1': 0.0,
}
else:
value = {'assiette_irpp_anuel_reel_n_1': 1,
'irpp_reel_n_1': 1,
'cumul_brut_imp_reel_n_1': 1,
'cumul_retenue_source_n_1': 1,
}

but i got an error (

   if tools['int'](payslip.date_from[5:7])==1:
TypeError: 'module' object has no attribute '__getitem__'

) and i didnt know how to resolve it. please help

Avatar
Opusti
Best Answer

if payslip and payslip.date_from and isinstance(payslip.date_from[5:7], int)  == 1:

perhaps :

from openert import tools

......

if payslip and payslip.date_from and tools['int'](payslip.date_from[5:7])==1:

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
4
okt. 16
31062
1
sep. 15
3770
0
apr. 15
584
2
apr. 15
737
0
apr. 15
560