Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4861 Vistas

in my custom model i create a status field

I use a cancel button to change status to cancelled.

def cancel_status(self):

        self.write({'last_status': self.status})

        self.write({'status': 'cancel'})

        return True

I used a last_status field to write which is last status

My problem is when cancel button is clicked last status updated but it shows like this

How to display Await Approval instead of 'await_approval'?

Avatar
Descartar
Mejor respuesta

Dear acha aslam:


try to use if condition before you write the status on Last Status Field. like this:

def cancel_status(self):

        if self.status == 'await_approval':

                self.write({'last_status': 'Await Approval'})

        self.write({'status': 'cancel'})

        return True


I hope I helped you...

Avatar
Descartar
Autor

Thanks ayman

Publicaciones relacionadas Respuestas Vistas Actividad
5
may 22
25429
0
feb 18
4863
2
sept 23
12311
1
jul 20
3089
2
sept 19
18338