[IMP] refactoring in order to use direct debit independently of bank statement import

In a nutshell, this commit 
- moves payment_order_type (payment|debit) to account_banking_payment_export
- makes payment_order_type visible in account_direct_debit
- make direct_debit depend on account_banking_payment_export
This commit is contained in:
Stéphane Bidoul
2014-02-16 17:13:15 +01:00
parent 9ca27914c3
commit e2be1a6e0d
17 changed files with 232 additions and 259 deletions

View File

@@ -87,7 +87,7 @@ class account_move_line(orm.Model):
return [('id', '=', '0')]
return [('id', 'in', map(lambda x:x[0], res))]
def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):
def line2bank(self, cr, uid, ids, payment_mode_id, context=None):
'''I have to inherit this function for direct debits to fix the
following issue : if the customer invoice has a value for
'partner_bank_id', then it will take this partner_bank_id
@@ -98,8 +98,6 @@ class account_move_line(orm.Model):
if context is None:
context = {}
pay_mode_obj = self.pool['payment.mode']
payment_mode_id = (
payment_mode_id or context.get('_fix_payment_mode_id'))
if payment_mode_id:
pay_mode = pay_mode_obj.browse(
cr, uid, payment_mode_id, context=context)
@@ -116,7 +114,7 @@ class account_move_line(orm.Model):
break
return line2bank
return super(account_move_line, self).line2bank(
cr, uid, ids, payment_mode_id=payment_mode_id, context=context)
cr, uid, ids, payment_mode_id, context=context)
_columns = {
'amount_to_receive': fields.function(