Merge lp:~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1 into lp:~banking-addons-team/banking-addons/6.1-dev

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Approved by: James Jesudason
Approved revision: 126
Merged at revision: 127
Proposed branch: lp:~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1
Merge into: lp:~banking-addons-team/banking-addons/6.1-dev
Diff against target: 263 lines (+60/-35)
9 files modified
account_banking/account_banking.py (+7/-2)
account_banking/banking_import_transaction.py (+3/-3)
account_banking/data/account_banking_data.xml (+7/-0)
account_banking/i18n/nl.po (+1/-1)
account_banking/wizard/banktools.py (+1/-0)
account_banking_nl_clieop/account_banking_nl_clieop.py (+16/-14)
account_banking_nl_clieop/wizard/export_clieop.py (+18/-7)
account_direct_debit/view/account_payment.xml (+7/-5)
account_iban_preserve_domestic/res_partner_bank.py (+0/-3)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/6.1-dev-fixes_from_testing_iteration_1
Reviewer Review Type Date Requested Status
James Jesudason (community) Approve
Review via email: mp+102061@code.launchpad.net

Commit message

[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

Description of the change

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

To post a comment you must log in.
126. By Stefan Rijnhart (Opener)

[FIX] Assign False, not browse_null as empty value for new record

Revision history for this message
James Jesudason (jamesj) wrote :

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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-17 11:02:17 +0000
@@ -1143,6 +1143,9 @@
1143 def write(self, cr, uid, ids, vals, context=None):1143 def write(self, cr, uid, ids, vals, context=None):
1144 '''1144 '''
1145 Create dual function IBAN account for SEPA countries1145 Create dual function IBAN account for SEPA countries
1146
1147 Update the domestic account number when the IBAN is
1148 written, or clear the domestic number on regular account numbers.
1146 '''1149 '''
1147 if ids and isinstance(ids, (int, long)):1150 if ids and isinstance(ids, (int, long)):
1148 ids = [ids]1151 ids = [ids]
@@ -1150,7 +1153,7 @@
1150 cr, uid, ids, ['state', 'acc_number']):1153 cr, uid, ids, ['state', 'acc_number']):
1151 if 'state' in vals or 'acc_number' in vals:1154 if 'state' in vals or 'acc_number' in vals:
1152 account.update(vals)1155 account.update(vals)
1153 if 'state' in vals and vals['state'] == 'iban':1156 if account['state'] == 'iban':
1154 vals['acc_number'], vals['acc_number_domestic'] = (1157 vals['acc_number'], vals['acc_number_domestic'] = (
1155 self._correct_IBAN(account['acc_number']))1158 self._correct_IBAN(account['acc_number']))
1156 else:1159 else:
@@ -1362,12 +1365,14 @@
1362 bank_id, country_id = get_or_create_bank(1365 bank_id, country_id = get_or_create_bank(
1363 self.pool, cursor, uid,1366 self.pool, cursor, uid,
1364 info.bic or iban_acc.BIC_searchkey,1367 info.bic or iban_acc.BIC_searchkey,
1365 code = info.code, name = info.bank1368 name = info.bank
1366 )1369 )
1367 values['country_id'] = country_id or \1370 values['country_id'] = country_id or \
1368 country_ids and country_ids[0] or \1371 country_ids and country_ids[0] or \
1369 False1372 False
1370 values['bank'] = bank_id or False1373 values['bank'] = bank_id or False
1374 if info.bic:
1375 values['bank_bic'] = info.bic
1371 else:1376 else:
1372 info = None1377 info = None
1373 if info is None:1378 if info is None:
13741379
=== 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-17 11:02:17 +0000
@@ -1515,7 +1515,7 @@
1515 stline_pool = self.pool.get('account.bank.statement.line')1515 stline_pool = self.pool.get('account.bank.statement.line')
15161516
1517 res = {}1517 res = {}
1518 1518
1519 for transaction in self.browse(cr, uid, ids, context):1519 for transaction in self.browse(cr, uid, ids, context):
15201520
1521 if transaction.move_line_id:1521 if transaction.move_line_id:
@@ -1844,7 +1844,7 @@
1844 # Define the voucher1844 # Define the voucher
1845 voucher = {1845 voucher = {
1846 'journal_id': st_line.statement_id.journal_id.id,1846 'journal_id': st_line.statement_id.journal_id.id,
1847 'partner_id': st_line.partner_id.id,1847 'partner_id': st_line.partner_id and st_line.partner_id.id or False,
1848 'company_id': st_line.company_id.id,1848 'company_id': st_line.company_id.id,
1849 'type':voucher_type,1849 'type':voucher_type,
1850 'company_id': st_line.company_id.id,1850 'company_id': st_line.company_id.id,
@@ -1935,7 +1935,7 @@
1935 for line in self.browse(cr, uid, ids, context=context):1935 for line in self.browse(cr, uid, ids, context=context):
1936 if line.state == 'confirmed':1936 if line.state == 'confirmed':
1937 raise osv.except_osv(_('Confirmed Statement Line'), _("You cannot delete a confirmed Statement Line: '%s'" % line.name))1937 raise osv.except_osv(_('Confirmed Statement Line'), _("You cannot delete a confirmed Statement Line: '%s'" % line.name))
1938 return super(account_bank_statement,self).unlink(cr, uid, ids, context=context)1938 return super(account_bank_statement_line,self).unlink(cr, uid, ids, context=context)
19391939
1940account_bank_statement_line()1940account_bank_statement_line()
19411941
19421942
=== 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-17 11:02:17 +0000
@@ -13,6 +13,13 @@
13 <field eval="False" name="required"/>13 <field eval="False" name="required"/>
14 <field eval="False" name="readonly"/>14 <field eval="False" name="readonly"/>
15 </record>15 </record>
16 <!--
17 BIC is not legally required
18 See https://bugs.launchpad.net/bugs/933472
19 -->
20 <record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
21 <field eval="False" name="required"/>
22 </record>
16 <!-- Add manual bank transfer as default payment option -->23 <!-- Add manual bank transfer as default payment option -->
17 <record model="payment.mode.type" id="account_banking.manual_bank_tranfer">24 <record model="payment.mode.type" id="account_banking.manual_bank_tranfer">
18 <field name="name">Manual Bank Transfer</field>25 <field name="name">Manual Bank Transfer</field>
1926
=== 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-17 11:02:17 +0000
@@ -1192,7 +1192,7 @@
1192#: view:account.banking.imported.file:01192#: view:account.banking.imported.file:0
1193#: field:account.banking.imported.file,log:01193#: field:account.banking.imported.file,log:0
1194msgid "Import Log"1194msgid "Import Log"
1195msgstr "Impotlog"1195msgstr "Importlog"
11961196
1197#. module: account_banking1197#. module: account_banking
1198#: field:banking.import.line,date:01198#: field:banking.import.line,date:0
11991199
=== 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-17 11:02:17 +0000
@@ -373,6 +373,7 @@
373373
374 if bic:374 if bic:
375 values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]375 values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]
376 values.bank_bic = bic
376377
377 # Create bank account and return378 # Create bank account and return
378 return pool.get('res.partner.bank').create(cursor, uid, values)379 return pool.get('res.partner.bank').create(cursor, uid, values)
379380
=== 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-17 11:02:17 +0000
@@ -59,7 +59,7 @@
59 ('INCASSO', 'Direct Debit Batch'),59 ('INCASSO', 'Direct Debit Batch'),
60 ], 'File Type', size=7, readonly=True, select=True),60 ], 'File Type', size=7, readonly=True, select=True),
61 'date_generated':61 'date_generated':
62 fields.datetime('Generation Date', readonly=True, select=True),62 fields.date('Generation Date', readonly=True, select=True),
63 'file':63 'file':
64 fields.binary('ClieOp File', readonly=True),64 fields.binary('ClieOp File', readonly=True),
65 'state':65 'state':
@@ -69,24 +69,26 @@
69 ('done', 'Reconciled'),69 ('done', 'Reconciled'),
70 ], 'State', readonly=True),70 ], 'State', readonly=True),
71 }71 }
72 def _get_daynr(self, cursor, uid, ids, context):72 def get_daynr(self, cr, uid, context=None):
73 '''73 '''
74 Return highest day number74 Return highest day number
75 '''75 '''
76 last = cursor.execute('SELECT max(daynumber) '76 last = 1
77 'FROM banking_export_clieop '77 last_ids = self.search(cr, uid, [
78 'WHERE date_generated = "%s"' % 78 ('date_generated', '=',
79 date.today().strftime('%Y-%m-%d')79 fields.date.context_today(cr,uid,context))
80 ).fetchone()80 ], context=context)
81 if last:81 if last_ids:
82 return int(last) +182 last = 1 + max([x['daynumber'] for x in self.read(
83 return 183 cr, uid, last_ids, ['daynumber'],
84 context=context)])
85 return last
8486
85 _defaults = {87 _defaults = {
86 'date_generated': lambda *a: date.today().strftime('%Y-%m-%d'),88 'date_generated': fields.date.context_today,
87 'duplicates': lambda *a: 1,89 'duplicates': 1,
88 'state': lambda *a: 'draft',90 'state': 'draft',
89 'daynumber': _get_daynr,91 'daynumber': get_daynr,
90 }92 }
91clieop_export()93clieop_export()
9294
9395
=== 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-17 11:02:17 +0000
@@ -237,11 +237,15 @@
237 # Just once: create clieop file237 # Just once: create clieop file
238 our_account_owner = payment_order.mode.bank_id.owner_name \238 our_account_owner = payment_order.mode.bank_id.owner_name \
239 or payment_order.mode.bank_id.partner_id.name239 or payment_order.mode.bank_id.partner_id.name
240 our_account_nr = payment_order.mode.bank_id.acc_number240
241 if not our_account_nr and payment_order.mode.bank_id.iban:241 if payment_order.mode.bank_id.state == 'iban':
242 our_account_nr = sepa.IBAN(242 our_account_nr = payment_order.mode.bank_id.acc_number_domestic
243 payment_order.mode.bank_id.iban243 if not our_account_nr:
244 ).localized_BBAN244 our_account_nr = sepa.IBAN(
245 payment_order.mode.bank_id.acc_number
246 ).localized_BBAN
247 else:
248 our_account_nr = payment_order.mode.bank_id.acc_number
245 if not our_account_nr:249 if not our_account_nr:
246 raise osv.except_osv(250 raise osv.except_osv(
247 _('Error'),251 _('Error'),
@@ -255,6 +259,9 @@
255 execution_date = clieop_export['execution_date'],259 execution_date = clieop_export['execution_date'],
256 name_sender = our_account_owner,260 name_sender = our_account_owner,
257 accountno_sender = our_account_nr,261 accountno_sender = our_account_nr,
262 seqno = self.pool.get(
263 'banking.export.clieop').get_daynr(
264 cursor, uid, context=context),
258 test = clieop_export['test']265 test = clieop_export['test']
259 )266 )
260267
@@ -292,7 +299,11 @@
292 )299 )
293 if line.communication2:300 if line.communication2:
294 kwargs['messages'] = [line.communication2]301 kwargs['messages'] = [line.communication2]
295 other_account_nr = line.bank_id.acc_number302 other_account_nr = (
303 line.bank_id.state == 'iban' and
304 line.bank_id.acc_number_domestic or
305 line.bank_id.acc_number
306 )
296 iban = sepa.IBAN(other_account_nr)307 iban = sepa.IBAN(other_account_nr)
297 # Is this an IBAN account?308 # Is this an IBAN account?
298 if iban.valid:309 if iban.valid:
@@ -351,7 +362,7 @@
351 Cancel the ClieOp: just drop the file362 Cancel the ClieOp: just drop the file
352 '''363 '''
353 clieop_export = self.read(cursor, uid, ids, ['file_id'], context)[0]364 clieop_export = self.read(cursor, uid, ids, ['file_id'], context)[0]
354 self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'])365 self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'][0])
355 return {'type': 'ir.actions.act_window_close'}366 return {'type': 'ir.actions.act_window_close'}
356367
357 def save_clieop(self, cursor, uid, ids, context):368 def save_clieop(self, cursor, uid, ids, context):
358369
=== 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-17 11:02:17 +0000
@@ -12,7 +12,8 @@
12 <field name="res_model">payment.order</field>12 <field name="res_model">payment.order</field>
13 <field name="view_type">form</field>13 <field name="view_type">form</field>
14 <field name="view_mode">tree,form</field>14 <field name="view_mode">tree,form</field>
15 <field name="context">{'search_payment_order_type': 'debit'}</field>15 <field name="context">{'search_payment_order_type': 'debit',
16 'default_payment_order_type': 'debit'}</field>
16 <field name="search_view_id" ref="account_payment.view_payment_order_search"/>17 <field name="search_view_id" ref="account_payment.view_payment_order_search"/>
17 <field name="domain">[('payment_order_type', '=', 'debit')]</field>18 <field name="domain">[('payment_order_type', '=', 'debit')]</field>
18 <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>19 <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 @@
45 icon="gtk-find"46 icon="gtk-find"
46 />47 />
47 </xpath>48 </xpath>
48 <xpath expr="//tree[@string='Payment Line']" position="inside">49 <!-- the attrs do not work like this, apparently
49 <!-- the attrs do not work like this, apparently -->50 <xpath expr="//tree[@string='Payment Line']" position="inside">
50 <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>51 <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
51 </xpath>52 </xpath>
53 -->
52 </data>54 </data>
53 </field>55 </field>
54 </record>56 </record>
5557
=== 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-17 11:02:17 +0000
@@ -7,6 +7,3 @@
7 'acc_number_domestic': fields.char(7 'acc_number_domestic': fields.char(
8 'Domestic Account Number', size=64)8 'Domestic Account Number', size=64)
9 }9 }
10
11res_partner_bank()
12

Subscribers

People subscribed via source and target branches