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

The field "credit_limit" in res.partner object does not save its value in DB after i set it !!!

any ideas about this please!

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

it's a field of type float.

'credit_limit': fields.float('Credit limit'),

Ảnh đại diện
Huỷ bỏ
Tác giả

Solved: The field was declared twice in the the same xml form. it has to be unique per record to store values in DB

Câu trả lời hay nhất

I just had the same problem and lost an hour trying to figure it out.

You should NOT use twice the same field in the same form. We wanted to move a field from one page of a notebook to another. To avoid potential xpath errors it was not replaced from its original place, but only made invisible. And we added it on the page we wanted..

It means that the invisible field was correctly set, but not rendered. When editing the second field, it looked like it was working (field was set, even after clicking on save), but when reloading the page, it disappeared.

Not hard to fix, but a bit confusing to understand why that single field couldnt be edited :)    


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

in odoo v8 the problem sould be resolved with (if credit_limit is an computed field):

credit_limit = fields.xxx(store=True)


Ảnh đại diện
Huỷ bỏ