Good afternoon, I'm having a problem with a one2many field in Odoo 15, I have two models hr.vacas.new and 'hr.vacas.new.fechas' , 'hr.vacas.new' has a computed field with a @api.depends decorator and has a value of 12 called 'x_dias_restantes'.
I have a one2many field called 'x_fechas' related to 'hr.vacas.new.fechas', when I modify the field, the value of 'x_dias_restantes' is modified.
Basically my problem is when I modify the one2many field, his write method is called, the write method check the value of 'x_dias_restantes', but when I introduce just one record, the value is 12 (correct), but if I introduce more than 1 record, the value is 0 always, and I don't know why, doesn't matter what values I introduce in the form, if there is more than one record in the one2many field, the value of 'x_dias_restantes' is 0 and should be 12.
If I introduce the data one by one, I mean, I add one record, press "save" and again and again, the value is correct, but if I introduce more than one at the same time, the value is 0.
Anyone could help me? Thanks!!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
2420
Lượt xem
It could be that the one2many field write method is not correctly summing up all the values of the records and thus giving you the wrong result. Try debugging the code to identify the cause.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 4 24
|
1645 | ||
|
3
thg 5 23
|
3324 | ||
Get the values of one2many field
Đã xử lý
|
|
1
thg 6 22
|
2386 | |
|
1
thg 6 22
|
1520 | ||
|
1
thg 5 22
|
3022 |
PLease , show us picture for more understanding !
Thanks !