-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwizard_poweremail.py
More file actions
33 lines (23 loc) · 1.04 KB
/
wizard_poweremail.py
File metadata and controls
33 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from osv import osv, fields
class WizardPoweremail(osv.osv_memory):
_name = 'wizard.change.folder.email'
def _folder_selection(self, cursor, uid, context=None):
pwmb_obj = self.pool.get('poweremail.mailbox')
states = pwmb_obj.fields_get(cursor, uid, context=context)['folder']['selection']
return states
def action_change_folder_email_form(self, cursor, uid, ids, context=None):
active_ids = context['active_ids']
pm_camp_obj = self.pool.get('poweremail.mailbox')
wizard = self.browse(cursor, uid, ids[0], context=context)
pm_camp_obj.write(cursor, uid, active_ids, {'folder': wizard.folder}, context=context)
wizard.write({'state': 'end'}, context=context)
_columns = {
'folder': fields.selection(_folder_selection, 'Folder', required=True),
'state': fields.selection([('init', 'Init'), ('end', 'End')], 'State'),
}
_defaults = {
'folder': lambda *a: 'drafts',
'state': lambda *a: 'init',
}
WizardPoweremail()