Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
5 Respostas
2656 Visualizações

what i'm doing is

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

Code Preview

Avatar
Cancelar
Autor

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

Melhor resposta

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

Avatar
Cancelar
Autor

@Niyas Raphy thank you soo much for your help its solve my issue .... (y)

Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
abr. 24
1800
0
dez. 19
4506
5
dez. 19
3583
0
ago. 19
4
1
fev. 19
6823