跳至内容
菜单
此问题已终结
1 回复
200 查看

I have tried this code


def _get_numbers(self, cr, uid, ids, field_name, arg, context=None):

res = {}

for record in self.browse(cr, uid, ids, context=context):

res[record.id] = record.employee_id

return res




and my field :

'matricules': fields.function(_get_numbers, method=True, string='Total',type='integer'),

But i have got this error TypeError: float() argument must be a string or a number

Please help

形象
丢弃
最佳答案

Hi,

I am just assuming that you need to change as like below.

res[record.id] = record.employee_id.id instead of res[record.id] = record.employee_id 

I hope it will resolve your issue. 

Note : To get perfect result you have to give us full code with full error log.

形象
丢弃
相关帖文 回复 查看 活动
4
10月 16
31109
1
9月 15
3805
1
6月 15
785
0
4月 15
613
2
4月 15
782