تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4978 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب

Thanks ayman

المنشورات ذات الصلة الردود أدوات العرض النشاط
5
مايو 22
25583
0
فبراير 18
5006
2
سبتمبر 23
12493
1
يوليو 20
3252
2
سبتمبر 19
18484