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ờ
5
Trả lời
2671
Lượt xem
Hi,
You can override the create method, and you can update the values inside the vals variable and pass it.
@api.model
def create(self, vals):
# update vals as per the need and pass
result = super(ClassName, self).create(vals)
return result
Thanks
@Niyas Raphy thank you soo much for your help its solve my issue .... (y)
Hi Usman,
Use res instead of self and also you need to pass some context to avoid recurrent calling
By Using Following Code
if not res._context.get('block_call'):
You need to define your code insideWhile Calling Custom Create send Context like below codeself.with_context(block_call=True).create(values)
Thanks
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
|
1804 | ||
|
0
thg 12 19
|
4508 | ||
|
5
thg 12 19
|
3588 | ||
|
0
thg 8 19
|
4 | ||
|
1
thg 2 19
|
6830 |
@Niyas Rephy yes
Please provide more description of what do you want to do
Hi, you are calling same create method inside the create method.