Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4937 Widoki

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'?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thanks ayman

Powiązane posty Odpowiedzi Widoki Czynność
5
maj 22
25540
0
lut 18
4967
2
wrz 23
12442
1
lip 20
3208
2
wrz 19
18445