diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py
index 79801c84e..5c0cd1faf 100644
--- a/account_banking/banking_import_transaction.py
+++ b/account_banking/banking_import_transaction.py
@@ -193,6 +193,10 @@ class banking_import_transaction(orm.Model):
iname = invoice.name.upper()
if iname in ref or iname in msg:
return True
+ if invoice.supplier_invoice_number and len(invoice.supplier_invoice_number) > 2:
+ supp_ref = invoice.supplier_invoice_number.upper()
+ if supp_ref in ref or supp_ref in msg:
+ return True
elif invoice.type.startswith('out_'):
# External id's possible and likely
inum = invoice.number.upper()
@@ -1211,8 +1215,6 @@ class banking_import_transaction(orm.Model):
'match_type',
'move_line_id',
'invoice_id',
- 'manual_invoice_id',
- 'manual_move_line_id',
]] +
[(x, [(6, 0, [])]) for x in [
'move_line_ids',
@@ -1299,9 +1301,9 @@ class banking_import_transaction(orm.Model):
'exchange_rate': fields.float('exchange_rate'),
'transferred_amount': fields.float('transferred_amount'),
'message': fields.char('message', size=1024),
- 'remote_owner': fields.char('remote_owner', size=24),
- 'remote_owner_address': fields.char('remote_owner_address', size=24),
- 'remote_owner_city': fields.char('remote_owner_city', size=24),
+ 'remote_owner': fields.char('remote_owner', size=128),
+ 'remote_owner_address': fields.char('remote_owner_address', size=256),
+ 'remote_owner_city': fields.char('remote_owner_city', size=128),
'remote_owner_postalcode': fields.char('remote_owner_postalcode', size=24),
'remote_owner_country_code': fields.char('remote_owner_country_code', size=24),
'remote_owner_custno': fields.char('remote_owner_custno', size=24),
diff --git a/account_banking/data/account_banking_data.xml b/account_banking/data/account_banking_data.xml
index 3d47ad718..14ae6eafe 100644
--- a/account_banking/data/account_banking_data.xml
+++ b/account_banking/data/account_banking_data.xml
@@ -13,12 +13,5 @@
-
-
-
-
diff --git a/account_banking/migrations/0.1.81/post-set-statement-line-state.py b/account_banking/migrations/6.1.0.1.81/post-set-statement-line-state.py
similarity index 100%
rename from account_banking/migrations/0.1.81/post-set-statement-line-state.py
rename to account_banking/migrations/6.1.0.1.81/post-set-statement-line-state.py
diff --git a/account_banking/migrations/7.0.0.1/pre-migration.py b/account_banking/migrations/7.0.0.1/pre-migration.py
new file mode 100644
index 000000000..e12284d0e
--- /dev/null
+++ b/account_banking/migrations/7.0.0.1/pre-migration.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2013 Therp BV ().
+# 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 .
+#
+##############################################################################
+
+def migrate(cr, version):
+ if not version:
+ return
+
+ # workflow state moved to another, new module
+ cr.execute(
+ """
+ UPDATE ir_model_data
+ SET module = 'account_banking_payment'
+ WHERE name = 'trans_done_sent'
+ AND module = 'account_direct_debit'
+ """)
diff --git a/account_banking/security/ir.model.access.csv b/account_banking/security/ir.model.access.csv
index 5e9d5f05b..8444747b9 100644
--- a/account_banking/security/ir.model.access.csv
+++ b/account_banking/security/ir.model.access.csv
@@ -3,4 +3,3 @@
"access_account_banking_settings_user","account.banking.account.settings user","model_account_banking_account_settings","account.group_account_user",1,0,0,0
"access_account_banking_import","account.bankimport","model_account_banking_imported_file","account.group_account_user",1,1,1,1
"access_banking_import_transaction","Banking addons - Bank import transaction","model_banking_import_transaction","account.group_account_user",1,1,1,1
-"access_banking_transaction_wizard","Banking addons - Transaction wizard","model_banking_transaction_wizard","account.group_account_user",1,1,1,1
diff --git a/account_banking/sepa/iban.py b/account_banking/sepa/iban.py
index 7d16840d9..817b043b1 100644
--- a/account_banking/sepa/iban.py
+++ b/account_banking/sepa/iban.py
@@ -190,7 +190,7 @@ class IBAN(str):
BBAN_formats = {
'AL': BBANFormat('CCBBBBVAAAAAAAAAAAAAAAAAA', '%B%A'),
'AD': BBANFormat('CCCCBBBBAAAAAAAAAAAA', '%A'),
- 'AT': BBANFormat('BBBBBAAAAAAAAAAA', '%A BLZ %C'),
+ 'AT': BBANFormat('BBBBBAAAAAAAAAAA', '%A BLZ %B'),
'BE': BBANFormat('CCCAAAAAAAVV', '%C-%A-%V'),
'BA': BBANFormat('BBBCCCAAAAAAAA', '%I'),
'BG': BBANFormat('BBBBCCCCAAAAAAAAAA', '%I'),
diff --git a/account_banking/wizard/banking_transaction_wizard.py b/account_banking/wizard/banking_transaction_wizard.py
index 0fc71677c..255d7979c 100644
--- a/account_banking/wizard/banking_transaction_wizard.py
+++ b/account_banking/wizard/banking_transaction_wizard.py
@@ -314,6 +314,10 @@ class banking_transaction_wizard(orm.TransientModel):
'ref': fields.related(
'statement_line_id', 'ref', type='char', size=32,
string="Reference", readonly=True),
+ 'message': fields.related(
+ 'statement_line_id', 'import_transaction_id', 'message',
+ type='char', size=1024,
+ string="Message", readonly=True),
'partner_id': fields.related(
'statement_line_id', 'partner_id',
type='many2one', relation='res.partner',
@@ -363,13 +367,6 @@ class banking_transaction_wizard(orm.TransientModel):
('payment_order_manual', 'Payment order (manual)'),
],
string='Match type', readonly=True),
- 'manual_invoice_id': fields.many2one(
- 'account.invoice', 'Match this invoice',
- domain=[('reconciled', '=', False)]),
- 'manual_move_line_id': fields.many2one(
- 'account.move.line', 'Or match this entry',
- domain=[('account_id.reconcile', '=', True),
- ('reconcile_id', '=', False)]),
'manual_invoice_ids': fields.many2many(
'account.invoice',
'banking_transaction_wizard_account_invoice_rel',
diff --git a/account_banking/wizard/banking_transaction_wizard.xml b/account_banking/wizard/banking_transaction_wizard.xml
index 1e970eb7e..018b87210 100644
--- a/account_banking/wizard/banking_transaction_wizard.xml
+++ b/account_banking/wizard/banking_transaction_wizard.xml
@@ -17,8 +17,9 @@
-
+
+
diff --git a/account_banking/wizard/link_partner.py b/account_banking/wizard/link_partner.py
index c4d9108f6..fc4f83acd 100644
--- a/account_banking/wizard/link_partner.py
+++ b/account_banking/wizard/link_partner.py
@@ -22,6 +22,7 @@
from openerp.osv import orm, fields
from openerp.tools.translate import _
from openerp.addons.account_banking.wizard import banktools
+import ast
class link_partner(orm.TransientModel):
_name = 'banking.link_partner'
@@ -37,6 +38,16 @@ class link_partner(orm.TransientModel):
'statement_line_id': fields.many2one(
'account.bank.statement.line',
'Statement line', required=True),
+ 'amount': fields.related(
+ 'statement_line_id', 'amount', type='float',
+ string="Amount", readonly=True),
+ 'ref': fields.related(
+ 'statement_line_id', 'ref', type='char', size=32,
+ string="Reference", readonly=True),
+ 'message': fields.related(
+ 'statement_line_id', 'import_transaction_id', 'message',
+ type='char', size=1024,
+ string="Message", readonly=True),
'remote_account': fields.char(
'Account number', size=24, readonly=True),
# Partner values
@@ -50,6 +61,11 @@ class link_partner(orm.TransientModel):
'phone': fields.char('Phone', size=64),
'fax': fields.char('Fax', size=64),
'mobile': fields.char('Mobile', size=64),
+ 'is_company': fields.boolean('Is a Company'),
+ }
+
+ _defaults = {
+ 'is_company': True,
}
def create(self, cr, uid, vals, context=None):
@@ -79,9 +95,19 @@ class link_partner(orm.TransientModel):
if 'customer' not in vals and statement_line.amount > 0:
vals['customer'] = True
- if not vals.get('street'):
- vals['street'] = transaction.remote_owner_address
- if not vals.get('street'):
+ address_list = []
+ try:
+ address_list = ast.literal_eval(
+ transaction.remote_owner_address or [])
+ except ValueError:
+ pass
+ if address_list and not vals.get('street'):
+ vals['street'] = address_list.pop(0)
+ if address_list and not vals.get('street2'):
+ vals['street2'] = address_list.pop(0)
+ if transaction.remote_owner_postalcode and not vals.get('zip'):
+ vals['zip'] = transaction.remote_owner_postalcode
+ if transaction.remote_owner_city and not vals.get('city'):
vals['city'] = transaction.remote_owner_city
if not vals.get('country_id'):
vals['country_id'] = banktools.get_country_id(
@@ -101,10 +127,12 @@ class link_partner(orm.TransientModel):
:param wizard: read record of wizard (with load='_classic_write')
:param values: the dictionary of partner values that will be updated
"""
- for field in ['name',
+ for field in ['is_company',
+ 'name',
'street',
'street2',
'zip',
+ 'city',
'country_id',
'state_id',
'phone',
@@ -126,10 +154,7 @@ class link_partner(orm.TransientModel):
else:
wiz_read = self.read(
cr, uid, ids[0], context=context, load='_classic_write')
- partner_fields = self.pool.get(
- 'res.partner')._columns.keys()
partner_vals = {
- 'is_company': True,
'type': 'default',
}
self.update_partner_values(
diff --git a/account_banking/wizard/link_partner.xml b/account_banking/wizard/link_partner.xml
index c9c2d21c9..bf0c46a67 100644
--- a/account_banking/wizard/link_partner.xml
+++ b/account_banking/wizard/link_partner.xml
@@ -7,15 +7,24 @@
banking.link_partner
-
+
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.inheritpayment.mode
-
+
-
-
+
-
- payment.mode.tree.inherit
- payment.mode
-
-
-
-
-
-
-
-
-
-
+ view.payment.mode.type.formpayment.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 TransferBANKMAN
+ 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
+
+
-
+
@@ -25,7 +25,7 @@
-
+
@@ -57,7 +57,7 @@
- Generated SEPA XML files
+ Generated SEPA Credit Transfer XML filesbanking.export.sepaformtree,form
@@ -65,13 +65,13 @@
banking.export.sepa.wizard.viewbanking.export.sepa.wizard
-
+
@@ -20,9 +20,6 @@
-
-
-
@@ -31,14 +28,16 @@
Bug desc : in the Gtk client, you have to clic twice on the
"Create" button.
-->
-
-
+
-
-
-
+
diff --git a/account_direct_debit/__openerp__.py b/account_direct_debit/__openerp__.py
index f5791122b..5cc16dcac 100644
--- a/account_direct_debit/__openerp__.py
+++ b/account_direct_debit/__openerp__.py
@@ -25,7 +25,7 @@
'author': ['Therp BV', 'Smile'],
'website': 'https://launchpad.net/banking-addons',
'category': 'Banking addons',
- 'depends': ['account_banking'],
+ 'depends': ['account_banking_payment'],
'data': [
'view/account_payment.xml',
'view/account_invoice.xml',
diff --git a/account_direct_debit/migrations/7.0.2/post-migration.py b/account_direct_debit/migrations/7.0.2/post-migration.py
new file mode 100644
index 000000000..a6ec3af59
--- /dev/null
+++ b/account_direct_debit/migrations/7.0.2/post-migration.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 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 .
+#
+##############################################################################
+
+def migrate(cr, version):
+ if not version:
+ return
+ cr.execute(
+ """
+ UPDATE payment_line
+ SET transit_move_line_id = banking_addons_61_debit_move_line_id
+ """)
+ cr.execute(
+ """
+ ALTER TABLE "payment_line"
+ DROP COLUMN "banking_addons_61_debit_move_line_id"
+ """
+ )
diff --git a/account_direct_debit/migrations/7.0.2/pre-migration.py b/account_direct_debit/migrations/7.0.2/pre-migration.py
index 3dd113401..a167bca53 100644
--- a/account_direct_debit/migrations/7.0.2/pre-migration.py
+++ b/account_direct_debit/migrations/7.0.2/pre-migration.py
@@ -22,6 +22,9 @@
#
##############################################################################
+import logging
+logger = logging.getLogger()
+
def rename_columns(cr, column_spec):
"""
Rename table columns. Taken from OpenUpgrade.
@@ -41,17 +44,8 @@ def migrate(cr, version):
if not version:
return
- # workflow state moved to another module
- cr.execute(
- """
- UPDATE ir_model_data
- SET module = 'account_banking_payment'
- WHERE name = 'trans_done_sent'
- AND module = 'account_direct_debit'
- """)
-
# rename field debit_move_line_id
rename_columns(cr, {
'payment_line': [
- ('debit_move_line_id', 'transit_move_line_id'),
+ ('debit_move_line_id', 'banking_addons_61_debit_move_line_id'),
]})
diff --git a/account_direct_debit/model/payment_line.py b/account_direct_debit/model/payment_line.py
index 0f493cc39..2c6bf7c51 100644
--- a/account_direct_debit/model/payment_line.py
+++ b/account_direct_debit/model/payment_line.py
@@ -133,14 +133,14 @@ class payment_line(orm.Model):
"""
if isinstance(payment_line_id, (list, tuple)):
payment_line_id = payment_line_id[0]
- payment_line = self.read(
+ payment_line_vals = self.read(
cr, uid, payment_line_id, ['storno', 'name'], context=context)
- if payment_line['storno']:
+ if payment_line_vals['storno']:
raise orm.except_orm(
_('Can not reconcile'),
_('Cancelation of payment line \'%s\' has already been '
- 'processed') % payment_line['name'])
- return super(self, payment_line).debit_reconcile(
+ 'processed') % payment_line_vals['name'])
+ return super(payment_line, self).debit_reconcile(
cr, uid, payment_line_id, context=context)
_columns = {
diff --git a/base_iban_bic_not_required/__init__.py b/base_iban_bic_not_required/__init__.py
new file mode 100644
index 000000000..16e8b082f
--- /dev/null
+++ b/base_iban_bic_not_required/__init__.py
@@ -0,0 +1 @@
+import model
diff --git a/base_iban_bic_not_required/__openerp__.py b/base_iban_bic_not_required/__openerp__.py
new file mode 100644
index 000000000..08a6fb582
--- /dev/null
+++ b/base_iban_bic_not_required/__openerp__.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2013 Therp BV ().
+# 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': 'IBAN - Bic not required',
+ 'version': '0.1',
+ 'license': 'AGPL-3',
+ 'author': 'Banking addons community',
+ 'website': 'https://launchpad.net/banking-addons',
+ 'category': 'Banking addons',
+ 'depends': [
+ 'base_iban',
+ ],
+ 'description': '''
+The account_iban module in OpenERP mandates the presence of a BIC
+code on an IBAN account number through a constraint. However, as of
+Februari 2012 there is a resolution from the EU that drops this requirement
+(see section 8 of [1]). This module reverts the constraint on BICs in the
+base_iban module.
+
+See also https://bugs.launchpad.net/openobject-addons/+bug/933472
+
+[1] http://www.europarl.europa.eu/sides/getDoc.do?pubRef=-//EP//TEXT+TA+P7-TA-2012-0037+0+DOC+XML+V0//EN&language=EN#BKMD-9
+ ''',
+ 'data': [
+ 'data/res_partner_bank_type_field.xml',
+ ],
+ 'installable': True,
+}
diff --git a/base_iban_bic_not_required/data/res_partner_bank_type_field.xml b/base_iban_bic_not_required/data/res_partner_bank_type_field.xml
new file mode 100644
index 000000000..274347a4d
--- /dev/null
+++ b/base_iban_bic_not_required/data/res_partner_bank_type_field.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
diff --git a/base_iban_bic_not_required/model/__init__.py b/base_iban_bic_not_required/model/__init__.py
new file mode 100644
index 000000000..3f2925496
--- /dev/null
+++ b/base_iban_bic_not_required/model/__init__.py
@@ -0,0 +1 @@
+import res_partner_bank
diff --git a/base_iban_bic_not_required/model/res_partner_bank.py b/base_iban_bic_not_required/model/res_partner_bank.py
new file mode 100644
index 000000000..126e628bd
--- /dev/null
+++ b/base_iban_bic_not_required/model/res_partner_bank.py
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2013 Therp BV ().
+# 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 res_partner_bank(orm.Model):
+ _inherit = 'res.partner.bank'
+
+ def _check_bank(self, cr, uid, ids, context=None):
+ #suppress base_iban's constraint to enforce BICs for IBANs
+ #workaround for lp:933472
+ return True
+
+ # Redefine constraint to update its function reference
+ _constraints = [
+ (_check_bank,
+ '\nPlease define BIC/Swift code on bank for bank '
+ 'type IBAN Account to make valid payments',
+ ['bic'])
+ ]