-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwizard_state_poweremail.py
More file actions
33 lines (23 loc) · 1.01 KB
/
wizard_state_poweremail.py
File metadata and controls
33 lines (23 loc) · 1.01 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.state.email'
def _state_selection(self, cursor, uid, context=None):
pwmb_obj = self.pool.get('poweremail.mailbox')
states = pwmb_obj.fields_get(cursor, uid, context=context)['state']['selection']
return states
def action_change_state_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])
pm_camp_obj.write(cursor, uid, active_ids, {'state': wizard.estat}, context=context)
wizard.write({'wiz_state': 'end'})
_columns = {
'estat': fields.selection(_state_selection, 'Estat', required=True),
'wiz_state': fields.selection([('init', 'Init'), ('end', 'End')], 'State'),
}
_defaults = {
'estat': lambda *a: 'read',
'wiz_state': lambda *a: 'init',
}
WizardPoweremail()