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

Hi all,

I would need to modify the Save button effect so that it:

- saves current record as usual

- launches a wizard

I overrided the write function as follows:

--------------------------------------

@api.multi

def write(self, vals):

print vals

if vals.get('start_time', False) or vals.get('duration', False):

vals['end_time'] = (

vals.get('start_time', False) or self.start_time or 0) +\

(vals.get('duration', False) or self.duration or 0)

super(ShiftTemplate, self).write(vals)

view = self.env['ir.model.data'].get_object_reference(

'coop_shift', 'view_update_shifts_form')

view_id = view and view[1] or False

return {

'type': 'ir.actions.act_window',

'res_model': 'update.shifts.wizard',

'view_mode': 'form',

'view_type': 'form',

'res_id': self.id,

'views': [(view_id, 'form')],

'view_id': [view_id],

'target': 'new',

'nodestroy': True,

}

---------------------------------------------

But this dosn't work: the save button just saves current record and doesn't launch my wizard.

Any idea?

Thanks.

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

same here, any solution?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 16
5740
4
نوفمبر 24
13262
2
أغسطس 22
8884
1
أبريل 24
4184
2
سبتمبر 19
18610