1
# -*- encoding: utf-8 -*-
7
segment_form = """<?xml version="1.0" ?>
8
<form string="Duplication Of Proposition">
9
<field name="keep_segments"/>
13
'keep_segments':{'string':'Keep Segments At Duplication', 'type':'boolean','default': lambda *a:True},
16
def _copy_prp(self, cr, uid, data, context):
18
pool = pooler.get_pool(cr.dbname)
19
prp_id = pool.get('dm.campaign.proposition').copy(cr, uid, prop_id, context=context)
20
datas = pool.get('dm.campaign.proposition').browse(cr, uid, prp_id, context)
21
seg = data['form']['keep_segments']
25
for i in datas.segment_ids:
27
pool.get('dm.campaign.proposition.segment').unlink(cr,uid,l)
28
return {'PRP_ID':prp_id}
29
return {'PRP_ID':prp_id}
31
class wizard_prop_copy(wizard.interface):
35
'result': {'type':'form', 'arch':segment_form, 'fields':segment_fields, 'state': [('end', 'Cancel'), ('copy', 'Duplicate')]},
39
'result': {'type': 'action', 'action':_copy_prp, 'state':'end'}
42
wizard_prop_copy("wizard_prop_copy")
43
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
b'\\ No newline at end of file'