mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Minor usability improvements in mandate menu and views Refresh partner_id field on mandate in the on_change of partner_bank_id
22 lines
748 B
Python
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)
|