Hello all,
I'm searching the purpose of multi='all' in this python code...
_columns = {
'amount_tax': fields.function(_amount_all_pt, string='Taxes', digits_compute=dp.get_precision('Account'), multi='all'),
}
Could you help please?
Thanks!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello all,
I'm searching the purpose of multi='all' in this python code...
_columns = {
'amount_tax': fields.function(_amount_all_pt, string='Taxes', digits_compute=dp.get_precision('Account'), multi='all'),
}
Thanks!
Hi @Pascal
The multi parameter in the field function definition it's related to use the same method to return the value of many function fields. It's only used in the old api and not needed in the new api. It's a matter of performance to call the function only one time for all the function fields with the same multi value and when used the function return value it's different to be able to return all the values of the fields using a dict for every id in the list
note: value of multi (here is "all") does not matter, it may be any string. it is matter which fields are using a same value of multi, as fields with same value of multi are calculated together as explained above (in this case, all fields having multi="all" are calculated together, but any string may be used instead of "all").
Great! Thanks all!
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 | |
---|---|---|---|---|
|
2
thg 9 24
|
1493 | ||
|
1
thg 3 15
|
7128 | ||
|
1
thg 3 15
|
4294 | ||
|
2
thg 3 15
|
8149 | ||
|
0
thg 3 25
|
1294 |