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

Hi!!!

Please i want to get a field from a table and i have tried this but it doesnt work. Please help me:

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

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

Guess you are getting an error because you are trying to pass the browse record, instead of just ID ..

Try this way

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

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

It doesnt work. I got this

Error: AttributeError: 'NoneType' object has no attribute 'browse'

Ả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
31279
1
thg 9 15
3941
1
thg 6 15
853
0
thg 4 15
691
2
thg 4 15
877