diff --git a/account_banking_payment/__openerp__.py b/account_banking_payment/__openerp__.py
index af1ecab2e..a0984398f 100644
--- a/account_banking_payment/__openerp__.py
+++ b/account_banking_payment/__openerp__.py
@@ -32,17 +32,14 @@
'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.
diff --git a/account_banking_payment/model/__init__.py b/account_banking_payment/model/__init__.py
index 9908c8e01..e7ae81724 100644
--- a/account_banking_payment/model/__init__.py
+++ b/account_banking_payment/model/__init__.py
@@ -5,5 +5,4 @@ import payment_mode_type
import payment_order_create
import banking_import_transaction
import banking_transaction_wizard
-import bank_payment_manual
import banking_import_line
diff --git a/account_banking_payment/model/account_payment.py b/account_banking_payment/model/account_payment.py
index 2820b7e61..6153b662e 100644
--- a/account_banking_payment/model/account_payment.py
+++ b/account_banking_payment/model/account_payment.py
@@ -115,49 +115,6 @@ class payment_order(orm.Model):
'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.
diff --git a/account_banking_payment/model/payment_mode.py b/account_banking_payment/model/payment_mode.py
index f93acec8e..6237593b6 100644
--- a/account_banking_payment/model/payment_mode.py
+++ b/account_banking_payment/model/payment_mode.py
@@ -27,28 +27,9 @@ 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.'
- ),
'transfer_account_id': fields.many2one(
'account.account', 'Transfer account',
domain=[('type', '=', 'other'),
diff --git a/account_banking_payment/model/payment_mode_type.py b/account_banking_payment/model/payment_mode_type.py
index 51de7ca66..572cce869 100644
--- a/account_banking_payment/model/payment_mode_type.py
+++ b/account_banking_payment/model/payment_mode_type.py
@@ -27,30 +27,9 @@ from openerp.osv import orm, fields
class payment_mode_type(orm.Model):
- _name = 'payment.mode.type'
- _description = 'Payment Mode Type'
+ _inherit = '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,
diff --git a/account_banking_payment/model/payment_order_create.py b/account_banking_payment/model/payment_order_create.py
index 68a0d22f4..c7ac88790 100644
--- a/account_banking_payment/model/payment_order_create.py
+++ b/account_banking_payment/model/payment_order_create.py
@@ -23,9 +23,7 @@
#
##############################################################################
-from datetime import datetime
from openerp.osv import orm, fields
-from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp.tools.translate import _
diff --git a/account_banking_payment/view/account_payment.xml b/account_banking_payment/view/account_payment.xml
index 4f7601332..c26847abf 100644
--- a/account_banking_payment/view/account_payment.xml
+++ b/account_banking_payment/view/account_payment.xml
@@ -17,10 +17,6 @@
'invisible':[('state','!=','draft')]
}
-
- launch_wizard
-
diff --git a/account_banking_payment/view/bank_payment_manual.xml b/account_banking_payment/view/bank_payment_manual.xml
deleted file mode 100644
index 538862ca3..000000000
--- a/account_banking_payment/view/bank_payment_manual.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- Form for manual payment wizard
- payment.manual
-
-
-
-
-
-
diff --git a/account_banking_payment/view/payment_mode.xml b/account_banking_payment/view/payment_mode.xml
index bb3c19ff4..c46823c8d 100644
--- a/account_banking_payment/view/payment_mode.xml
+++ b/account_banking_payment/view/payment_mode.xml
@@ -8,10 +8,9 @@
payment.mode.form.inherit
payment.mode
-
+
-
-
+
-
- payment.mode.tree.inherit
- payment.mode
-
-
-
-
-
-
-
-
-
-
+
view.payment.mode.type.form
payment.mode.type
+
-
+
+
+
diff --git a/account_banking_payment/workflow/account_payment.xml b/account_banking_payment/workflow/account_payment.xml
index 3db2f9fb6..510a6610f 100644
--- a/account_banking_payment/workflow/account_payment.xml
+++ b/account_banking_payment/workflow/account_payment.xml
@@ -29,6 +29,12 @@ write({'state':'rejected'})
sent
+
+
+
+
+ done
+
diff --git a/account_banking_payment_export/__init__.py b/account_banking_payment_export/__init__.py
new file mode 100644
index 000000000..36ec7207a
--- /dev/null
+++ b/account_banking_payment_export/__init__.py
@@ -0,0 +1 @@
+from . import model
\ No newline at end of file
diff --git a/account_banking_payment_export/__openerp__.py b/account_banking_payment_export/__openerp__.py
new file mode 100644
index 000000000..8640f5bb3
--- /dev/null
+++ b/account_banking_payment_export/__openerp__.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2009 EduSense BV ().
+# (C) 2011 - 2013 Therp BV ().
+#
+# 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 .
+#
+##############################################################################
+
+{
+ 'name': 'Account Banking - Payments Export Infrastructure',
+ 'version': '0.1.164',
+ 'license': 'AGPL-3',
+ 'author': 'Banking addons community',
+ 'website': 'https://launchpad.net/banking-addons',
+ 'category': 'Banking addons',
+ 'depends': [
+ 'account_payment',
+ 'base_iban', # for manual_bank_tranfer
+ ],
+ 'conflicts': [
+ # lp:account-payment/account_payment_extension also adds
+ # a type field to payment.mode, with a very similar purpose.
+ # We can't add a dependency on account_payment_extension here
+ # because account_payment_extension adds many other features
+ # that probably conflict with other parts of lp:banking-addons.
+ # Proposal to resolve: make account_payment_extension depend
+ # on the present account_banking_payment_export module.
+ 'account_payment_extension',
+ ],
+ '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': '''
+ Infrastructure to export payment orders.
+
+ This technical module provides the base infrastructure to export
+ payment orders for electronic banking. It provides the following
+ technical features:
+ * a new payment.mode.type model
+ * payment.mode now has a mandatory type
+ * a better implementation of payment_mode.suitable_bank_types() based on payment.mode.type
+ * the "make payment" button launches a wizard depending on the payment.mode.type
+ * a manual payment mode type is provided as an example, with a default "do nothing" wizard
+ ''',
+ 'auto_install': True,
+ 'installable': True,
+}
diff --git a/account_banking_payment/data/payment_mode_type.xml b/account_banking_payment_export/data/payment_mode_type.xml
similarity index 74%
rename from account_banking_payment/data/payment_mode_type.xml
rename to account_banking_payment_export/data/payment_mode_type.xml
index 96b0e0c56..c1e4a4abd 100644
--- a/account_banking_payment/data/payment_mode_type.xml
+++ b/account_banking_payment_export/data/payment_mode_type.xml
@@ -2,13 +2,13 @@
-
+
Manual Bank Transfer
BANKMAN
+ ref="model_payment_manual"/>
diff --git a/account_banking_payment_export/model/__init__.py b/account_banking_payment_export/model/__init__.py
new file mode 100644
index 000000000..5c7e00141
--- /dev/null
+++ b/account_banking_payment_export/model/__init__.py
@@ -0,0 +1,5 @@
+from . import account_payment
+from . import bank_payment_manual
+from . import payment_mode
+from . import payment_mode_type
+from . import payment_order_create
\ No newline at end of file
diff --git a/account_banking_payment_export/model/account_payment.py b/account_banking_payment_export/model/account_payment.py
new file mode 100644
index 000000000..e5a14e8aa
--- /dev/null
+++ b/account_banking_payment_export/model/account_payment.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2009 EduSense BV ().
+# (C) 2011 - 2013 Therp BV ().
+#
+# 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 .
+#
+##############################################################################
+
+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
diff --git a/account_banking_payment/model/bank_payment_manual.py b/account_banking_payment_export/model/bank_payment_manual.py
similarity index 58%
rename from account_banking_payment/model/bank_payment_manual.py
rename to account_banking_payment_export/model/bank_payment_manual.py
index 700bf0210..8cfa35d53 100644
--- a/account_banking_payment/model/bank_payment_manual.py
+++ b/account_banking_payment_export/model/bank_payment_manual.py
@@ -24,7 +24,7 @@
##############################################################################
'''
-This module contains a single "wizard" for including a 'sent' state for manual
+This module contains a single "wizard" for confirming manual
bank transfers.
'''
@@ -34,20 +34,26 @@ 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)
+ _description = 'Send payment order(s) manually'
_columns = {
- # dummy field, to trigger a call to default_get
- 'name': fields.char('Name', size=1),
+ 'payment_order_ids': fields.many2many('payment.order',
+ 'wiz_manual_payorders_rel', 'wizard_id', 'payment_order_id',
+ 'Payment orders', readonly=True),
}
+ def create(self, cr, uid, vals, context=None):
+ payment_order_ids = context.get('active_ids', [])
+ vals.update({
+ 'payment_order_ids': [[6, 0, payment_order_ids]],
+ })
+ return super(payment_manual, self).create(cr, uid,
+ vals, context=context)
+
+ def button_ok(self, cr, uid, ids, context=None):
+ wf_service = netsvc.LocalService('workflow')
+ for wiz in self.browse(cr, uid, ids, context=context):
+ for order_id in wiz.payment_order_ids:
+ wf_service.trg_validate(
+ uid, 'payment.order', order_id.id, 'done', cr)
+ return {'type': 'ir.actions.act_window_close'}
diff --git a/account_banking_payment_export/model/payment_mode.py b/account_banking_payment_export/model/payment_mode.py
new file mode 100644
index 000000000..0d85d3aa3
--- /dev/null
+++ b/account_banking_payment_export/model/payment_mode.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2009 EduSense BV ().
+# (C) 2011 - 2013 Therp BV ().
+#
+# 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 .
+#
+##############################################################################
+
+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 = [t.code for t 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.'
+ ),
+ }
diff --git a/account_banking_payment_export/model/payment_mode_type.py b/account_banking_payment_export/model/payment_mode_type.py
new file mode 100644
index 000000000..dbc60d5ab
--- /dev/null
+++ b/account_banking_payment_export/model/payment_mode_type.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2009 EduSense BV ().
+# (C) 2011 - 2013 Therp BV ().
+#
+# 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 .
+#
+##############################################################################
+
+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'
+ ),
+ '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)],
+ ),
+ }
+
+ def _auto_init(self, cr, context=None):
+ r = super(payment_mode_type, self)._auto_init(cr, context=context)
+ # migrate xmlid from manual_bank_transfer to avoid dependency on account_banking
+ cr.execute("""UPDATE ir_model_data SET module='account_banking_payment_export'
+ WHERE module='account_banking' AND
+ name='manual_bank_tranfer' AND
+ model='payment.mode.type'""")
+ return r
diff --git a/account_banking_payment_export/model/payment_order_create.py b/account_banking_payment_export/model/payment_order_create.py
new file mode 100644
index 000000000..278d4327a
--- /dev/null
+++ b/account_banking_payment_export/model/payment_order_create.py
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2013 ACSONE SA/NV ();.
+#
+# 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 .
+#
+##############################################################################
+
+from openerp.osv import orm
+
+
+class payment_order_create(orm.TransientModel):
+ _inherit = 'payment.order.create'
+
+ def create_payment(self, cr, uid, ids, context=None):
+ '''This method adapts the core create_payment()
+ to pass the payment mode to line2bank() through the context,
+ so it is in turn propagated to suitable_bank_types().
+
+ This is necessary because the core does not propagate the payment mode to line2bank: t = None in
+ http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_payment/wizard/account_payment_order.py#L72
+
+ Hack idea courtesy Stefan Rijnhart.
+ '''
+ if context is None:
+ context = {}
+ order_obj = self.pool.get('payment.order')
+ payment = order_obj.browse(cr, uid, context['active_id'], context=context)
+ context['_fix_payment_mode_id'] = payment.mode.id
+ return super(payment_order_create, self).create_payment(cr, uid, ids, context=context)
+
+
+class account_move_line(orm.Model):
+ _inherit = 'account.move.line'
+
+ def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):
+ '''Obtain payment_type from context, see create_payment above'''
+ if context is None:
+ context = {}
+ payment_mode_id = payment_mode_id or context.get('_fix_payment_mode_id')
+ return super(account_move_line, self).line2bank(cr, uid, ids, payment_mode_id, context=context)
+
diff --git a/account_banking_payment/security/ir.model.access.csv b/account_banking_payment_export/security/ir.model.access.csv
similarity index 100%
rename from account_banking_payment/security/ir.model.access.csv
rename to account_banking_payment_export/security/ir.model.access.csv
diff --git a/account_banking_payment_export/view/account_payment.xml b/account_banking_payment_export/view/account_payment.xml
new file mode 100644
index 000000000..a8e7ed547
--- /dev/null
+++ b/account_banking_payment_export/view/account_payment.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ account.payment.order.form.banking-1
+
+ payment.order
+
+
+
+ launch_wizard
+
+
+
+
+
+
+
diff --git a/account_banking_payment_export/view/bank_payment_manual.xml b/account_banking_payment_export/view/bank_payment_manual.xml
new file mode 100644
index 000000000..e350c9b6f
--- /dev/null
+++ b/account_banking_payment_export/view/bank_payment_manual.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ Form for manual payment wizard
+ payment.manual
+
+
+
+
+
+
diff --git a/account_banking_payment_export/view/payment_mode.xml b/account_banking_payment_export/view/payment_mode.xml
new file mode 100644
index 000000000..98fa44475
--- /dev/null
+++ b/account_banking_payment_export/view/payment_mode.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ payment.mode.form.inherit
+ payment.mode
+
+
+
+
+
+
+
+
+
+
diff --git a/account_banking_payment_export/view/payment_mode_type.xml b/account_banking_payment_export/view/payment_mode_type.xml
new file mode 100644
index 000000000..682265a2d
--- /dev/null
+++ b/account_banking_payment_export/view/payment_mode_type.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ payment.mode.tree.inherit
+ payment.mode
+
+
+
+
+
+
+
+
+
+
+ view.payment.mode.type.form
+ payment.mode.type
+
+
+
+
+
+
+
diff --git a/account_banking_sepa_credit_transfer/__openerp__.py b/account_banking_sepa_credit_transfer/__openerp__.py
index 35891b16c..751058ea2 100644
--- a/account_banking_sepa_credit_transfer/__openerp__.py
+++ b/account_banking_sepa_credit_transfer/__openerp__.py
@@ -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',
diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa.py b/account_banking_sepa_credit_transfer/account_banking_sepa.py
index decb6a532..432b59267 100644
--- a/account_banking_sepa_credit_transfer/account_banking_sepa.py
+++ b/account_banking_sepa_credit_transfer/account_banking_sepa.py
@@ -20,8 +20,6 @@
##############################################################################
from openerp.osv import orm, fields
-import time
-from openerp.tools.translate import _
from openerp.addons.decimal_precision import decimal_precision as dp
diff --git a/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml b/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml
index fca4ba4d2..1fdab318f 100644
--- a/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml
+++ b/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml
@@ -65,7 +65,7 @@
diff --git a/account_banking_sepa_credit_transfer/wizard/export_sepa.py b/account_banking_sepa_credit_transfer/wizard/export_sepa.py
index d603f11f0..598962dd6 100644
--- a/account_banking_sepa_credit_transfer/wizard/export_sepa.py
+++ b/account_banking_sepa_credit_transfer/wizard/export_sepa.py
@@ -101,8 +101,6 @@ class banking_export_sepa_wizard(orm.TransientModel):
'''
Creates the SEPA Credit Transfer file. That's the important code !
'''
- payment_order_obj = self.pool.get('payment.order')
-
sepa_export = self.browse(cr, uid, ids[0], context=context)
my_company_name = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name
@@ -330,12 +328,15 @@ class banking_export_sepa_wizard(orm.TransientModel):
def save_sepa(self, cr, uid, ids, context=None):
'''
- Save the SEPA PAIN: mark all payments in the file as 'sent'.
+ Save the SEPA PAIN: send the done signal to all payment orders in the file.
+ With the default workflow, they will transition to 'done', while with the
+ advanced workflow in account_banking_payment they will transition to 'sent'
+ waiting reconciliation.
'''
sepa_export = self.browse(cr, uid, ids[0], context=context)
- sepa_file = self.pool.get('banking.export.sepa').write(cr, uid,
+ self.pool.get('banking.export.sepa').write(cr, uid,
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'}