Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
5
ตอบกลับ
2340
มุมมอง
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
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
0
เม.ย. 24
|
1415 | ||
|
0
ธ.ค. 19
|
4133 | ||
|
5
ธ.ค. 19
|
3050 | ||
|
0
ส.ค. 19
|
4 | ||
|
1
ก.พ. 19
|
6485 |
@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.