~santiago-pexego/sepa-tools/make_payments_6.1

« back to all changes in this revision

Viewing changes to account_payment_direct_debit/model/account_payment.py

  • Committer: Ignacio Ibeas - Acysos S.L.
  • Date: 2014-02-09 15:05:50 UTC
  • Revision ID: ignacio@acysos.com-20140209150550-uug8yon3vcuh3rlj
[ADD] New SEPA modules for account_payment_extension

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
from openerp.osv import orm, fields
 
3
import netsvc
 
4
from tools.translate import _
 
5
 
 
6
class payment_order(orm.Model):
 
7
    _inherit = 'payment.order'
 
8
 
 
9
    def test_undo_done(self, cr, uid, ids, context=None):
 
10
        """ 
 
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 
 
14
        """
 
15
        for order in self.browse(cr, uid, ids, context=context):
 
16
            if order.type == 'receivable':
 
17
                for line in order.line_ids:
 
18
                    if line.storno:
 
19
                        return False
 
20
        return super(payment_order, self).test_undo_done(
 
21
            cr, uid, ids, context=context)