[IMP] Imrpove marketing campaigns

bzr revid: fp@tinyerp.com-20100611075145-r9num41vzz9s3lws
This commit is contained in:
Fabien Pinckaers
2010-06-11 09:51:45 +02:00
parent 82a2aba935
commit d5f4d00622
2 changed files with 9 additions and 2 deletions
@@ -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>