Merge lp:~therp-nl/banking-addons/6.0-iban-preserve-domestic into lp:~therp-nl/banking-addons/6.0-interactive-matching-and-debit-orders

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 109
Proposed branch: lp:~therp-nl/banking-addons/6.0-iban-preserve-domestic
Merge into: lp:~therp-nl/banking-addons/6.0-interactive-matching-and-debit-orders
Diff against target: 170 lines (+142/-0) (has conflicts)
4 files modified
account_banking/wizard/bank_import.py (+55/-0)
account_iban_preserve_domestic/__init__.py (+1/-0)
account_iban_preserve_domestic/__openerp__.py (+57/-0)
account_iban_preserve_domestic/res_partner_bank.py (+29/-0)
Text conflict in account_banking/wizard/bank_import.py
To merge this branch: bzr merge lp:~therp-nl/banking-addons/6.0-iban-preserve-domestic
Reviewer Review Type Date Requested Status
Therp Pending
Review via email: mp+93693@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/wizard/bank_import.py'
2--- account_banking/wizard/bank_import.py 2012-02-11 12:26:53 +0000
3+++ account_banking/wizard/bank_import.py 2012-02-18 14:34:19 +0000
4@@ -290,8 +290,63 @@
5
6 results.stat_loaded_cnt += 1
7
8+<<<<<<< TREE
9 import_transaction_obj.match(cursor, uid, transaction_ids, results=results, context=context)
10
11+=======
12+ #recompute statement end_balance for validation
13+ statement_obj.button_dummy(
14+ cursor, uid, imported_statement_ids, context=context)
15+
16+ if payment_lines:
17+ # As payments lines are treated as individual transactions, the
18+ # batch as a whole is only marked as 'done' when all payment lines
19+ # have been reconciled.
20+ cursor.execute(
21+ "SELECT DISTINCT o.id "
22+ "FROM payment_order o, payment_line l "
23+ "WHERE o.state = 'sent' "
24+ "AND o.id = l.order_id "
25+ "AND o.id NOT IN ("
26+ "SELECT DISTINCT order_id AS id "
27+ "FROM payment_line "
28+ "WHERE date_done IS NULL "
29+ "AND id IN (%s)"
30+ ")" % (','.join([str(x) for x in payment_line_ids]))
31+ )
32+ order_ids = [x[0] for x in cursor.fetchall()]
33+ if order_ids:
34+ # Use workflow logics for the orders. Recode logic from
35+ # account_payment, in order to increase efficiency.
36+ payment_order_obj.set_done(cursor, uid, order_ids,
37+ {'state': 'done'}
38+ )
39+ wf_service = netsvc.LocalService('workflow')
40+ for id in order_ids:
41+ wf_service.trg_validate(uid, 'payment.order', id, 'done',
42+ cursor
43+ )
44+
45+ # Original code. Didn't take workflow logistics into account...
46+ #
47+ #cursor.execute(
48+ # "UPDATE payment_order o "
49+ # "SET state = 'done', "
50+ # "date_done = '%s' "
51+ # "FROM payment_line l "
52+ # "WHERE o.state = 'sent' "
53+ # "AND o.id = l.order_id "
54+ # "AND l.id NOT IN ("
55+ # "SELECT DISTINCT id FROM payment_line "
56+ # "WHERE date_done IS NULL "
57+ # "AND id IN (%s)"
58+ # ")" % (
59+ # time.strftime('%Y-%m-%d'),
60+ # ','.join([str(x) for x in payment_line_ids])
61+ # )
62+ #)
63+
64+>>>>>>> MERGE-SOURCE
65 report = [
66 '%s: %s' % (_('Total number of statements'),
67 results.stat_skipped_cnt + results.stat_loaded_cnt),
68
69=== added directory 'account_iban_preserve_domestic'
70=== added file 'account_iban_preserve_domestic/__init__.py'
71--- account_iban_preserve_domestic/__init__.py 1970-01-01 00:00:00 +0000
72+++ account_iban_preserve_domestic/__init__.py 2012-02-18 14:34:19 +0000
73@@ -0,0 +1,1 @@
74+import res_partner_bank
75
76=== added file 'account_iban_preserve_domestic/__openerp__.py'
77--- account_iban_preserve_domestic/__openerp__.py 1970-01-01 00:00:00 +0000
78+++ account_iban_preserve_domestic/__openerp__.py 2012-02-18 14:34:19 +0000
79@@ -0,0 +1,57 @@
80+##############################################################################
81+#
82+# Copyright (C) 2012 Therp BV (<http://therp.nl>).
83+#
84+# All other contributions are (C) by their respective contributors
85+#
86+# All Rights Reserved
87+#
88+# WARNING: This program as such is intended to be used by professional
89+# programmers who take the whole responsability of assessing all potential
90+# consequences resulting from its eventual inadequacies and bugs
91+# End users who are looking for a ready-to-use solution with commercial
92+# garantees and support are strongly adviced to contract EduSense BV
93+#
94+# This program is free software: you can redistribute it and/or modify
95+# it under the terms of the GNU General Public License as published by
96+# the Free Software Foundation, either version 3 of the License, or
97+# (at your option) any later version.
98+#
99+# This program is distributed in the hope that it will be useful,
100+# but WITHOUT ANY WARRANTY; without even the implied warranty of
101+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102+# GNU General Public License for more details.
103+#
104+# You should have received a copy of the GNU General Public License
105+# along with this program. If not, see <http://www.gnu.org/licenses/>.
106+#
107+##############################################################################
108+{
109+ 'name': 'Preserve domestic bank account number',
110+ 'version': '0.1',
111+ 'license': 'GPL-3',
112+ 'author': 'Therp BV',
113+ 'website': 'https://launchpad.net/banking-addons',
114+ 'category': 'Banking addons',
115+ 'depends': ['base_iban'],
116+ 'init_xml': [],
117+ 'update_xml': [],
118+ 'demo_xml': [],
119+ 'description': '''
120+This module is compatible with OpenERP 6.0.
121+
122+The IBAN module in OpenERP 6.1 registers the IBAN
123+on the same field as the domestic account number,
124+instead of keeping both on separate fields as is the
125+case in 6.0. That means that an upgrade to OpenERP 6.1
126+makes you lose this information. If you want to keep
127+the domestic account number in addition to the IBAN,
128+install this module prior to the upgrade to OpenERP 6.1.
129+
130+Do *not* install this version of the module on OpenERP 6.1.
131+A dedicated module for OpenERP 6.1 will be available that
132+allows you to access the domestic account number.
133+ ''',
134+ 'active': False,
135+ 'installable': True,
136+}
137
138=== added file 'account_iban_preserve_domestic/res_partner_bank.py'
139--- account_iban_preserve_domestic/res_partner_bank.py 1970-01-01 00:00:00 +0000
140+++ account_iban_preserve_domestic/res_partner_bank.py 2012-02-18 14:34:19 +0000
141@@ -0,0 +1,29 @@
142+from osv import fields,osv
143+class res_partner_bank(osv.osv):
144+ '''Bank Accounts'''
145+ _inherit = "res.partner.bank"
146+
147+ def _get_domestic(self, cr, uid, ids, prop, unknow_none, context=None):
148+ import pdb
149+ pdb.set_trace()
150+ res = dict(
151+ [(x['id'], x['acc_number'])
152+ for x in self.read(cr, uid, ids, ['acc_number'], context=context)
153+ ]
154+ )
155+ return res
156+
157+ _columns = {
158+ 'acc_number_domestic': fields.function(
159+ _get_domestic, method=True, type="char",
160+ size=64, string='Domestic Account Number',
161+ store = {
162+ 'res.partner.bank':(
163+ lambda self,cr,uid,ids,c={}:ids,
164+ ['acc_number'], 10),
165+ },
166+ ),
167+ }
168+
169+res_partner_bank()
170+

Subscribers

People subscribed via source and target branches

to all changes: