Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
263 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 16
31235
1
thg 9 15
3912
1
thg 6 15
832
0
thg 4 15
674
2
thg 4 15
850