コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
2529 ビュー

what i'm doing is

i want to create same line before new line created with some changes 

Code Preview

アバター
破棄
著作者

@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.

最善の回答

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 inside
While Calling Custom Create send Context like below code
self.with_context(block_call=True).create(values)

Thanks

アバター
破棄
関連投稿 返信 ビュー 活動
0
4月 24
1640
0
12月 19
4358
5
12月 19
3415
0
8月 19
4
1
2月 19
6664