37
37
<field name="filter_cond"/>
38
38
<separator string="Choose objects to record" colspan="4"/>
39
39
<field name="objects" colspan="4" nolabel="1"/>
40
<group><field name="info_yaml"/></group>
43
43
intro_start_fields = {
44
44
'check_date': {'string':"Record from Date",'type':'datetime','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S')},
45
45
'objects':{'string': 'Objects', 'type': 'many2many', 'relation': 'ir.model', 'help': 'List of objects to be recorded'},
46
46
'filter_cond':{'string':'Records only', 'type':'selection','selection':[('created','Created'),('modified','Modified'),('created_modified','Created & Modified')], 'required':True, 'default': lambda *args:'created'},
47
'info_yaml': {'string':'YAML','type':'boolean'}
50
50
exp_form = '''<?xml version="1.0"?>
99
99
search_ids=obj_pool.search(cr,uid,search_condition)
100
100
for s_id in search_ids:
101
args=(cr.dbname,uid,user,obj_name,'copy',s_id,{},context)
101
args=(cr.dbname,uid,obj_name,'copy',s_id,{},context)
102
102
mod.recording_data.append(('query',args, {}, s_id))
105
def _check(self, cr, uid, data, context):
106
pool = pooler.get_pool(cr.dbname)
107
mod = pool.get('ir.module.record')
108
if len(mod.recording_data):
109
if data['form']['info_yaml']:
105
116
def _create_xml(self, cr, uid, data, context):
106
117
pool = pooler.get_pool(cr.dbname)
107
118
mod = pool.get('ir.module.record')
108
119
res_xml = mod.generate_xml(cr, uid)
109
120
return { 'res_text': res_xml }
122
def _create_yaml(self,cr,uid,data,context):
123
pool = pooler.get_pool(cr.dbname)
124
mod = pool.get('ir.module.record')
125
res_xml = mod.generate_yaml(cr, uid)
126
return { 'res_text': res_xml }
111
128
class base_module_record_objects(wizard.interface):
127
'result': {'type':'action','action':_record_objects,'state':'intro'}
144
'result': {'type':'action','action':_record_objects,'state':'check'}
148
'result': {'type':'choice','next_state':_check}
130
151
'actions': [ _create_xml ],
136
157
('end', 'End', 'gtk-cancel'),
162
'actions': [ _create_yaml ],
168
('end', 'End', 'gtk-cancel'),
142
174
'result': {'type':'form', 'arch':info, 'fields':{}, 'state':[('end','OK')]}