[IMP] Imrpove marketing campaigns
bzr revid: fp@tinyerp.com-20100611075145-r9num41vzz9s3lws
This commit is contained in:
@@ -412,8 +412,14 @@ class marketing_campaign_workitem(osv.osv):
|
||||
self.create(cr, uid, workitem_vals)
|
||||
return True
|
||||
|
||||
def button_draft(self, cr, uid, workitem_ids, context={}):
|
||||
for wi in self.browse(cr, uid, workitem_ids, context=context):
|
||||
if wi.state=='exception':
|
||||
self.write(cr, uid, [wi.id], {'state':'todo'}, context=context)
|
||||
return True
|
||||
|
||||
def button_cancel(self, cr, uid, workitem_ids, context={}):
|
||||
for wi in self.browse(cr, uid, workitem_ids):
|
||||
for wi in self.browse(cr, uid, workitem_ids, context=context):
|
||||
if wi.state in ('todo','exception'):
|
||||
self.write(cr, uid, [wi.id], {'state':'cancelled'}, context=context)
|
||||
return True
|
||||
|
||||
@@ -404,8 +404,9 @@
|
||||
<separator string="Status" colspan="4"/>
|
||||
<group colspan="4" col="11">
|
||||
<field name="state" nolabel="1" readonly="True" select="1"/>
|
||||
<button string="Retry" states="exception" name="button_draft" type="object" icon="gtk-ok"/>
|
||||
<button string="Process" states="todo" name="process" type="object" icon="gtk-ok"/>
|
||||
<button string="Cancel" states="todo" name="button_cancel" type="object" icon="gtk-cancel"/>
|
||||
<button string="Cancel" states="todo,exception" name="button_cancel" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user