Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
5
Odpowiedzi
2652
Widoki
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
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
kwi 24
|
1794 | ||
|
0
gru 19
|
4494 | ||
|
5
gru 19
|
3578 | ||
|
0
sie 19
|
4 | ||
|
1
lut 19
|
6815 |
@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.