Files
bank-payment/account_direct_debit/model/account_payment.py
Alexis de Lattre 56a6652e0e Remove fields_view_get() on payment.order because dynamic domain is now possible and I implemented it in a previous commit.
Minor usability improvements in mandate menu and views
Refresh partner_id field on mandate in the on_change of partner_bank_id
2013-11-21 00:24:56 +01:00

22 lines
748 B
Python

# -*- coding: utf-8 -*-
from openerp.osv import orm, fields
import netsvc
from tools.translate import _
class payment_order(orm.Model):
_inherit = 'payment.order'
def test_undo_done(self, cr, uid, ids, context=None):
"""
Called from the workflow. Used to unset done state on
payment orders that were reconciled with bank transfers
which are being cancelled
"""
for order in self.browse(cr, uid, ids, context=context):
if order.payment_order_type == 'debit':
for line in order.line_ids:
if line.storno:
return False
return super(payment_order, self).test_undo_done(
cr, uid, ids, context=context)