Hi, i would like to put 2 on_changes functions in the same field, and i don't know how to define it in the xml view. 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ờ
If you need them for math computation try this
@api.onchange('field1', field2')
def onchange_name_of_onchange(self):
if self.field1 or self.field2:
self.fieldresult = self.field1 * self.field2
+1 Odoo Honduras, thanks
you can't do it using xml, you need to do it using the new api style for onchange, like:
@api.onchange('marital_status')
def onchange_m(self):
self.sex = 'm'
@api.onchange('marital_status')
def onchange_f(self):
self.sex = 'f'
There is no way to do it, but there is no need to do 2 onchanges, you can do it once, and return more values, it depends on what you are trying to do.
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 | |
---|---|---|---|---|
|
1
thg 10 23
|
2049 | ||
|
2
thg 10 23
|
2294 | ||
|
2
thg 8 23
|
4305 | ||
|
4
thg 8 23
|
20625 | ||
|
3
thg 10 22
|
11086 |