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
1=== modified file 'account_banking/account_banking.py'
2--- account_banking/account_banking.py 2012-04-12 17:42:11 +0000
3+++ account_banking/account_banking.py 2012-04-17 11:02:17 +0000
4@@ -1143,6 +1143,9 @@
5 def write(self, cr, uid, ids, vals, context=None):
6 '''
7 Create dual function IBAN account for SEPA countries
8+
9+ Update the domestic account number when the IBAN is
10+ written, or clear the domestic number on regular account numbers.
11 '''
12 if ids and isinstance(ids, (int, long)):
13 ids = [ids]
14@@ -1150,7 +1153,7 @@
15 cr, uid, ids, ['state', 'acc_number']):
16 if 'state' in vals or 'acc_number' in vals:
17 account.update(vals)
18- if 'state' in vals and vals['state'] == 'iban':
19+ if account['state'] == 'iban':
20 vals['acc_number'], vals['acc_number_domestic'] = (
21 self._correct_IBAN(account['acc_number']))
22 else:
23@@ -1362,12 +1365,14 @@
24 bank_id, country_id = get_or_create_bank(
25 self.pool, cursor, uid,
26 info.bic or iban_acc.BIC_searchkey,
27- code = info.code, name = info.bank
28+ name = info.bank
29 )
30 values['country_id'] = country_id or \
31 country_ids and country_ids[0] or \
32 False
33 values['bank'] = bank_id or False
34+ if info.bic:
35+ values['bank_bic'] = info.bic
36 else:
37 info = None
38 if info is None:
39
40=== modified file 'account_banking/banking_import_transaction.py'
41--- account_banking/banking_import_transaction.py 2012-03-28 19:01:57 +0000
42+++ account_banking/banking_import_transaction.py 2012-04-17 11:02:17 +0000
43@@ -1515,7 +1515,7 @@
44 stline_pool = self.pool.get('account.bank.statement.line')
45
46 res = {}
47-
48+
49 for transaction in self.browse(cr, uid, ids, context):
50
51 if transaction.move_line_id:
52@@ -1844,7 +1844,7 @@
53 # Define the voucher
54 voucher = {
55 'journal_id': st_line.statement_id.journal_id.id,
56- 'partner_id': st_line.partner_id.id,
57+ 'partner_id': st_line.partner_id and st_line.partner_id.id or False,
58 'company_id': st_line.company_id.id,
59 'type':voucher_type,
60 'company_id': st_line.company_id.id,
61@@ -1935,7 +1935,7 @@
62 for line in self.browse(cr, uid, ids, context=context):
63 if line.state == 'confirmed':
64 raise osv.except_osv(_('Confirmed Statement Line'), _("You cannot delete a confirmed Statement Line: '%s'" % line.name))
65- return super(account_bank_statement,self).unlink(cr, uid, ids, context=context)
66+ return super(account_bank_statement_line,self).unlink(cr, uid, ids, context=context)
67
68 account_bank_statement_line()
69
70
71=== modified file 'account_banking/data/account_banking_data.xml'
72--- account_banking/data/account_banking_data.xml 2012-02-19 21:10:20 +0000
73+++ account_banking/data/account_banking_data.xml 2012-04-17 11:02:17 +0000
74@@ -13,6 +13,13 @@
75 <field eval="False" name="required"/>
76 <field eval="False" name="readonly"/>
77 </record>
78+ <!--
79+ BIC is not legally required
80+ See https://bugs.launchpad.net/bugs/933472
81+ -->
82+ <record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
83+ <field eval="False" name="required"/>
84+ </record>
85 <!-- Add manual bank transfer as default payment option -->
86 <record model="payment.mode.type" id="account_banking.manual_bank_tranfer">
87 <field name="name">Manual Bank Transfer</field>
88
89=== modified file 'account_banking/i18n/nl.po'
90--- account_banking/i18n/nl.po 2012-01-16 16:15:55 +0000
91+++ account_banking/i18n/nl.po 2012-04-17 11:02:17 +0000
92@@ -1192,7 +1192,7 @@
93 #: view:account.banking.imported.file:0
94 #: field:account.banking.imported.file,log:0
95 msgid "Import Log"
96-msgstr "Impotlog"
97+msgstr "Importlog"
98
99 #. module: account_banking
100 #: field:banking.import.line,date:0
101
102=== modified file 'account_banking/wizard/banktools.py'
103--- account_banking/wizard/banktools.py 2012-03-08 10:18:13 +0000
104+++ account_banking/wizard/banktools.py 2012-04-17 11:02:17 +0000
105@@ -373,6 +373,7 @@
106
107 if bic:
108 values.bank = get_or_create_bank(pool, cursor, uid, bic)[0]
109+ values.bank_bic = bic
110
111 # Create bank account and return
112 return pool.get('res.partner.bank').create(cursor, uid, values)
113
114=== modified file 'account_banking_nl_clieop/account_banking_nl_clieop.py'
115--- account_banking_nl_clieop/account_banking_nl_clieop.py 2011-07-21 11:30:59 +0000
116+++ account_banking_nl_clieop/account_banking_nl_clieop.py 2012-04-17 11:02:17 +0000
117@@ -59,7 +59,7 @@
118 ('INCASSO', 'Direct Debit Batch'),
119 ], 'File Type', size=7, readonly=True, select=True),
120 'date_generated':
121- fields.datetime('Generation Date', readonly=True, select=True),
122+ fields.date('Generation Date', readonly=True, select=True),
123 'file':
124 fields.binary('ClieOp File', readonly=True),
125 'state':
126@@ -69,24 +69,26 @@
127 ('done', 'Reconciled'),
128 ], 'State', readonly=True),
129 }
130- def _get_daynr(self, cursor, uid, ids, context):
131+ def get_daynr(self, cr, uid, context=None):
132 '''
133 Return highest day number
134 '''
135- last = cursor.execute('SELECT max(daynumber) '
136- 'FROM banking_export_clieop '
137- 'WHERE date_generated = "%s"' %
138- date.today().strftime('%Y-%m-%d')
139- ).fetchone()
140- if last:
141- return int(last) +1
142- return 1
143+ last = 1
144+ last_ids = self.search(cr, uid, [
145+ ('date_generated', '=',
146+ fields.date.context_today(cr,uid,context))
147+ ], context=context)
148+ if last_ids:
149+ last = 1 + max([x['daynumber'] for x in self.read(
150+ cr, uid, last_ids, ['daynumber'],
151+ context=context)])
152+ return last
153
154 _defaults = {
155- 'date_generated': lambda *a: date.today().strftime('%Y-%m-%d'),
156- 'duplicates': lambda *a: 1,
157- 'state': lambda *a: 'draft',
158- 'daynumber': _get_daynr,
159+ 'date_generated': fields.date.context_today,
160+ 'duplicates': 1,
161+ 'state': 'draft',
162+ 'daynumber': get_daynr,
163 }
164 clieop_export()
165
166
167=== modified file 'account_banking_nl_clieop/wizard/export_clieop.py'
168--- account_banking_nl_clieop/wizard/export_clieop.py 2011-12-10 21:40:39 +0000
169+++ account_banking_nl_clieop/wizard/export_clieop.py 2012-04-17 11:02:17 +0000
170@@ -237,11 +237,15 @@
171 # Just once: create clieop file
172 our_account_owner = payment_order.mode.bank_id.owner_name \
173 or payment_order.mode.bank_id.partner_id.name
174- our_account_nr = payment_order.mode.bank_id.acc_number
175- if not our_account_nr and payment_order.mode.bank_id.iban:
176- our_account_nr = sepa.IBAN(
177- payment_order.mode.bank_id.iban
178- ).localized_BBAN
179+
180+ if payment_order.mode.bank_id.state == 'iban':
181+ our_account_nr = payment_order.mode.bank_id.acc_number_domestic
182+ if not our_account_nr:
183+ our_account_nr = sepa.IBAN(
184+ payment_order.mode.bank_id.acc_number
185+ ).localized_BBAN
186+ else:
187+ our_account_nr = payment_order.mode.bank_id.acc_number
188 if not our_account_nr:
189 raise osv.except_osv(
190 _('Error'),
191@@ -255,6 +259,9 @@
192 execution_date = clieop_export['execution_date'],
193 name_sender = our_account_owner,
194 accountno_sender = our_account_nr,
195+ seqno = self.pool.get(
196+ 'banking.export.clieop').get_daynr(
197+ cursor, uid, context=context),
198 test = clieop_export['test']
199 )
200
201@@ -292,7 +299,11 @@
202 )
203 if line.communication2:
204 kwargs['messages'] = [line.communication2]
205- other_account_nr = line.bank_id.acc_number
206+ other_account_nr = (
207+ line.bank_id.state == 'iban' and
208+ line.bank_id.acc_number_domestic or
209+ line.bank_id.acc_number
210+ )
211 iban = sepa.IBAN(other_account_nr)
212 # Is this an IBAN account?
213 if iban.valid:
214@@ -351,7 +362,7 @@
215 Cancel the ClieOp: just drop the file
216 '''
217 clieop_export = self.read(cursor, uid, ids, ['file_id'], context)[0]
218- self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'])
219+ self.pool.get('banking.export.clieop').unlink(cursor, uid, clieop_export['file_id'][0])
220 return {'type': 'ir.actions.act_window_close'}
221
222 def save_clieop(self, cursor, uid, ids, context):
223
224=== modified file 'account_direct_debit/view/account_payment.xml'
225--- account_direct_debit/view/account_payment.xml 2011-12-18 18:56:54 +0000
226+++ account_direct_debit/view/account_payment.xml 2012-04-17 11:02:17 +0000
227@@ -12,7 +12,8 @@
228 <field name="res_model">payment.order</field>
229 <field name="view_type">form</field>
230 <field name="view_mode">tree,form</field>
231- <field name="context">{'search_payment_order_type': 'debit'}</field>
232+ <field name="context">{'search_payment_order_type': 'debit',
233+ 'default_payment_order_type': 'debit'}</field>
234 <field name="search_view_id" ref="account_payment.view_payment_order_search"/>
235 <field name="domain">[('payment_order_type', '=', 'debit')]</field>
236 <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>
237@@ -45,10 +46,11 @@
238 icon="gtk-find"
239 />
240 </xpath>
241- <xpath expr="//tree[@string='Payment Line']" position="inside">
242- <!-- the attrs do not work like this, apparently -->
243- <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
244- </xpath>
245+ <!-- the attrs do not work like this, apparently
246+ <xpath expr="//tree[@string='Payment Line']" position="inside">
247+ <field name="storno" attrs="{'invisible': [(parent.payment_order_type, '!=', 'debit')]}"/>
248+ </xpath>
249+ -->
250 </data>
251 </field>
252 </record>
253
254=== modified file 'account_iban_preserve_domestic/res_partner_bank.py'
255--- account_iban_preserve_domestic/res_partner_bank.py 2012-02-19 21:10:20 +0000
256+++ account_iban_preserve_domestic/res_partner_bank.py 2012-04-17 11:02:17 +0000
257@@ -7,6 +7,3 @@
258 'acc_number_domestic': fields.char(
259 'Domestic Account Number', size=64)
260 }
261-
262-res_partner_bank()
263-

Subscribers

People subscribed via source and target branches