1
# -*- coding: utf-8 -*-
2
from openerp.osv import orm, fields
4
from tools.translate import _
6
class payment_order(orm.Model):
7
_inherit = 'payment.order'
9
def test_undo_done(self, cr, uid, ids, context=None):
11
Called from the workflow. Used to unset done state on
12
payment orders that were reconciled with bank transfers
13
which are being cancelled
15
for order in self.browse(cr, uid, ids, context=context):
16
if order.type == 'receivable':
17
for line in order.line_ids:
20
return super(payment_order, self).test_undo_done(
21
cr, uid, ids, context=context)