콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5 답글
2752 화면

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
1900
0
12월 19
4608
5
12월 19
3686
0
8월 19
4
1
2월 19
6918