Skip to Content
Menu
This question has been flagged
1 Reply
3786 Views

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
Discard
Best Answer

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
Discard
Author

Thanks ayman

Related Posts Replies Views Activity
5
May 22
23456
0
Feb 18
3843
2
Sep 23
10431
1
Jul 20
2293
2
Sep 19
17204