banking-addons-team team mailing list archive
-
banking-addons-team team
-
Mailing list archive
-
Message #00049
lp:~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1 into lp:~banking-addons-team/banking-addons/6.1-dev
Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1 into lp:~banking-addons-team/banking-addons/6.1-dev.
Requested reviews:
James Jesudason (jamesj)
For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1/+merge/102061
This branch adapts a Dutch localization module to the 6.1 API and fixes a number of minor issues that arose while testing.
[FIX] check partner_id on statement line is defined before browsing further
[FIX] translation typo
[FIX] Do not write obsolete field 'code' to res.bank
[ADD] Write bic field to res.partner.bank when found
[FIX] Super() called with wrong object name
[FIX] Disable invalid (and unused) xpath expression
[RFR] Adapt NL Clieop module to API changes in 6.1
[FIX] Clieop export counter per day was always 1
--
https://code.launchpad.net/~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1/+merge/102061
Your team Banking Addons Team is subscribed to branch lp:~banking-addons-team/banking-addons/6.1-dev.
=== modified file 'account_banking/account_banking.py'
--- account_banking/account_banking.py 2012-04-12 17:42:11 +0000
+++ account_banking/account_banking.py 2012-04-16 07:46:20 +0000
@@ -1143,6 +1143,9 @@
def write(self, cr, uid, ids, vals, context=None):
'''
Create dual function IBAN account for SEPA countries
+
+ Update the domestic account number when the IBAN is
+ written, or clear the domestic number on regular account numbers.
'''
if ids and isinstance(ids, (int, long)):
ids = [ids]
@@ -1150,7 +1153,7 @@
cr, uid, ids, ['state', 'acc_number']):
if 'state' in vals or 'acc_number' in vals:
account.update(vals)
- if 'state' in vals and vals['state'] == 'iban':
+ if account['state'] == 'iban':
vals['acc_number'], vals['acc_number_domestic'] = (
self._correct_IBAN(account['acc_number']))
else:
@@ -1362,12 +1365,14 @@
bank_id, country_id = get_or_create_bank(
self.pool, cursor, uid,
info.bic or iban_acc.BIC_searchkey,
- code = info.code, name = info.bank
+ name = info.bank
)
values['country_id'] = country_id or \
country_ids and country_ids[0] or \
False
values['bank'] = bank_id or False
+ if info.bic:
+ values['bank_bic'] = info.bic
else:
info = None
if info is None:
=== modified file 'account_banking/banking_import_transaction.py'
--- account_banking/banking_import_transaction.py 2012-03-28 19:01:57 +0000
+++ account_banking/banking_import_transaction.py 2012-04-16 07:46:20 +0000
@@ -1844,7 +1844,7 @@
# Define the voucher
voucher = {
'journal_id': st_line.statement_id.journal_id.id,
- 'partner_id': st_line.partner_id.id,
+ 'partner_id': st_line.partner_id and st_line.partner_id.id,
'company_id': st_line.company_id.id,
'type':voucher_type,
'company_id': st_line.company_id.id,
@@ -1935,7 +1935,7 @@
for line in self.browse(cr, uid, ids, context=context):
if line.state == 'confirmed':
raise osv.except_osv(_('Confirmed Statement Line'), _("You cannot delete a confirmed Statement Line: '%s'" % line.name))
- return super(account_bank_statement,self).unlink(cr, uid, ids, context=context)
+ return super(account_bank_statement_line,self).unlink(cr, uid, ids, context=context)
account_bank_statement_line()
=== modified file 'account_banking/data/account_banking_data.xml'
--- account_banking/data/account_banking_data.xml 2012-02-19 21:10:20 +0000
+++ account_banking/data/account_banking_data.xml 2012-04-16 07:46:20 +0000
@@ -13,6 +13,13 @@
<field eval="False" name="required"/>
<field eval="False" name="readonly"/>
</record>
+ <!--
+ BIC is not legally required
+ See https://bugs.launchpad.net/bugs/933472
+ -->
+ <record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
+ <field eval="False" name="required"/>
+ </record>
<!-- 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>
=== modified file 'account_banking/i18n/nl.po'
--- account_banking/i18n/nl.po 2012-01-16 16:15:55 +0000
+++ account_banking/i18n/nl.po 2012-04-16 07:46:20 +0000
@@ -1192,7 +1192,7 @@
#: view:account.banking.imported.file:0
#: field:account.banking.imported.file,log:0
msgid "Import Log"
-msgstr "Impotlog"
+msgstr "Importlog"
#. module: account_banking
#: field:banking.import.line,date:0
=== modified file 'account_banking/wizard/banktools.py'
--- account_banking/wizard/banktools.py 2012-03-08 10:18:13 +0000
+++ account_banking/wizard/banktools.py 2012-04-16 07:46:20 +0000
@@ -373,6 +373,7 @@
if bic:
values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]
+ values.bank_bic = bic
# Create bank account and return
return pool.get('res.partner.bank').create(cursor, uid, values)
=== modified file 'account_banking_nl_clieop/account_banking_nl_clieop.py'
--- account_banking_nl_clieop/account_banking_nl_clieop.py 2011-07-21 11:30:59 +0000
+++ account_banking_nl_clieop/account_banking_nl_clieop.py 2012-04-16 07:46:20 +0000
@@ -59,7 +59,7 @@
('INCASSO', 'Direct Debit Batch'),
], 'File Type', size=7, readonly=True, select=True),
'date_generated':
- fields.datetime('Generation Date', readonly=True, select=True),
+ fields.date('Generation Date', readonly=True, select=True),
'file':
fields.binary('ClieOp File', readonly=True),
'state':
@@ -69,24 +69,26 @@
('done', 'Reconciled'),
], 'State', readonly=True),
}
- def _get_daynr(self, cursor, uid, ids, context):
+ def get_daynr(self, cr, uid, context=None):
'''
Return highest day number
'''
- last = cursor.execute('SELECT max(daynumber) '
- 'FROM banking_export_clieop '
- 'WHERE date_generated = "%s"' %
- date.today().strftime('%Y-%m-%d')
- ).fetchone()
- if last:
- return int(last) +1
- return 1
+ last = 1
+ last_ids = self.search(cr, uid, [
+ ('date_generated', '=',
+ fields.date.context_today(cr,uid,context))
+ ], context=context)
+ if last_ids:
+ last = 1 + max([x['daynumber'] for x in self.read(
+ cr, uid, last_ids, ['daynumber'],
+ context=context)])
+ return last
_defaults = {
- 'date_generated': lambda *a: date.today().strftime('%Y-%m-%d'),
- 'duplicates': lambda *a: 1,
- 'state': lambda *a: 'draft',
- 'daynumber': _get_daynr,
+ 'date_generated': fields.date.context_today,
+ 'duplicates': 1,
+ 'state': 'draft',
+ 'daynumber': get_daynr,
}
clieop_export()
=== modified file 'account_banking_nl_clieop/wizard/export_clieop.py'
--- account_banking_nl_clieop/wizard/export_clieop.py 2011-12-10 21:40:39 +0000
+++ account_banking_nl_clieop/wizard/export_clieop.py 2012-04-16 07:46:20 +0000
@@ -237,11 +237,15 @@
# Just once: create clieop file
our_account_owner = payment_order.mode.bank_id.owner_name \
or payment_order.mode.bank_id.partner_id.name
- our_account_nr = payment_order.mode.bank_id.acc_number
- if not our_account_nr and payment_order.mode.bank_id.iban:
- our_account_nr = sepa.IBAN(
- payment_order.mode.bank_id.iban
- ).localized_BBAN
+
+ if payment_order.mode.bank_id.state == 'iban':
+ our_account_nr = payment_order.mode.bank_id.acc_number_domestic
+ if not our_account_nr:
+ our_account_nr = sepa.IBAN(
+ payment_order.mode.bank_id.acc_number
+ ).localized_BBAN
+ else:
+ our_account_nr = payment_order.mode.bank_id.acc_number
if not our_account_nr:
raise osv.except_osv(
_('Error'),
@@ -255,6 +259,9 @@
execution_date = clieop_export['execution_date'],
name_sender = our_account_owner,
accountno_sender = our_account_nr,
+ seqno = self.pool.get(
+ 'banking.export.clieop').get_daynr(
+ cursor, uid, context=context),
test = clieop_export['test']
)
@@ -292,7 +299,11 @@
)
if line.communication2:
kwargs['messages'] = [line.communication2]
- other_account_nr = line.bank_id.acc_number
+ other_account_nr = (
+ line.bank_id.state == 'iban' and
+ line.bank_id.acc_number_domestic or
+ line.bank_id.acc_number
+ )
iban = sepa.IBAN(other_account_nr)
# Is this an IBAN account?
if iban.valid:
@@ -351,7 +362,7 @@
Cancel the ClieOp: just drop the file
'''
clieop_export = self.read(cursor, uid, ids, ['file_id'], context)[0]
- self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'])
+ self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'][0])
return {'type': 'ir.actions.act_window_close'}
def save_clieop(self, cursor, uid, ids, context):
=== modified file 'account_direct_debit/view/account_payment.xml'
--- account_direct_debit/view/account_payment.xml 2011-12-18 18:56:54 +0000
+++ account_direct_debit/view/account_payment.xml 2012-04-16 07:46:20 +0000
@@ -12,7 +12,8 @@
<field name="res_model">payment.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
- <field name="context">{'search_payment_order_type': 'debit'}</field>
+ <field name="context">{'search_payment_order_type': 'debit',
+ 'default_payment_order_type': 'debit'}</field>
<field name="search_view_id" ref="account_payment.view_payment_order_search"/>
<field name="domain">[('payment_order_type', '=', 'debit')]</field>
<field name="help">A debit order is a debit request from your company to collect customer invoices. Here you can register all debit orders that should be done, keep track of all debit orders and mention the invoice reference and the partner the withdrawal should be done for.</field>
@@ -45,10 +46,11 @@
icon="gtk-find"
/>
</xpath>
- <xpath expr="//tree[@string='Payment Line']" position="inside">
- <!-- the attrs do not work like this, apparently -->
- <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
- </xpath>
+ <!-- the attrs do not work like this, apparently
+ <xpath expr="//tree[@string='Payment Line']" position="inside">
+ <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
+ </xpath>
+ -->
</data>
</field>
</record>
=== modified file 'account_iban_preserve_domestic/res_partner_bank.py'
--- account_iban_preserve_domestic/res_partner_bank.py 2012-02-19 21:10:20 +0000
+++ account_iban_preserve_domestic/res_partner_bank.py 2012-04-16 07:46:20 +0000
@@ -7,6 +7,3 @@
'acc_number_domestic': fields.char(
'Domestic Account Number', size=64)
}
-
-res_partner_bank()
-
Follow ups