← Back to team overview

banking-addons-team team mailing list archive

lp:~acsone-openerp/banking-addons/ba-70-payment-export-refactoring into lp:banking-addons/banking-addons-70

 

Stéphane Bidoul (Acsone) has proposed merging lp:~acsone-openerp/banking-addons/ba-70-payment-export-refactoring into lp:banking-addons/banking-addons-70.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~acsone-openerp/banking-addons/ba-70-payment-export-refactoring/+merge/179543

Refactoring of account_banking_payment into 
- account_banking_payment_export (export wizard hook, payment mode types, suitable bank types, etc)
- and account_banking_payment (workflow with sent state, transfer accounts, reconciliation, etc)

This allows using payment export (such as sepa credit transfer) independently of bank statement imports. 
Account_payment_export does not depend on account_banking anymore, while remaining 100% compatible: when account_banking_payment is installed, the advanced worflow and reconciliation features are added.

Compatibility notes. In order to break the dependency on account_banking, the following minor changes were necessary
- the external id of manual_bank_tranfer payment mode type has changed
- the "Generated SEPA Credit Transfer files" moved to the Payment Orders menu
- manual and sepa credit transfers send the "done" signal when they are finished (instead of "sent") to remain compatible with the default workflow (however the advanced workflow in account_banking_payment supports both done and sent signals to transition from act_open to act_sent)


-- 
https://code.launchpad.net/~acsone-openerp/banking-addons/ba-70-payment-export-refactoring/+merge/179543
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~acsone-openerp/banking-addons/ba-70-payment-export-refactoring into lp:banking-addons/banking-addons-70.
=== modified file 'account_banking_payment/__openerp__.py'
--- account_banking_payment/__openerp__.py	2013-05-28 15:18:26 +0000
+++ account_banking_payment/__openerp__.py	2013-08-09 21:20:13 +0000
@@ -32,17 +32,13 @@
     'category': 'Banking addons',
     'depends': [
         'account_banking',
-        'account_payment',
+        'account_banking_payment_export',
         ],
     'data': [
         'view/account_payment.xml',
         'view/banking_transaction_wizard.xml',
         'view/payment_mode.xml',
-        'view/payment_mode_type.xml',
-        'view/bank_payment_manual.xml',
-        'data/payment_mode_type.xml',
         'workflow/account_payment.xml',
-        'security/ir.model.access.csv',
     ],
     'description': '''
     This addon adds payment infrastructure to the Banking Addons.

=== removed directory 'account_banking_payment/data'
=== removed file 'account_banking_payment/data/payment_mode_type.xml'
--- account_banking_payment/data/payment_mode_type.xml	2013-03-17 12:53:37 +0000
+++ account_banking_payment/data/payment_mode_type.xml	1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <!-- Add manual bank transfer as default payment option -->
-        <record model="payment.mode.type" id="account_banking.manual_bank_tranfer">
-            <field name="name">Manual Bank Transfer</field>
-            <field name="code">BANKMAN</field>
-            <field name="suitable_bank_types"
-                eval="[(6,0,[ref('base.bank_normal'),ref('base_iban.bank_iban'),])]" />
-            <field name="ir_model_id"
-                   ref="account_banking_payment.model_payment_manual"/>
-        </record>
-    </data>
-</openerp>

=== modified file 'account_banking_payment/model/__init__.py'
--- account_banking_payment/model/__init__.py	2013-05-30 10:03:41 +0000
+++ account_banking_payment/model/__init__.py	2013-08-09 21:20:13 +0000
@@ -1,9 +1,6 @@
 import account_payment
 import payment_line
 import payment_mode
-import payment_mode_type
-import payment_order_create
 import banking_import_transaction
 import banking_transaction_wizard
-import bank_payment_manual
 import banking_import_line

=== modified file 'account_banking_payment/model/account_payment.py'
--- account_banking_payment/model/account_payment.py	2013-07-15 13:31:34 +0000
+++ account_banking_payment/model/account_payment.py	2013-08-09 21:20:13 +0000
@@ -115,49 +115,6 @@
         'payment_order_type': 'payment',
         }
 
-    def launch_wizard(self, cr, uid, ids, context=None):
-        """
-        Search for a wizard to launch according to the type.
-        If type is manual. just confirm the order.
-        Previously (pre-v6) in account_payment/wizard/wizard_pay.py
-        """
-        if context == None:
-            context = {}
-        result = {}
-        orders = self.browse(cr, uid, ids, context)
-        order = orders[0]
-        # check if a wizard is defined for the first order
-        if order.mode.type and order.mode.type.ir_model_id:
-            context['active_ids'] = ids
-            wizard_model = order.mode.type.ir_model_id.model
-            wizard_obj = self.pool.get(wizard_model)
-            wizard_id = wizard_obj.create(cr, uid, {}, context)
-            result = {
-                'name': wizard_obj._description or _('Payment Order Export'),
-                'view_type': 'form',
-                'view_mode': 'form',
-                'res_model': wizard_model,
-                'domain': [],
-                'context': context,
-                'type': 'ir.actions.act_window',
-                'target': 'new',
-                'res_id': wizard_id,
-                'nodestroy': True,
-                }
-        else:
-            # should all be manual orders without type or wizard model
-            for order in orders[1:]:
-                if order.mode.type and order.mode.type.ir_model_id:
-                    raise orm.except_orm(
-                        _('Error'),
-                        _('You can only combine payment orders of the same type')
-                        )
-            # process manual payments
-            wf_service = netsvc.LocalService('workflow')
-            for order_id in ids:
-                wf_service.trg_validate(uid, 'payment.order', order_id, 'sent', cr)
-        return result
-
     def _write_payment_lines(self, cr, uid, ids, **kwargs):
         '''
         ORM method for setting attributes of corresponding payment.line objects.
@@ -287,6 +244,7 @@
             for line in order.line_ids:
                 # basic checks
                 if not line.move_line_id:
+                    continue
                     raise orm.except_orm(
                         _('Error'),
                         _('No move line provided for line %s') % line.name)

=== removed file 'account_banking_payment/model/bank_payment_manual.py'
--- account_banking_payment/model/bank_payment_manual.py	2013-03-17 20:03:32 +0000
+++ account_banking_payment/model/bank_payment_manual.py	1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
-#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
-#            
-#    All other contributions are (C) by their respective contributors
-#
-#    All Rights Reserved
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-'''
-This module contains a single "wizard" for including a 'sent' state for manual
-bank transfers.
-'''
-
-from openerp.osv import orm, fields
-from openerp import netsvc
-
-
-class payment_manual(orm.TransientModel):
-    _name = 'payment.manual'
-    _description = 'Set payment orders to \'sent\' manually'
-
-    def default_get(self, cr, uid, fields_list, context=None):
-        if context and context.get('active_ids'):
-            payment_order_obj = self.pool.get('payment.order')
-            wf_service = netsvc.LocalService('workflow')
-            for order_id in context['active_ids']:
-                wf_service.trg_validate(
-                    uid, 'payment.order', order_id, 'sent', cr)
-        return super(payment_manual, self).default_get(
-            cr, uid, fields_list, context=None)
-
-    _columns = {
-        # dummy field, to trigger a call to default_get
-        'name': fields.char('Name', size=1),
-        }
-

=== modified file 'account_banking_payment/model/payment_mode.py'
--- account_banking_payment/model/payment_mode.py	2013-05-29 12:35:04 +0000
+++ account_banking_payment/model/payment_mode.py	2013-08-09 21:20:13 +0000
@@ -27,28 +27,9 @@
 
 
 class payment_mode(orm.Model):
-    ''' Restoring the payment type from version 5,
-    used to select the export wizard (if any) '''
     _inherit = "payment.mode"
 
-    def suitable_bank_types(self, cr, uid, payment_mode_id=None, context=None):
-        """ Reinstates functional code for suitable bank type filtering.
-        Current code in account_payment is disfunctional.
-        """
-        res = []
-        payment_mode = self.browse(
-            cr, uid, payment_mode_id, context)
-        if (payment_mode and payment_mode.type and
-            payment_mode.type.suitable_bank_types):
-            res = [type.code for type in payment_mode.type.suitable_bank_types]
-        return res
-
     _columns = {
-        'type': fields.many2one(
-            'payment.mode.type', 'Payment type',
-            required=True,
-            help='Select the Payment Type for the Payment Mode.'
-            ),
         'transfer_account_id': fields.many2one(
             'account.account', 'Transfer account',
             domain=[('type', '=', 'other'),
@@ -63,10 +44,4 @@
             help=('Journal to write payment entries when confirming '
                   'a debit order of this mode'),
             ),
-        'payment_term_ids': fields.many2many(
-            'account.payment.term', 'account_payment_order_terms_rel', 
-            'mode_id', 'term_id', 'Payment terms',
-            help=('Limit selected invoices to invoices with these payment '
-                  'terms')
-            ),
         }

=== removed file 'account_banking_payment/model/payment_mode_type.py'
--- account_banking_payment/model/payment_mode_type.py	2013-03-17 09:10:15 +0000
+++ account_banking_payment/model/payment_mode_type.py	1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
-#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
-#            
-#    All other contributions are (C) by their respective contributors
-#
-#    All Rights Reserved
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from openerp.osv import orm, fields
-
-
-class payment_mode_type(orm.Model):
-    _name = 'payment.mode.type'
-    _description = 'Payment Mode Type'
-    _columns = {
-        'name': fields.char(
-            'Name', size=64, required=True,
-            help='Payment Type'
-            ),
-        'code': fields.char(
-            'Code', size=64, required=True,
-            help='Specify the Code for Payment Type'
-            ),
-        # Setting suitable_bank_types to required pending
-        # https://bugs.launchpad.net/openobject-addons/+bug/786845
-        'suitable_bank_types': fields.many2many(
-            'res.partner.bank.type',
-            'bank_type_payment_type_rel',
-            'pay_type_id','bank_type_id',
-            'Suitable bank types', required=True),
-        'ir_model_id': fields.many2one(
-            'ir.model', 'Payment wizard',
-            help=('Select the Payment Wizard for payments of this type. '
-                  'Leave empty for manual processing'),
-            domain=[('osv_memory', '=', True)],
-            ),
-        'payment_order_type': fields.selection(
-            [('payment', 'Payment'),('debit', 'Direct debit')],
-            'Payment order type', required=True,
-            ),
-    }
-
-    _defaults = {
-        'payment_order_type': 'payment',
-        }

=== removed file 'account_banking_payment/model/payment_order_create.py'
--- account_banking_payment/model/payment_order_create.py	2013-06-26 21:14:41 +0000
+++ account_banking_payment/model/payment_order_create.py	1970-01-01 00:00:00 +0000
@@ -1,199 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
-#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
-#            
-#    All other contributions are (C) by their respective contributors
-#
-#    All Rights Reserved
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from datetime import datetime
-from openerp.osv import orm, fields
-from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
-from openerp.tools.translate import _
-
-
-class payment_order_create(orm.TransientModel):
-    _inherit = 'payment.order.create'
-
-    def extend_payment_order_domain(
-            self, cr, uid, payment_order, domain, context=None):
-        if payment_order.payment_order_type == 'payment':
-            domain += [
-                ('account_id.type', '=', 'payable'),
-                ('amount_to_pay', '>', 0)
-                ]
-        return True
-
-    def search_entries(self, cr, uid, ids, context=None):
-        """
-        This method taken from account_payment module.
-        We adapt the domain based on the payment_order_type
-        """
-        line_obj = self.pool.get('account.move.line')
-        mod_obj = self.pool.get('ir.model.data')
-        if context is None:
-            context = {}
-        data = self.read(cr, uid, ids, ['duedate'], context=context)[0]
-        search_due_date = data['duedate']
-        
-        ### start account_banking_payment ###
-        payment = self.pool.get('payment.order').browse(
-            cr, uid, context['active_id'], context=context)
-        # Search for move line to pay:
-        domain = [
-            ('move_id.state', '=', 'posted'),
-            ('reconcile_id', '=', False),
-            ('company_id', '=', payment.mode.company_id.id),
-            ]
-        # apply payment term filter
-        if payment.mode.payment_term_ids:
-            domain += [
-                ('invoice.payment_term', 'in', 
-                 [term.id for term in payment.mode.payment_term_ids]
-                 )
-                ]
-        self.extend_payment_order_domain(
-            cr, uid, payment, domain, context=context)
-        ### end account_direct_debit ###
-
-        domain = domain + [
-            '|', ('date_maturity', '<=', search_due_date),
-            ('date_maturity', '=', False)
-            ]
-        line_ids = line_obj.search(cr, uid, domain, context=context)
-        context.update({'line_ids': line_ids})
-        model_data_ids = mod_obj.search(
-            cr, uid,[
-                ('model', '=', 'ir.ui.view'),
-                ('name', '=', 'view_create_payment_order_lines')],
-            context=context)
-        resource_id = mod_obj.read(
-            cr, uid, model_data_ids, fields=['res_id'],
-            context=context)[0]['res_id']
-        return {'name': _('Entry Lines'),
-                'context': context,
-                'view_type': 'form',
-                'view_mode': 'form',
-                'res_model': 'payment.order.create',
-                'views': [(resource_id, 'form')],
-                'type': 'ir.actions.act_window',
-                'target': 'new',
-        }
-
-    def create_payment(self, cr, uid, ids, context=None):
-        '''
-        This method is a slightly modified version of the existing method on this
-        model in account_payment.
-        - pass the payment mode to line2bank()
-        - allow invoices to create influence on the payment process: not only 'Free'
-        references are allowed, but others as well
-        - check date_to_pay is not in the past.
-        '''
-
-        order_obj = self.pool.get('payment.order')
-        line_obj = self.pool.get('account.move.line')
-        payment_obj = self.pool.get('payment.line')
-        if context is None:
-            context = {}
-        data = self.read(cr, uid, ids, [], context=context)[0]
-        line_ids = data['entries']
-        if not line_ids:
-            return {'type': 'ir.actions.act_window_close'}
-
-        payment = order_obj.browse(
-            cr, uid, context['active_id'], context=context)
-        ### account banking
-        # t = None
-        # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
-        line2bank = line_obj.line2bank(
-            cr, uid, line_ids, payment.mode.id, context)
-        _today = fields.date.context_today(self, cr, uid, context=context)
-        ### end account banking
-
-        ## Finally populate the current payment with new lines:
-        for line in line_obj.browse(cr, uid, line_ids, context=context):
-            if payment.date_prefered == "now":
-                #no payment date => immediate payment
-                date_to_pay = False
-            elif payment.date_prefered == 'due':
-                ### account_banking
-                # date_to_pay = line.date_maturity
-                date_to_pay = (
-                    line.date_maturity
-                    if line.date_maturity and line.date_maturity > _today
-                    else False)
-                ### end account banking
-            elif payment.date_prefered == 'fixed':
-                ### account_banking
-                # date_to_pay = payment.date_scheduled
-                date_to_pay = (
-                    payment.date_scheduled
-                    if payment.date_scheduled and payment.date_scheduled > _today
-                    else False)
-                ### end account banking
-
-            ### account_banking
-            state = communication2 = False
-            communication = line.ref or '/'
-            if line.invoice:
-                if line.invoice.type in ('in_invoice', 'in_refund'):
-                    if line.invoice.reference_type == 'structured':
-                        state = 'structured'
-                        communication = line.invoice.reference
-                    else:
-                        state = 'normal'
-                        communication2 = line.invoice.reference
-                else:
-                    # Make sure that the communication includes the
-                    # customer invoice number (in the case of debit order)
-                    communication = line.invoice.number.replace('/', '')
-                    state = 'structured'
-                    if line.invoice.number != line.ref:
-                        communication2 = line.ref
-            else:
-                state = 'normal'
-                communication2 = line.ref
-
-            # support debit orders when enabled
-            if (payment.payment_order_type == 'debit' and
-                'amount_to_receive' in line):
-                amount_currency = line.amount_to_receive
-            else:
-                amount_currency = line.amount_to_pay
-            ### end account_banking
-
-            payment_obj.create(cr, uid, {
-                'move_line_id': line.id,
-                'amount_currency': amount_currency,
-                'bank_id': line2bank.get(line.id),
-                'order_id': payment.id,
-                'partner_id': line.partner_id and line.partner_id.id or False,
-                ### account banking
-                # 'communication': line.ref or '/'
-                'communication': communication,
-                'communication2': communication2,
-                'state': state,
-                ### end account banking
-                'date': date_to_pay,
-                'currency': (line.invoice and line.invoice.currency_id.id
-                             or line.journal_id.currency.id
-                             or line.journal_id.company_id.currency_id.id),
-                }, context=context)
-        return {'type': 'ir.actions.act_window_close'}

=== removed directory 'account_banking_payment/security'
=== removed file 'account_banking_payment/security/ir.model.access.csv'
--- account_banking_payment/security/ir.model.access.csv	2013-03-16 16:44:19 +0000
+++ account_banking_payment/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_payment_mode_type","payment.mode.type","model_payment_mode_type","account_payment.group_account_payment",1,1,1,1

=== modified file 'account_banking_payment/view/account_payment.xml'
--- account_banking_payment/view/account_payment.xml	2013-06-04 10:18:31 +0000
+++ account_banking_payment/view/account_payment.xml	2013-08-09 21:20:13 +0000
@@ -17,10 +17,6 @@
                             'invisible':[('state','!=','draft')]
                         }</attribute>
                     </xpath>
-                    <xpath expr="//button[@string='Make Payments']"
-                           position="attributes">
-                        <attribute name="name">launch_wizard</attribute>
-                    </xpath>
                     <!-- Communication only used for 'structured' communication -->
                     <xpath expr="//field[@name='line_ids']/form//field[@name='communication']"
                            position="attributes">

=== removed file 'account_banking_payment/view/bank_payment_manual.xml'
--- account_banking_payment/view/bank_payment_manual.xml	2013-05-28 15:18:26 +0000
+++ account_banking_payment/view/bank_payment_manual.xml	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record id="view_payment_manual_form" model="ir.ui.view">
-            <field name="name">Form for manual payment wizard</field>
-            <field name="model">payment.manual</field>
-            <field name="arch" type="xml">
-                <form string="Manual payment">
-                    <label string="Payment order(s) have been set to 'sent'"/>
-                    <button special="cancel" icon="gtk-ok" string="OK"/>
-                </form>
-            </field>
-        </record>
-    </data>
-</openerp>

=== modified file 'account_banking_payment/view/payment_mode.xml'
--- account_banking_payment/view/payment_mode.xml	2013-05-29 12:35:04 +0000
+++ account_banking_payment/view/payment_mode.xml	2013-08-09 21:20:13 +0000
@@ -8,10 +8,9 @@
         <record id="view_payment_mode_form_inherit" model="ir.ui.view">
             <field name="name">payment.mode.form.inherit</field>
             <field name="model">payment.mode</field>
-            <field name="inherit_id" ref="account_payment.view_payment_mode_form"/>
+            <field name="inherit_id" ref="account_banking_payment_export.view_payment_mode_form_inherit"/>
             <field name="arch" type="xml">
-                <field name="company_id" position="after">
-                    <field name="type"/>
+                <field name="type" position="after">
                     <group colspan="4" col="4">
                         <group colspan="2">
                             <separator colspan="2"
@@ -29,11 +28,6 @@
                                    domain="[('company_id', '=', company_id)]"
                                    />
                         </group>
-                        <group colspan="2">
-                            <separator colspan="2"
-                                       string="Optional filter by payment term" />
-                            <field name="payment_term_ids" nolabel="1" colspan="2"/>
-                        </group>
                     </group>
                 </field>
             </field>

=== removed file 'account_banking_payment/view/payment_mode_type.xml'
--- account_banking_payment/view/payment_mode_type.xml	2013-05-28 15:18:26 +0000
+++ account_banking_payment/view/payment_mode_type.xml	1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-
-        <record id="view_payment_mode_tree_inherit" model="ir.ui.view">
-            <field name="name">payment.mode.tree.inherit</field>
-            <field name="model">payment.mode</field>
-            <field name="inherit_id" ref="account_payment.view_payment_mode_tree"/>
-            <field name="arch" type="xml">
-                <field name="company_id" position="after">
-                    <field name="type"/>
-                </field>
-            </field>
-        </record>
-
-	<!-- basic view for payment mode type -->
-        <record model="ir.ui.view" id="view_payment_mode_type_form">
-            <field name="name">view.payment.mode.type.form</field>
-            <field name="model">payment.mode.type</field>
-            <field name="arch" type="xml">
-                <form string="Payment mode">
-		    <field name="name" />
-		    <field name="code" />
-		    <field name="suitable_bank_types"/>
-		    <field name="payment_order_type"/>
-		    <field name="ir_model_id"/>
-                </form>
-            </field>
-        </record>
-
-    </data>
-</openerp>

=== modified file 'account_banking_payment/workflow/account_payment.xml'
--- account_banking_payment/workflow/account_payment.xml	2013-05-29 22:26:36 +0000
+++ account_banking_payment/workflow/account_payment.xml	2013-08-09 21:20:13 +0000
@@ -29,6 +29,12 @@
             <field name="act_to" ref="account_banking.act_sent"/>
             <field name="signal">sent</field>
         </record>
+        <!-- the done signal continues to work but goes to sent -->
+        <record id="account_banking.trans_open_done" model="workflow.transition">
+            <field name="act_from" ref="account_payment.act_open"/>
+            <field name="act_to" ref="account_banking.act_sent"/>
+            <field name="signal">done</field>
+        </record>
         <!-- From sent straight to sent_wait -->
         <record id="account_banking.trans_sent_sent_wait" model="workflow.transition">
             <field name="act_from" ref="account_banking.act_sent"/>

=== added directory 'account_banking_payment_export'
=== added file 'account_banking_payment_export/__init__.py'
--- account_banking_payment_export/__init__.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/__init__.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,1 @@
+import model
\ No newline at end of file

=== added file 'account_banking_payment_export/__openerp__.py'
--- account_banking_payment_export/__openerp__.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/__openerp__.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+    'name': 'Account Banking - Payments',
+    'version': '0.1.164',
+    'license': 'AGPL-3',
+    'author': 'Banking addons community',
+    'website': 'https://launchpad.net/banking-addons',
+    'category': 'Banking addons',
+    'depends': [
+        'account_payment',
+        ],
+    'data': [
+        'view/account_payment.xml',
+        'view/bank_payment_manual.xml',
+        'view/payment_mode.xml',
+        'view/payment_mode_type.xml',
+        'data/payment_mode_type.xml',
+        'security/ir.model.access.csv',
+    ],
+    'description': '''
+    This addon adds payment export infrastructure to the Banking Addons.
+    * the "make payment" launches a wizard depending on the payment mode
+    * create a manual payment mode type
+    * various improvements to the payment order invoice import wizard
+    * suitable bank account type filtering
+    ''',
+    'auto_install': True,
+    'installable': True,
+}

=== added directory 'account_banking_payment_export/data'
=== added file 'account_banking_payment_export/data/payment_mode_type.xml'
--- account_banking_payment_export/data/payment_mode_type.xml	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/data/payment_mode_type.xml	2013-08-09 21:20:13 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- Add manual bank transfer as default payment option -->
+        <record model="payment.mode.type" id="manual_bank_tranfer">
+            <field name="name">Manual Bank Transfer</field>
+            <field name="code">BANKMAN</field>
+            <field name="suitable_bank_types"
+                eval="[(6,0,[ref('base.bank_normal'),ref('base_iban.bank_iban'),])]" />
+            <field name="ir_model_id"
+                   ref="model_payment_manual"/>
+        </record>
+    </data>
+</openerp>

=== added directory 'account_banking_payment_export/model'
=== added file 'account_banking_payment_export/model/__init__.py'
--- account_banking_payment_export/model/__init__.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/__init__.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,5 @@
+import account_payment
+import bank_payment_manual
+import payment_mode
+import payment_mode_type
+import payment_order_create

=== added file 'account_banking_payment_export/model/account_payment.py'
--- account_banking_payment_export/model/account_payment.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/account_payment.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm
+from openerp.tools.translate import _
+from openerp import netsvc
+
+
+class payment_order(orm.Model):
+    _inherit = 'payment.order'
+
+    def launch_wizard(self, cr, uid, ids, context=None):
+        """
+        Search for a wizard to launch according to the type.
+        If type is manual. just confirm the order.
+        Previously (pre-v6) in account_payment/wizard/wizard_pay.py
+        """
+        if context == None:
+            context = {}
+        result = {}
+        orders = self.browse(cr, uid, ids, context)
+        order = orders[0]
+        # check if a wizard is defined for the first order
+        if order.mode.type and order.mode.type.ir_model_id:
+            context['active_ids'] = ids
+            wizard_model = order.mode.type.ir_model_id.model
+            wizard_obj = self.pool.get(wizard_model)
+            wizard_id = wizard_obj.create(cr, uid, {}, context)
+            result = {
+                'name': wizard_obj._description or _('Payment Order Export'),
+                'view_type': 'form',
+                'view_mode': 'form',
+                'res_model': wizard_model,
+                'domain': [],
+                'context': context,
+                'type': 'ir.actions.act_window',
+                'target': 'new',
+                'res_id': wizard_id,
+                'nodestroy': True,
+                }
+        else:
+            # should all be manual orders without type or wizard model
+            for order in orders[1:]:
+                if order.mode.type and order.mode.type.ir_model_id:
+                    raise orm.except_orm(
+                        _('Error'),
+                        _('You can only combine payment orders of the same type')
+                        )
+            # process manual payments
+            wf_service = netsvc.LocalService('workflow')
+            for order_id in ids:
+                wf_service.trg_validate(uid, 'payment.order', order_id, 'done', cr)
+        return result

=== added file 'account_banking_payment_export/model/bank_payment_manual.py'
--- account_banking_payment_export/model/bank_payment_manual.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/bank_payment_manual.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+'''
+This module contains a single "wizard" for including a 'sent' state for manual
+bank transfers.
+'''
+
+from openerp.osv import orm, fields
+from openerp import netsvc
+
+
+class payment_manual(orm.TransientModel):
+    _name = 'payment.manual'
+    _description = 'Set payment orders to \'sent\' manually'
+
+    def default_get(self, cr, uid, fields_list, context=None):
+        if context and context.get('active_ids'):
+            payment_order_obj = self.pool.get('payment.order')
+            wf_service = netsvc.LocalService('workflow')
+            for order_id in context['active_ids']:
+                wf_service.trg_validate(
+                    uid, 'payment.order', order_id, 'done', cr)
+        return super(payment_manual, self).default_get(
+            cr, uid, fields_list, context=None)
+
+    _columns = {
+        # dummy field, to trigger a call to default_get
+        'name': fields.char('Name', size=1),
+        }
+

=== added file 'account_banking_payment_export/model/payment_mode.py'
--- account_banking_payment_export/model/payment_mode.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/payment_mode.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm, fields
+
+
+class payment_mode(orm.Model):
+    ''' Restoring the payment type from version 5,
+    used to select the export wizard (if any) '''
+    _inherit = "payment.mode"
+
+    def suitable_bank_types(self, cr, uid, payment_mode_id=None, context=None):
+        """ Reinstates functional code for suitable bank type filtering.
+        Current code in account_payment is disfunctional.
+        """
+        res = []
+        payment_mode = self.browse(
+            cr, uid, payment_mode_id, context)
+        if (payment_mode and payment_mode.type and
+            payment_mode.type.suitable_bank_types):
+            res = [type.code for type in payment_mode.type.suitable_bank_types]
+        return res
+
+    _columns = {
+        'type': fields.many2one(
+            'payment.mode.type', 'Payment type',
+            required=True,
+            help='Select the Payment Type for the Payment Mode.'
+            ),
+        'payment_term_ids': fields.many2many(
+            'account.payment.term', 'account_payment_order_terms_rel', 
+            'mode_id', 'term_id', 'Payment terms',
+            help=('Limit selected invoices to invoices with these payment '
+                  'terms')
+            ),
+        }

=== added file 'account_banking_payment_export/model/payment_mode_type.py'
--- account_banking_payment_export/model/payment_mode_type.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/payment_mode_type.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm, fields
+
+
+class payment_mode_type(orm.Model):
+    _name = 'payment.mode.type'
+    _description = 'Payment Mode Type'
+    _columns = {
+        'name': fields.char(
+            'Name', size=64, required=True,
+            help='Payment Type'
+            ),
+        'code': fields.char(
+            'Code', size=64, required=True,
+            help='Specify the Code for Payment Type'
+            ),
+        # Setting suitable_bank_types to required pending
+        # https://bugs.launchpad.net/openobject-addons/+bug/786845
+        'suitable_bank_types': fields.many2many(
+            'res.partner.bank.type',
+            'bank_type_payment_type_rel',
+            'pay_type_id','bank_type_id',
+            'Suitable bank types', required=True),
+        'ir_model_id': fields.many2one(
+            'ir.model', 'Payment wizard',
+            help=('Select the Payment Wizard for payments of this type. '
+                  'Leave empty for manual processing'),
+            domain=[('osv_memory', '=', True)],
+            ),
+        'payment_order_type': fields.selection(
+            [('payment', 'Payment'),('debit', 'Direct debit')],
+            'Payment order type', required=True,
+            ),
+    }
+
+    _defaults = {
+        'payment_order_type': 'payment',
+        }

=== added file 'account_banking_payment_export/model/payment_order_create.py'
--- account_banking_payment_export/model/payment_order_create.py	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/payment_order_create.py	2013-08-09 21:20:13 +0000
@@ -0,0 +1,199 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
+#              (C) 2011 - 2013 Therp BV (<http://therp.nl>).
+#            
+#    All other contributions are (C) by their respective contributors
+#
+#    All Rights Reserved
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from datetime import datetime
+from openerp.osv import orm, fields
+from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
+from openerp.tools.translate import _
+
+
+class payment_order_create(orm.TransientModel):
+    _inherit = 'payment.order.create'
+
+    def extend_payment_order_domain(
+            self, cr, uid, payment_order, domain, context=None):
+        if payment_order.payment_order_type == 'payment':
+            domain += [
+                ('account_id.type', '=', 'payable'),
+                ('amount_to_pay', '>', 0)
+                ]
+        return True
+
+    def search_entries(self, cr, uid, ids, context=None):
+        """
+        This method taken from account_payment module.
+        We adapt the domain based on the payment_order_type
+        """
+        line_obj = self.pool.get('account.move.line')
+        mod_obj = self.pool.get('ir.model.data')
+        if context is None:
+            context = {}
+        data = self.read(cr, uid, ids, ['duedate'], context=context)[0]
+        search_due_date = data['duedate']
+        
+        ### start account_banking_payment ###
+        payment = self.pool.get('payment.order').browse(
+            cr, uid, context['active_id'], context=context)
+        # Search for move line to pay:
+        domain = [
+            ('move_id.state', '=', 'posted'),
+            ('reconcile_id', '=', False),
+            ('company_id', '=', payment.mode.company_id.id),
+            ]
+        # apply payment term filter
+        if payment.mode.payment_term_ids:
+            domain += [
+                ('invoice.payment_term', 'in', 
+                 [term.id for term in payment.mode.payment_term_ids]
+                 )
+                ]
+        self.extend_payment_order_domain(
+            cr, uid, payment, domain, context=context)
+        ### end account_direct_debit ###
+
+        domain = domain + [
+            '|', ('date_maturity', '<=', search_due_date),
+            ('date_maturity', '=', False)
+            ]
+        line_ids = line_obj.search(cr, uid, domain, context=context)
+        context.update({'line_ids': line_ids})
+        model_data_ids = mod_obj.search(
+            cr, uid,[
+                ('model', '=', 'ir.ui.view'),
+                ('name', '=', 'view_create_payment_order_lines')],
+            context=context)
+        resource_id = mod_obj.read(
+            cr, uid, model_data_ids, fields=['res_id'],
+            context=context)[0]['res_id']
+        return {'name': _('Entry Lines'),
+                'context': context,
+                'view_type': 'form',
+                'view_mode': 'form',
+                'res_model': 'payment.order.create',
+                'views': [(resource_id, 'form')],
+                'type': 'ir.actions.act_window',
+                'target': 'new',
+        }
+
+    def create_payment(self, cr, uid, ids, context=None):
+        '''
+        This method is a slightly modified version of the existing method on this
+        model in account_payment.
+        - pass the payment mode to line2bank()
+        - allow invoices to create influence on the payment process: not only 'Free'
+        references are allowed, but others as well
+        - check date_to_pay is not in the past.
+        '''
+
+        order_obj = self.pool.get('payment.order')
+        line_obj = self.pool.get('account.move.line')
+        payment_obj = self.pool.get('payment.line')
+        if context is None:
+            context = {}
+        data = self.read(cr, uid, ids, [], context=context)[0]
+        line_ids = data['entries']
+        if not line_ids:
+            return {'type': 'ir.actions.act_window_close'}
+
+        payment = order_obj.browse(
+            cr, uid, context['active_id'], context=context)
+        ### account banking
+        # t = None
+        # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
+        line2bank = line_obj.line2bank(
+            cr, uid, line_ids, payment.mode.id, context)
+        _today = fields.date.context_today(self, cr, uid, context=context)
+        ### end account banking
+
+        ## Finally populate the current payment with new lines:
+        for line in line_obj.browse(cr, uid, line_ids, context=context):
+            if payment.date_prefered == "now":
+                #no payment date => immediate payment
+                date_to_pay = False
+            elif payment.date_prefered == 'due':
+                ### account_banking
+                # date_to_pay = line.date_maturity
+                date_to_pay = (
+                    line.date_maturity
+                    if line.date_maturity and line.date_maturity > _today
+                    else False)
+                ### end account banking
+            elif payment.date_prefered == 'fixed':
+                ### account_banking
+                # date_to_pay = payment.date_scheduled
+                date_to_pay = (
+                    payment.date_scheduled
+                    if payment.date_scheduled and payment.date_scheduled > _today
+                    else False)
+                ### end account banking
+
+            ### account_banking
+            state = communication2 = False
+            communication = line.ref or '/'
+            if line.invoice:
+                if line.invoice.type in ('in_invoice', 'in_refund'):
+                    if line.invoice.reference_type == 'structured':
+                        state = 'structured'
+                        communication = line.invoice.reference
+                    else:
+                        state = 'normal'
+                        communication2 = line.invoice.reference
+                else:
+                    # Make sure that the communication includes the
+                    # customer invoice number (in the case of debit order)
+                    communication = line.invoice.number.replace('/', '')
+                    state = 'structured'
+                    if line.invoice.number != line.ref:
+                        communication2 = line.ref
+            else:
+                state = 'normal'
+                communication2 = line.ref
+
+            # support debit orders when enabled
+            if (payment.payment_order_type == 'debit' and
+                'amount_to_receive' in line):
+                amount_currency = line.amount_to_receive
+            else:
+                amount_currency = line.amount_to_pay
+            ### end account_banking
+
+            payment_obj.create(cr, uid, {
+                'move_line_id': line.id,
+                'amount_currency': amount_currency,
+                'bank_id': line2bank.get(line.id),
+                'order_id': payment.id,
+                'partner_id': line.partner_id and line.partner_id.id or False,
+                ### account banking
+                # 'communication': line.ref or '/'
+                'communication': communication,
+                'communication2': communication2,
+                'state': state,
+                ### end account banking
+                'date': date_to_pay,
+                'currency': (line.invoice and line.invoice.currency_id.id
+                             or line.journal_id.currency.id
+                             or line.journal_id.company_id.currency_id.id),
+                }, context=context)
+        return {'type': 'ir.actions.act_window_close'}

=== added directory 'account_banking_payment_export/security'
=== added file 'account_banking_payment_export/security/ir.model.access.csv'
--- account_banking_payment_export/security/ir.model.access.csv	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/security/ir.model.access.csv	2013-08-09 21:20:13 +0000
@@ -0,0 +1,2 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_payment_mode_type","payment.mode.type","model_payment_mode_type","account_payment.group_account_payment",1,1,1,1

=== added directory 'account_banking_payment_export/view'
=== added file 'account_banking_payment_export/view/account_payment.xml'
--- account_banking_payment_export/view/account_payment.xml	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/view/account_payment.xml	2013-08-09 21:20:13 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- restore wizard functionality when making payments
+          -->
+
+        <record id="view_banking_payment_order_form_1" model="ir.ui.view">
+            <field name="name">account.payment.order.form.banking-1</field>
+            <field name="inherit_id" ref="account_payment.view_payment_order_form" />
+            <field name="model">payment.order</field>
+            <field name="arch" type="xml">
+                <data>
+                    <xpath expr="//button[@string='Make Payments']"
+                           position="attributes">
+                        <attribute name="name">launch_wizard</attribute>
+                    </xpath>
+                </data>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== added file 'account_banking_payment_export/view/bank_payment_manual.xml'
--- account_banking_payment_export/view/bank_payment_manual.xml	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/view/bank_payment_manual.xml	2013-08-09 21:20:13 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="view_payment_manual_form" model="ir.ui.view">
+            <field name="name">Form for manual payment wizard</field>
+            <field name="model">payment.manual</field>
+            <field name="arch" type="xml">
+                <form string="Manual payment">
+                    <label string="Payment order(s) have been set to 'sent'"/>
+                    <button special="cancel" icon="gtk-ok" string="OK"/>
+                </form>
+            </field>
+        </record>
+    </data>
+</openerp>

=== added file 'account_banking_payment_export/view/payment_mode.xml'
--- account_banking_payment_export/view/payment_mode.xml	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/view/payment_mode.xml	2013-08-09 21:20:13 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!-- 
+             Add the payment mode type and transfer settings
+        -->
+        <record id="view_payment_mode_form_inherit" model="ir.ui.view">
+            <field name="name">payment.mode.form.inherit</field>
+            <field name="model">payment.mode</field>
+            <field name="inherit_id" ref="account_payment.view_payment_mode_form"/>
+            <field name="arch" type="xml">
+                <field name="company_id" position="after">
+                    <field name="type"/>
+                    <group colspan="4" col="4">
+                        <group colspan="2">
+                            <separator colspan="2"
+                                       string="Optional filter by payment term" />
+                            <field name="payment_term_ids" nolabel="1" colspan="2"/>
+                        </group>
+                    </group>
+                </field>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== added file 'account_banking_payment_export/view/payment_mode_type.xml'
--- account_banking_payment_export/view/payment_mode_type.xml	1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/view/payment_mode_type.xml	2013-08-09 21:20:13 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_payment_mode_tree_inherit" model="ir.ui.view">
+            <field name="name">payment.mode.tree.inherit</field>
+            <field name="model">payment.mode</field>
+            <field name="inherit_id" ref="account_payment.view_payment_mode_tree"/>
+            <field name="arch" type="xml">
+                <field name="company_id" position="after">
+                    <field name="type"/>
+                </field>
+            </field>
+        </record>
+
+	<!-- basic view for payment mode type -->
+        <record model="ir.ui.view" id="view_payment_mode_type_form">
+            <field name="name">view.payment.mode.type.form</field>
+            <field name="model">payment.mode.type</field>
+            <field name="arch" type="xml">
+                <form string="Payment mode">
+		    <field name="name" />
+		    <field name="code" />
+		    <field name="suitable_bank_types"/>
+		    <field name="payment_order_type"/>
+		    <field name="ir_model_id"/>
+                </form>
+            </field>
+        </record>
+
+    </data>
+</openerp>

=== modified file 'account_banking_sepa_credit_transfer/__openerp__.py'
--- account_banking_sepa_credit_transfer/__openerp__.py	2013-08-02 22:39:11 +0000
+++ account_banking_sepa_credit_transfer/__openerp__.py	2013-08-09 21:20:13 +0000
@@ -26,7 +26,7 @@
     'author': 'Akretion',
     'website': 'http://www.akretion.com',
     'category': 'Banking addons',
-    'depends': ['account_banking_payment'],
+    'depends': ['account_banking_payment_export'],
     'data': [
         'account_banking_sepa_view.xml',
         'wizard/export_sepa_view.xml',

=== modified file 'account_banking_sepa_credit_transfer/account_banking_sepa_view.xml'
--- account_banking_sepa_credit_transfer/account_banking_sepa_view.xml	2013-08-02 22:39:11 +0000
+++ account_banking_sepa_credit_transfer/account_banking_sepa_view.xml	2013-08-09 21:20:13 +0000
@@ -65,7 +65,7 @@
 
 
 <menuitem id="menu_account_banking_sepa"
-          parent="account_banking.menu_finance_banking_actions"
+          parent="account_payment.menu_main_payment"
           action="action_account_banking_sepa"
           sequence="15"
           />

=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa.py'
--- account_banking_sepa_credit_transfer/wizard/export_sepa.py	2013-08-02 22:39:11 +0000
+++ account_banking_sepa_credit_transfer/wizard/export_sepa.py	2013-08-09 21:20:13 +0000
@@ -335,5 +335,5 @@
             sepa_export.file_id.id, {'state': 'sent'}, context=context)
         wf_service = netsvc.LocalService('workflow')
         for order in sepa_export.payment_order_ids:
-            wf_service.trg_validate(uid, 'payment.order', order.id, 'sent', cr)
+            wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr)
         return {'type': 'ir.actions.act_window_close'}


Follow ups