HI,
i have 2 states in my form view statusbar, Draft and Sent. default state is draft. when i click save button ( in form view), the status should change into Sent. How i do this ? please help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
HI,
i have 2 states in my form view statusbar, Draft and Sent. default state is draft. when i click save button ( in form view), the status should change into Sent. How i do this ? please help
Hi,
You can override the create method or write method and change the state to the required state.
please refer this
@api.model
def create(self,vals):
vals['state'] = 'sent'
return super(ClassName, self).create(vals)
@api.multi
def write(self,vals):
vals['state'] = 'sent'
return super(ClassName, self).write(vals)
Thanks
thanks
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
RekisteröidyAiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
---|---|---|---|---|
|
1
maalisk. 21
|
6205 | ||
|
1
helmik. 21
|
3631 | ||
|
3
tammik. 20
|
8241 | ||
|
0
huhtik. 19
|
2416 | ||
|
1
maalisk. 19
|
4705 |