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

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 21
6431
1
فبراير 21
3770
3
يناير 20
8481
0
أبريل 19
2514
1
مارس 19
4922