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

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
6270
1
فبراير 21
3655
3
يناير 20
8295
0
أبريل 19
2456
1
مارس 19
4773