Merge lp:~therp-nl/banking-addons/ba7.0-MIG-import into lp:banking-addons
- ba7.0-MIG-import
- Merge into banking-addons-70
Status: | Merged |
---|---|
Merged at revision: | 166 |
Proposed branch: | lp:~therp-nl/banking-addons/ba7.0-MIG-import |
Merge into: | lp:banking-addons |
Prerequisite: | lp:~therp-nl/banking-addons/ba7.0-RFR-split_off_payment_part |
Diff against target: |
3727 lines (+583/-1203) 57 files modified
account_banking/__init__.py (+3/-3) account_banking/__openerp__.py (+10/-17) account_banking/account_banking.py (+165/-345) account_banking/account_banking_view.xml (+69/-181) account_banking/banking_import_transaction.py (+72/-74) account_banking/migrations/0.1.81/post-set-statement-line-state.py (+3/-3) account_banking/parsers/__init__.py (+3/-3) account_banking/parsers/convert.py (+4/-4) account_banking/parsers/models.py (+3/-3) account_banking/record.py (+3/-3) account_banking/sepa/__init__.py (+3/-3) account_banking/sepa/iban.py (+3/-3) account_banking/sepa/online.py (+3/-3) account_banking/sepa/postalcode.py (+3/-3) account_banking/sepa/urlagent.py (+3/-3) account_banking/struct.py (+3/-3) account_banking/wizard/__init__.py (+3/-3) account_banking/wizard/bank_import.py (+29/-37) account_banking/wizard/banking_transaction_wizard.py (+14/-12) account_banking/wizard/banktools.py (+38/-66) account_banking_fi_patu/__init__.py (+3/-3) account_banking_fi_patu/__openerp__.py (+4/-4) account_banking_fi_patu/patu.py (+3/-3) account_banking_nl_abnamro/__init__.py (+1/-30) account_banking_nl_abnamro/__openerp__.py (+12/-23) account_banking_nl_abnamro/__terp__.py (+0/-53) account_banking_nl_abnamro/abnamro.py (+14/-13) account_banking_nl_clieop/__init__.py (+3/-3) account_banking_nl_clieop/__openerp__.py (+6/-15) account_banking_nl_clieop/account_banking_nl_clieop.py (+3/-3) account_banking_nl_clieop/migrations/0.63/post-fill-ir_model_id.py (+3/-3) account_banking_nl_clieop/migrations/0.64/post-set-payment-order-type.py (+3/-3) account_banking_nl_clieop/wizard/__init__.py (+3/-3) account_banking_nl_clieop/wizard/clieop.py (+3/-3) account_banking_nl_clieop/wizard/export_clieop.py (+3/-3) account_banking_nl_girotel/__init__.py (+3/-3) account_banking_nl_girotel/__openerp__.py (+5/-14) account_banking_nl_girotel/girotel.py (+3/-3) account_banking_nl_ing/__init__.py (+1/-3) account_banking_nl_ing/__openerp__.py (+8/-19) account_banking_nl_ing/__terp__.py (+0/-58) account_banking_nl_ing/ing.py (+10/-10) account_banking_nl_multibank/__init__.py (+3/-3) account_banking_nl_multibank/__openerp__.py (+8/-18) account_banking_nl_multibank/multibank.py (+3/-3) account_banking_nl_triodos/__init__.py (+3/-3) account_banking_nl_triodos/__openerp__.py (+6/-19) account_banking_nl_triodos/__terp__.py (+0/-58) account_banking_nl_triodos/triodos.py (+3/-3) account_banking_uk_hsbc/__openerp__.py (+2/-5) account_banking_uk_hsbc/account_banking_uk_hsbc.py (+3/-3) account_banking_uk_hsbc/wizard/__init__.py (+3/-3) account_banking_uk_hsbc/wizard/export_hsbc.py (+3/-3) account_banking_uk_hsbc/wizard/paymul.py (+3/-3) account_banking_uk_hsbc/wizard/paymul_test.py (+3/-3) account_direct_debit/__openerp__.py (+5/-14) account_payment_shortcut/__openerp__.py (+4/-15) |
To merge this branch: | bzr merge lp:~therp-nl/banking-addons/ba7.0-MIG-import |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Holger Brunn (Therp) | code review, no test | Approve | |
Guewen Baconnier @ Camptocamp | Approve | ||
Alexandre Fayolle - camptocamp | code review, no test | Needs Fixing | |
Review via email: mp+158654@code.launchpad.net |
Commit message
[MIG] Adapt bank statement import to 7.0 API, views
[LIC] Relicense as AGPL
[IMP] Create partners as suppliers if amount < 0
Description of the change
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote : | # |
- 199. By Stefan Rijnhart (Opener)
-
[RFR] Refactor out wildcard imports
[RFR] Use API to get period - 200. By Stefan Rijnhart (Opener)
-
[RFR] Update comment
Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
Hi Alexandre,
totally agreed. I refactored out this legacy wildcard import.
AB stands for Account Banking, the name of the original project. It was used to mark custom lines in the create_
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
There is conflict on lines 2678..2707.
Besides that, seems fine to me.
Can you resolve the conflict and resubmit please?
Thanks
- 201. By Stefan Rijnhart (Opener)
-
[MRG] Merged with prerequisite branch and resolved conflicts
Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
Hi Guewen,
thanks for the review! I resolved the conflict with the prerequisite branch.
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : | # |
Thanks, LGTM
Holger Brunn (Therp) (hbrunn) wrote : | # |
Just found a minor one that comes from the old code, so I approve anyways:
#1640: replace inside translation string
- 202. By Stefan Rijnhart (Opener)
-
[FIX] Variable substitution inside call to _()
Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
Thanks, fixed that rightaway
Preview Diff
1 | === modified file 'account_banking/__init__.py' |
2 | --- account_banking/__init__.py 2012-01-16 16:15:55 +0000 |
3 | +++ account_banking/__init__.py 2013-05-06 14:07:28 +0000 |
4 | @@ -11,16 +11,16 @@ |
5 | # garantees and support are strongly adviced to contract EduSense BV |
6 | # |
7 | # This program is free software: you can redistribute it and/or modify |
8 | -# it under the terms of the GNU General Public License as published by |
9 | +# it under the terms of the GNU Affero General Public License as published by |
10 | # the Free Software Foundation, either version 3 of the License, or |
11 | # (at your option) any later version. |
12 | # |
13 | # This program is distributed in the hope that it will be useful, |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | -# GNU General Public License for more details. |
17 | +# GNU Affero General Public License for more details. |
18 | # |
19 | -# You should have received a copy of the GNU General Public License |
20 | +# You should have received a copy of the GNU Affero General Public License |
21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | # |
23 | ############################################################################## |
24 | |
25 | === modified file 'account_banking/__openerp__.py' |
26 | --- account_banking/__openerp__.py 2013-05-06 14:07:27 +0000 |
27 | +++ account_banking/__openerp__.py 2013-05-06 14:07:28 +0000 |
28 | @@ -1,3 +1,4 @@ |
29 | +# -*- coding: utf-8 -*- |
30 | ############################################################################## |
31 | # |
32 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
33 | @@ -8,30 +9,25 @@ |
34 | # |
35 | # All Rights Reserved |
36 | # |
37 | -# WARNING: This program as such is intended to be used by professional |
38 | -# programmers who take the whole responsability of assessing all potential |
39 | -# consequences resulting from its eventual inadequacies and bugs |
40 | -# End users who are looking for a ready-to-use solution with commercial |
41 | -# garantees and support are strongly adviced to contract EduSense BV |
42 | -# |
43 | # This program is free software: you can redistribute it and/or modify |
44 | -# it under the terms of the GNU General Public License as published by |
45 | -# the Free Software Foundation, either version 3 of the License, or |
46 | -# (at your option) any later version. |
47 | +# it under the terms of the GNU Affero General Public License as |
48 | +# published by the Free Software Foundation, either version 3 of the |
49 | +# License, or (at your option) any later version. |
50 | # |
51 | # This program is distributed in the hope that it will be useful, |
52 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
53 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
54 | -# GNU General Public License for more details. |
55 | +# GNU Affero General Public License for more details. |
56 | # |
57 | -# You should have received a copy of the GNU General Public License |
58 | +# You should have received a copy of the GNU Affero General Public License |
59 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
60 | # |
61 | ############################################################################## |
62 | + |
63 | { |
64 | 'name': 'Account Banking', |
65 | 'version': '0.1.136', |
66 | - 'license': 'GPL-3', |
67 | + 'license': 'AGPL-3', |
68 | 'author': 'Banking addons community', |
69 | 'website': 'https://launchpad.net/banking-addons', |
70 | 'category': 'Banking addons', |
71 | @@ -39,8 +35,7 @@ |
72 | 'account_voucher', |
73 | 'account_iban_preserve_domestic', |
74 | ], |
75 | - 'init_xml': [], |
76 | - 'update_xml': [ |
77 | + 'data': [ |
78 | 'security/ir.model.access.csv', |
79 | 'data/account_banking_data.xml', |
80 | 'wizard/bank_import_view.xml', |
81 | @@ -48,7 +43,6 @@ |
82 | 'wizard/banking_transaction_wizard.xml', |
83 | 'workflow/account_invoice.xml', |
84 | ], |
85 | - 'demo_xml': [], |
86 | 'external_dependencies': { |
87 | 'python' : ['BeautifulSoup'], |
88 | }, |
89 | @@ -107,6 +101,5 @@ |
90 | + No special configuration needed for the parsers, new parsers are |
91 | recognized and made available at server (re)start. |
92 | ''', |
93 | - 'active': False, |
94 | - 'installable': False, |
95 | + 'installable': True, |
96 | } |
97 | |
98 | === modified file 'account_banking/account_banking.py' |
99 | --- account_banking/account_banking.py 2013-05-06 14:07:27 +0000 |
100 | +++ account_banking/account_banking.py 2013-05-06 14:07:28 +0000 |
101 | @@ -1,20 +1,24 @@ |
102 | -# -*- encoding: utf-8 -*- |
103 | +# -*- coding: utf-8 -*- |
104 | ############################################################################## |
105 | # |
106 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
107 | +# (C) 2011 - 2013 Therp BV (<http://therp.nl>). |
108 | +# |
109 | +# All other contributions are (C) by their respective contributors |
110 | +# |
111 | # All Rights Reserved |
112 | # |
113 | # This program is free software: you can redistribute it and/or modify |
114 | -# it under the terms of the GNU General Public License as published by |
115 | -# the Free Software Foundation, either version 3 of the License, or |
116 | -# (at your option) any later version. |
117 | +# it under the terms of the GNU Affero General Public License as |
118 | +# published by the Free Software Foundation, either version 3 of the |
119 | +# License, or (at your option) any later version. |
120 | # |
121 | # This program is distributed in the hope that it will be useful, |
122 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
123 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
124 | -# GNU General Public License for more details. |
125 | +# GNU Affero General Public License for more details. |
126 | # |
127 | -# You should have received a copy of the GNU General Public License |
128 | +# You should have received a copy of the GNU Affero General Public License |
129 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
130 | # |
131 | ############################################################################## |
132 | @@ -57,20 +61,20 @@ |
133 | default behavior is to flag the orders as 'sent', not as 'done'. |
134 | Rejected payments from the bank receive on import the status 'rejected'. |
135 | ''' |
136 | -import time |
137 | -import sepa |
138 | -from osv import osv, fields |
139 | -from tools.translate import _ |
140 | -from wizard.banktools import get_or_create_bank |
141 | -import decimal_precision as dp |
142 | -import netsvc |
143 | -from openerp import SUPERUSER_ID |
144 | + |
145 | +from openerp.osv import orm, fields |
146 | +from openerp.tools.translate import _ |
147 | +from openerp import netsvc, SUPERUSER_ID |
148 | +from openerp.addons.decimal_precision import decimal_precision as dp |
149 | +from openerp.addons.account_banking import sepa |
150 | +from openerp.addons.account_banking.wizard.banktools import get_or_create_bank |
151 | |
152 | def warning(title, message): |
153 | '''Convenience routine''' |
154 | return {'warning': {'title': title, 'message': message}} |
155 | |
156 | -class account_banking_account_settings(osv.osv): |
157 | + |
158 | +class account_banking_account_settings(orm.Model): |
159 | '''Default Journal for Bank Account''' |
160 | _name = 'account.banking.account.settings' |
161 | _description = __doc__ |
162 | @@ -122,13 +126,6 @@ |
163 | ), |
164 | ), |
165 | |
166 | - #'multi_currency': fields.boolean( |
167 | - # 'Multi Currency Bank Account', required=True, |
168 | - # help=('Select this if your bank account is able to handle ' |
169 | - # 'multiple currencies in parallel without coercing to ' |
170 | - # 'a single currency.' |
171 | - # ), |
172 | - #), |
173 | } |
174 | |
175 | def _default_company(self, cr, uid, context=None): |
176 | @@ -162,7 +159,8 @@ |
177 | if not company_id: |
178 | company_id = self._default_company(cr, uid, context=context) |
179 | partner_id = self.pool.get('res.company').read( |
180 | - cr, uid, company_id, ['partner_id'], context=context)['partner_id'][0] |
181 | + cr, uid, company_id, ['partner_id'], |
182 | + context=context)['partner_id'][0] |
183 | bank_ids = self.pool.get('res.partner.bank').search( |
184 | cr, uid, [('partner_id', '=', partner_id)], context=context) |
185 | return bank_ids and bank_ids[0] or False |
186 | @@ -177,7 +175,8 @@ |
187 | 'res.partner', context=localcontext) |
188 | return account_def and account_def.id or False |
189 | |
190 | - def _default_credit_account_id(self, cr, uid, context=None, company_id=False): |
191 | + def _default_credit_account_id( |
192 | + self, cr, uid, context=None, company_id=False): |
193 | localcontext = context and context.copy() or {} |
194 | localcontext['force_company'] = ( |
195 | company_id or self._default_company(cr, uid, context=context)) |
196 | @@ -187,9 +186,9 @@ |
197 | return account_def and account_def.id or False |
198 | |
199 | def find(self, cr, uid, journal_id, partner_bank_id=False, context=None): |
200 | - domain = [('journal_id','=',journal_id)] |
201 | + domain = [('journal_id', '=', journal_id)] |
202 | if partner_bank_id: |
203 | - domain.append(('partner_bank_id','=',partner_bank_id)) |
204 | + domain.append(('partner_bank_id', '=', partner_bank_id)) |
205 | return self.search(cr, uid, domain, context=context) |
206 | |
207 | def onchange_partner_bank_id( |
208 | @@ -225,11 +224,11 @@ |
209 | 'default_debit_account_id': _default_debit_account_id, |
210 | 'default_credit_account_id': _default_credit_account_id, |
211 | 'partner_bank_id': _default_partner_bank_id, |
212 | - #'multi_currency': lambda *a: False, |
213 | } |
214 | account_banking_account_settings() |
215 | |
216 | -class account_banking_imported_file(osv.osv): |
217 | + |
218 | +class account_banking_imported_file(orm.Model): |
219 | '''Imported Bank Statements File''' |
220 | _name = 'account.banking.imported.file' |
221 | _description = __doc__ |
222 | @@ -267,12 +266,13 @@ |
223 | ), |
224 | } |
225 | _defaults = { |
226 | - 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
227 | + 'date': fields.date.context_today, |
228 | 'user_id': lambda self, cursor, uid, context: uid, |
229 | } |
230 | account_banking_imported_file() |
231 | |
232 | -class account_bank_statement(osv.osv): |
233 | + |
234 | +class account_bank_statement(orm.Model): |
235 | ''' |
236 | Extensions from account_bank_statement: |
237 | 1. Removed period_id (transformed to optional boolean) - as it is no |
238 | @@ -285,45 +285,6 @@ |
239 | ''' |
240 | _inherit = 'account.bank.statement' |
241 | _order = 'id' |
242 | - _abf_others = [] |
243 | - _abf_others_loaded = False |
244 | - |
245 | - def __init__(self, *args, **kwargs): |
246 | - ''' |
247 | - See where we stand in the order of things |
248 | - ''' |
249 | - super(account_bank_statement, self).__init__(*args, **kwargs) |
250 | - if not self._abf_others_loaded: |
251 | - self._abf_others_loaded = True |
252 | - self._abf_others = [x for x in self.__class__.__mro__ |
253 | - if x.__module__.split('.')[0] not in [ |
254 | - 'osv', 'account', 'account_banking', |
255 | - '__builtin__' |
256 | - ] |
257 | - ] |
258 | - |
259 | - #def _currency(self, cursor, user, ids, name, args, context=None): |
260 | - # ''' |
261 | - # Calculate currency from contained transactions |
262 | - # ''' |
263 | - # res = {} |
264 | - # res_currency_obj = self.pool.get('res.currency') |
265 | - # res_users_obj = self.pool.get('res.users') |
266 | - # default_currency = res_users_obj.browse(cursor, user, |
267 | - # user, context=context).company_id.currency_id |
268 | - # for statement in self.browse(cursor, user, ids, context=context): |
269 | - # currency = statement.journal_id.currency |
270 | - # if not currency: |
271 | - # currency = default_currency |
272 | - # res[statement.id] = currency.id |
273 | - # currency_names = {} |
274 | - # for currency_id, currency_name in res_currency_obj.name_get(cursor, |
275 | - # user, res.values(), context=context): |
276 | - # currency_names[currency_id] = currency_name |
277 | - # for statement_id in res.keys(): |
278 | - # currency_id = res[statement_id] |
279 | - # res[statement_id] = (currency_id, currency_names[currency_id]) |
280 | - # return res |
281 | |
282 | _columns = { |
283 | 'period_id': fields.many2one('account.period', 'Period', |
284 | @@ -331,13 +292,10 @@ |
285 | 'banking_id': fields.many2one('account.banking.imported.file', |
286 | 'Imported File', readonly=True, |
287 | ), |
288 | - # 'currency': fields.function(_currency, method=True, string='Currency', |
289 | - # type='many2one', relation='res.currency'), |
290 | } |
291 | |
292 | _defaults = { |
293 | - 'period_id': lambda *a: False, |
294 | - # 'currency': _currency, |
295 | + 'period_id': False, |
296 | } |
297 | |
298 | def _check_company_id(self, cr, uid, ids, context=None): |
299 | @@ -346,19 +304,21 @@ |
300 | move of period_id to the statement line |
301 | """ |
302 | for statement in self.browse(cr, uid, ids, context=context): |
303 | - if (statement.period_id and |
304 | - statement.company_id.id != statement.period_id.company_id.id): |
305 | - return False |
306 | for line in statement.line_ids: |
307 | if (line.period_id and |
308 | statement.company_id.id != line.period_id.company_id.id): |
309 | return False |
310 | - return True |
311 | + if not statement.period_id: |
312 | + statement.write({'period_id': line.period_id.id}) |
313 | + return super(account_bank_statement, self)._check_company_id( |
314 | + cr, uid, ids, context=context) |
315 | |
316 | # Redefine the constraint, or it still refer to the original method |
317 | _constraints = [ |
318 | - (_check_company_id, 'The journal and period chosen have to belong to the same company.', ['journal_id','period_id']), |
319 | - ] |
320 | + (_check_company_id, |
321 | + 'The journal and period chosen have to belong to the same company.', |
322 | + ['journal_id','period_id']), |
323 | + ] |
324 | |
325 | def _get_period(self, cursor, uid, date, context=None): |
326 | ''' |
327 | @@ -368,231 +328,141 @@ |
328 | periods = period_obj.find(cursor, uid, dt=date, context=context) |
329 | return periods and periods[0] or False |
330 | |
331 | - #def compute(self, cursor, uid, ids, context=None): |
332 | - # ''' |
333 | - # Compute start and end balance with mixed currencies. |
334 | - # ''' |
335 | - # return None |
336 | + def _prepare_move( |
337 | + self, cr, uid, st_line, st_line_number, context=None): |
338 | + """ |
339 | + Add the statement line's period to the move, overwriting |
340 | + the period on the statement |
341 | + """ |
342 | + res = super(account_bank_statement, self)._prepare_move( |
343 | + cr, uid, st_line, st_line_number, context=context) |
344 | + if context and context.get('period_id'): |
345 | + res['period_id'] = context['period_id'] |
346 | + return res |
347 | + |
348 | + def _prepare_move_line_vals( |
349 | + self, cr, uid, st_line, move_id, debit, credit, currency_id=False, |
350 | + amount_currency=False, account_id=False, analytic_id=False, |
351 | + partner_id=False, context=None): |
352 | + """ |
353 | + Add the statement line's period to the move lines, overwriting |
354 | + the period on the statement |
355 | + """ |
356 | + res = super(account_bank_statement, self)._prepare_move_line_vals( |
357 | + cr, uid, st_line, move_id, debit, credit, currency_id=currency_id, |
358 | + amount_currency=amount_currency, account_id=account_id, |
359 | + analytic_id=analytic_id, partner_id=partner_id, context=context) |
360 | + if context and context.get('period_id'): |
361 | + res['period_id'] = context['period_id'] |
362 | + return res |
363 | |
364 | def create_move_from_st_line(self, cr, uid, st_line_id, |
365 | company_currency_id, st_line_number, |
366 | context=None): |
367 | - # This is largely a copy of the original code in account |
368 | - # Modifications are marked with AB |
369 | - # Modifications by account_voucher are merged below. |
370 | - # As there is no valid inheritance mechanism for large actions, this |
371 | - # is the only option to add functionality to existing actions. |
372 | - # WARNING: when the original code changes, this trigger has to be |
373 | - # updated in sync. |
374 | - |
375 | if context is None: |
376 | context = {} |
377 | - res_currency_obj = self.pool.get('res.currency') |
378 | account_move_obj = self.pool.get('account.move') |
379 | account_move_line_obj = self.pool.get('account.move.line') |
380 | account_bank_statement_line_obj = self.pool.get( |
381 | 'account.bank.statement.line') |
382 | st_line = account_bank_statement_line_obj.browse( |
383 | cr, uid, st_line_id, context=context) |
384 | + |
385 | + # Take period from statement line and write to context |
386 | + # this will be picked up by the _prepare_move* methods |
387 | period_id = self._get_period( |
388 | - cr, uid, st_line.date, context=context) # AB |
389 | - # Start account voucher |
390 | - # Post the voucher and update links between statement and moves |
391 | + cr, uid, st_line.date, context=context) |
392 | + localctx = context.copy() |
393 | + localctx['period_id'] = period_id |
394 | + |
395 | + # Write date & period on the voucher, delegate to account_voucher's |
396 | + # override of this method. Then post the related move and return. |
397 | if st_line.voucher_id: |
398 | voucher_pool = self.pool.get('account.voucher') |
399 | - wf_service = netsvc.LocalService("workflow") |
400 | voucher_pool.write( |
401 | cr, uid, [st_line.voucher_id.id], { |
402 | - 'number': st_line_number, |
403 | 'date': st_line.date, |
404 | - 'period_id': period_id, # AB |
405 | + 'period_id': period_id, |
406 | }, context=context) |
407 | - if st_line.voucher_id.state == 'cancel': |
408 | - voucher_pool.action_cancel_draft( |
409 | - cr, uid, [st_line.voucher_id.id], context=context) |
410 | - wf_service.trg_validate( |
411 | - uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr) |
412 | - v = voucher_pool.browse( |
413 | - cr, uid, st_line.voucher_id.id, context=context) |
414 | - account_bank_statement_line_obj.write(cr, uid, [st_line_id], { |
415 | - 'move_ids': [(4, v.move_id.id, False)] |
416 | - }) |
417 | - account_move_line_obj.write( |
418 | - cr, uid, [x.id for x in v.move_ids], |
419 | - {'statement_id': st_line.statement_id.id}, context=context) |
420 | - # End of account_voucher |
421 | - st_line.refresh() |
422 | - |
423 | - # AB: The voucher journal isn't automatically posted, so post it (if needed) |
424 | + |
425 | + res = super(account_bank_statement, self).create_move_from_st_line( |
426 | + cr, uid, st_line_id, company_currency_id, st_line_number, |
427 | + context=localctx) |
428 | + |
429 | + st_line.refresh() |
430 | + if st_line.voucher_id: |
431 | if not st_line.voucher_id.journal_id.entry_posted: |
432 | - account_move_obj.post(cr, uid, [st_line.voucher_id.move_id.id], context={}) |
433 | - return True |
434 | - |
435 | - st = st_line.statement_id |
436 | - |
437 | - context.update({'date': st_line.date}) |
438 | - ctxt = context.copy() # AB |
439 | - ctxt['company_id'] = st_line.company_id.id # AB |
440 | - |
441 | - move_id = account_move_obj.create(cr, uid, { |
442 | - 'journal_id': st.journal_id.id, |
443 | - 'period_id': period_id, # AB |
444 | - 'date': st_line.date, |
445 | - 'name': st_line_number, |
446 | - }, context=context) |
447 | - account_bank_statement_line_obj.write(cr, uid, [st_line.id], { |
448 | - 'move_ids': [(4, move_id, False)] |
449 | - }) |
450 | - |
451 | - torec = [] |
452 | - if st_line.amount >= 0: |
453 | - account_id = st.journal_id.default_credit_account_id.id |
454 | + account_move_obj.post( |
455 | + cr, uid, [st_line.voucher_id.move_id.id], context={}) |
456 | else: |
457 | - account_id = st.journal_id.default_debit_account_id.id |
458 | - |
459 | - acc_cur = ((st_line.amount <= 0 and |
460 | - st.journal_id.default_debit_account_id) or |
461 | - st_line.account_id) |
462 | - context.update({ |
463 | - 'res.currency.compute.account': acc_cur, |
464 | - }) |
465 | - amount = res_currency_obj.compute(cr, uid, st.currency.id, |
466 | - company_currency_id, st_line.amount, context=context) |
467 | - |
468 | - val = { |
469 | - 'name': st_line.name, |
470 | - 'date': st_line.date, |
471 | - 'ref': st_line.ref, |
472 | - 'move_id': move_id, |
473 | - 'partner_id': (((st_line.partner_id) and st_line.partner_id.id) or |
474 | - False), |
475 | - 'account_id': (st_line.account_id) and st_line.account_id.id, |
476 | - 'credit': ((amount>0) and amount) or 0.0, |
477 | - 'debit': ((amount<0) and -amount) or 0.0, |
478 | - 'statement_id': st.id, |
479 | - 'journal_id': st.journal_id.id, |
480 | - 'period_id': period_id, # AB |
481 | - 'currency_id': st.currency.id, |
482 | - 'analytic_account_id': (st_line.analytic_account_id and |
483 | - st_line.analytic_account_id.id or |
484 | - False), |
485 | - } |
486 | - |
487 | - if st.currency.id <> company_currency_id: |
488 | - amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, |
489 | - st.currency.id, amount, context=context) |
490 | - val['amount_currency'] = -amount_cur |
491 | - |
492 | - if (st_line.account_id and st_line.account_id.currency_id and |
493 | - st_line.account_id.currency_id.id <> company_currency_id): |
494 | - val['currency_id'] = st_line.account_id.currency_id.id |
495 | - amount_cur = res_currency_obj.compute(cr, uid, company_currency_id, |
496 | - st_line.account_id.currency_id.id, amount, context=context) |
497 | - val['amount_currency'] = -amount_cur |
498 | - |
499 | - move_line_id = account_move_line_obj.create( |
500 | - cr, uid, val, context=context) |
501 | - torec.append(move_line_id) |
502 | - |
503 | - # Fill the secondary amount/currency |
504 | - # if currency is not the same than the company |
505 | - amount_currency = False |
506 | - currency_id = False |
507 | - if st.currency.id <> company_currency_id: |
508 | - amount_currency = st_line.amount |
509 | - currency_id = st.currency.id |
510 | - account_move_line_obj.create(cr, uid, { |
511 | - 'name': st_line.name, |
512 | - 'date': st_line.date, |
513 | - 'ref': st_line.ref, |
514 | - 'move_id': move_id, |
515 | - 'partner_id': (((st_line.partner_id) and st_line.partner_id.id) or |
516 | - False), |
517 | - 'account_id': account_id, |
518 | - 'credit': ((amount < 0) and -amount) or 0.0, |
519 | - 'debit': ((amount > 0) and amount) or 0.0, |
520 | - 'statement_id': st.id, |
521 | - 'journal_id': st.journal_id.id, |
522 | - 'period_id': period_id, # AB |
523 | - 'amount_currency': amount_currency, |
524 | - 'currency_id': currency_id, |
525 | - }, context=context) |
526 | - |
527 | - for line in account_move_line_obj.browse(cr, uid, [x.id for x in |
528 | - account_move_obj.browse(cr, uid, move_id, |
529 | - context=context).line_id], |
530 | - context=context): |
531 | - if line.state <> 'valid': |
532 | - raise osv.except_osv(_('Error !'), |
533 | - _('Journal Item "%s" is not valid') % line.name) |
534 | - |
535 | - # Bank statements will not consider boolean on journal entry_posted |
536 | - account_move_obj.post(cr, uid, [move_id], context=context) |
537 | - |
538 | - """ |
539 | - Account-banking: |
540 | - - Write stored reconcile_id |
541 | - - Pay invoices through workflow |
542 | - |
543 | - Does not apply to voucher integration, but only to |
544 | - payments and payment orders |
545 | - """ |
546 | - if st_line.reconcile_id: |
547 | - account_move_line_obj.write(cr, uid, torec, { |
548 | - (st_line.reconcile_id.line_partial_ids and |
549 | - 'reconcile_partial_id' or 'reconcile_id'): |
550 | - st_line.reconcile_id.id }, context=context) |
551 | - for move_line in (st_line.reconcile_id.line_id or []) + ( |
552 | - st_line.reconcile_id.line_partial_ids or []): |
553 | - netsvc.LocalService("workflow").trg_trigger( |
554 | - uid, 'account.move.line', move_line.id, cr) |
555 | - #""" End account-banking """ |
556 | - |
557 | - return move_id |
558 | + # Write stored reconcile_id and pay invoices through workflow |
559 | + if st_line.reconcile_id: |
560 | + move_ids = [move.id for move in st_line.move_ids] |
561 | + torec = account_move_obj.search( |
562 | + cr, uid, [ |
563 | + ('move_id', 'in', move_ids), |
564 | + ('account_id', '=', st_line.account_id.id)], |
565 | + context=context) |
566 | + account_move_line_obj.write(cr, uid, torec, { |
567 | + (st_line.reconcile_id.line_partial_ids and |
568 | + 'reconcile_partial_id' or 'reconcile_id'): |
569 | + st_line.reconcile_id.id }, context=context) |
570 | + for move_line in (st_line.reconcile_id.line_id or []) + ( |
571 | + st_line.reconcile_id.line_partial_ids or []): |
572 | + netsvc.LocalService("workflow").trg_trigger( |
573 | + uid, 'account.move.line', move_line.id, cr) |
574 | + return res |
575 | |
576 | def button_confirm_bank(self, cr, uid, ids, context=None): |
577 | - if context is None: context = {} |
578 | + """ |
579 | + Assign journal sequence to statements without a name |
580 | + """ |
581 | + if context is None: |
582 | + context = {} |
583 | obj_seq = self.pool.get('ir.sequence') |
584 | - if not isinstance(ids, list): ids = [ids] |
585 | - noname_ids = self.search(cr, uid, [('id','in',ids),('name','=','/')]) |
586 | + if ids and isinstance(ids, (int, long)): |
587 | + ids = [ids] |
588 | + noname_ids = self.search( |
589 | + cr, uid, [('id', 'in', ids),('name', '=', '/')], |
590 | + context=context) |
591 | for st in self.browse(cr, uid, noname_ids, context=context): |
592 | - if st.journal_id.sequence_id: |
593 | - year = self.pool.get('account.period').browse(cr, uid, self._get_period(cr, uid, st.date)).fiscalyear_id.id |
594 | - c = {'fiscalyear_id': year} |
595 | - st_number = obj_seq.get_id(cr, uid, st.journal_id.sequence_id.id, context=c) |
596 | - self.write(cr, uid, ids, {'name': st_number}) |
597 | + if st.journal_id.sequence_id: |
598 | + period_id = self._get_period(cr, uid, st.date) |
599 | + year = self.pool.get('account.period').browse( |
600 | + cr, uid, period_id, context=context).fiscalyear_id.id |
601 | + c = {'fiscalyear_id': year} |
602 | + st_number = obj_seq.get_id( |
603 | + cr, uid, st.journal_id.sequence_id.id, context=c) |
604 | + self.write( |
605 | + cr, uid, ids, {'name': st_number}, context=context) |
606 | |
607 | - return super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context) |
608 | + return super(account_bank_statement, self).button_confirm_bank( |
609 | + cr, uid, ids, context) |
610 | |
611 | account_bank_statement() |
612 | |
613 | -class account_voucher(osv.osv): |
614 | + |
615 | +class account_voucher(orm.Model): |
616 | _inherit = 'account.voucher' |
617 | |
618 | def _get_period(self, cr, uid, context=None): |
619 | - if context is None: context = {} |
620 | + if context is None: |
621 | + context = {} |
622 | if not context.get('period_id') and context.get('move_line_ids'): |
623 | - res = self.pool.get('account.move.line').browse(cr, uid , context.get('move_line_ids'))[0].period_id.id |
624 | - context['period_id'] = res |
625 | + return self.pool.get('account.move.line').browse( |
626 | + cr, uid , context.get('move_line_ids'))[0].period_id.id |
627 | return super(account_voucher, self)._get_period(cr, uid, context) |
628 | |
629 | - def create(self, cr, uid, values, context=None): |
630 | - if values.get('period_id') == False and context.get('move_line_ids'): |
631 | - values['period_id'] = self._get_period(cr, uid, context) |
632 | - return super(account_voucher, self).create(cr, uid, values, context) |
633 | - |
634 | account_voucher() |
635 | |
636 | -class account_bank_statement_line(osv.osv): |
637 | + |
638 | +class account_bank_statement_line(orm.Model): |
639 | ''' |
640 | Extension on basic class: |
641 | 1. Extra links to account.period and res.partner.bank for tracing and |
642 | matching. |
643 | 2. Extra 'trans' field to carry the transaction id of the bank. |
644 | - 3. Extra 'international' flag to indicate the missing of a remote |
645 | - account number. Some banks use seperate international banking |
646 | - modules that do not integrate with the standard transaction files. |
647 | - 4. Readonly states for most fields except when in draft. |
648 | + 3. Readonly states for most fields except when in draft. |
649 | ''' |
650 | _inherit = 'account.bank.statement.line' |
651 | _description = 'Bank Transaction' |
652 | @@ -602,26 +472,6 @@ |
653 | periods = self.pool.get('account.period').find(cursor, user, dt=date) |
654 | return periods and periods[0] or False |
655 | |
656 | - def _seems_international(self, cursor, user, context=None): |
657 | - ''' |
658 | - Some banks have seperate international banking modules which do not |
659 | - translate correctly into the national formats. Instead, they |
660 | - leave key fields blank and signal this anomaly with a special |
661 | - transfer type. |
662 | - With the introduction of SEPA, this may worsen greatly, as SEPA |
663 | - payments are considered to be analogous to international payments |
664 | - by most local formats. |
665 | - ''' |
666 | - # Quick and dirty check: if remote bank account is missing, assume |
667 | - # international transfer |
668 | - return not ( |
669 | - context.get('partner_bank_id') and context['partner_bank_id'] |
670 | - ) |
671 | - # Not so dirty check: check if partner_id is set. If it is, check the |
672 | - # default/invoice addresses country. If it is the same as our |
673 | - # company's, its local, else international. |
674 | - # TODO: to be done |
675 | - |
676 | def _get_currency(self, cursor, user, context=None): |
677 | ''' |
678 | Get the default currency (required to allow other modules to function, |
679 | @@ -633,30 +483,6 @@ |
680 | return res_users_obj.browse(cursor, user, user, |
681 | context=context).company_id.currency_id.id |
682 | |
683 | - #def _reconcile_amount(self, cursor, user, ids, name, args, context=None): |
684 | - # ''' |
685 | - # Redefinition from the original: don't use the statements currency, but |
686 | - # the transactions currency. |
687 | - # ''' |
688 | - # if not ids: |
689 | - # return {} |
690 | - |
691 | - # res_currency_obj = self.pool.get('res.currency') |
692 | - # res_users_obj = self.pool.get('res.users') |
693 | - |
694 | - # res = {} |
695 | - # company_currency_id = res_users_obj.browse(cursor, user, user, |
696 | - # context=context).company_id.currency_id.id |
697 | - |
698 | - # for line in self.browse(cursor, user, ids, context=context): |
699 | - # if line.reconcile_id: |
700 | - # res[line.id] = res_currency_obj.compute(cursor, user, |
701 | - # company_currency_id, line.currency.id, |
702 | - # line.reconcile_id.total_entry, context=context) |
703 | - # else: |
704 | - # res[line.id] = 0.0 |
705 | - # return res |
706 | - |
707 | def _get_invoice_id(self, cr, uid, ids, name, args, context=None): |
708 | res = {} |
709 | for st_line in self.browse(cr, uid, ids, context): |
710 | @@ -674,7 +500,7 @@ |
711 | return res |
712 | |
713 | _columns = { |
714 | - # Redefines |
715 | + # Redefines. Todo: refactor away to view attrs |
716 | 'amount': fields.float('Amount', readonly=True, |
717 | digits_compute=dp.get_precision('Account'), |
718 | states={'draft': [('readonly', False)]}), |
719 | @@ -684,8 +510,6 @@ |
720 | states={'draft': [('readonly', False)]}), |
721 | 'date': fields.date('Date', required=True, readonly=True, |
722 | states={'draft': [('readonly', False)]}), |
723 | - #'reconcile_amount': fields.function(_reconcile_amount, |
724 | - # string='Amount reconciled', method=True, type='float'), |
725 | |
726 | # New columns |
727 | 'trans': fields.char('Bank Transaction ID', size=15, required=False, |
728 | @@ -700,12 +524,6 @@ |
729 | states={'confirmed': [('readonly', True)]}), |
730 | 'currency': fields.many2one('res.currency', 'Currency', required=True, |
731 | states={'confirmed': [('readonly', True)]}), |
732 | - |
733 | - # Not used yet, but usefull in the future. |
734 | - 'international': fields.boolean('International Transaction', |
735 | - required=False, |
736 | - states={'confirmed': [('readonly', True)]}, |
737 | - ), |
738 | 'reconcile_id': fields.many2one( |
739 | 'account.move.reconcile', 'Reconciliation', readonly=True |
740 | ), |
741 | @@ -717,14 +535,13 @@ |
742 | |
743 | _defaults = { |
744 | 'period_id': _get_period, |
745 | - 'international': _seems_international, |
746 | 'currency': _get_currency, |
747 | } |
748 | |
749 | account_bank_statement_line() |
750 | |
751 | |
752 | -class res_partner_bank(osv.osv): |
753 | +class res_partner_bank(orm.Model): |
754 | ''' |
755 | This is a hack to circumvent the very limited but widely used base_iban |
756 | dependency. The usage of __mro__ requires inside information of |
757 | @@ -754,15 +571,13 @@ |
758 | self._founder.__init__(*args, **kwargs) |
759 | mro = self.__class__.__mro__ |
760 | for i in range(len(mro)): |
761 | - if mro[i].__module__.startswith('base.'): |
762 | + if mro[i].__module__.startswith('openerp.addons.base.'): |
763 | self._founder = mro[i] |
764 | break |
765 | |
766 | def init(self, cr): |
767 | ''' |
768 | Update existing iban accounts to comply to new regime |
769 | - Note that usage of the ORM is not possible here, as the ORM cannot |
770 | - search on values not provided by the client. |
771 | ''' |
772 | |
773 | partner_bank_obj = self.pool.get('res.partner.bank') |
774 | @@ -795,10 +610,11 @@ |
775 | Create dual function IBAN account for SEPA countries |
776 | ''' |
777 | if vals.get('state') == 'iban': |
778 | - iban = vals.get('acc_number',False) or vals.get('acc_number_domestic',False) |
779 | + iban = (vals.get('acc_number') |
780 | + or vals.get('acc_number_domestic', False)) |
781 | vals['acc_number'], vals['acc_number_domestic'] = ( |
782 | self._correct_IBAN(iban)) |
783 | - return self._founder.create(cursor, uid, vals, context) |
784 | + return self._founder.create(self, cursor, uid, vals, context) |
785 | |
786 | def write(self, cr, uid, ids, vals, context=None): |
787 | ''' |
788 | @@ -818,7 +634,7 @@ |
789 | self._correct_IBAN(account['acc_number'])) |
790 | else: |
791 | vals['acc_number_domestic'] = False |
792 | - self._founder.write(cr, uid, account['id'], vals, context) |
793 | + self._founder.write(self, cr, uid, account['id'], vals, context) |
794 | return True |
795 | |
796 | def search(self, cursor, uid, args, *rest, **kwargs): |
797 | @@ -880,10 +696,9 @@ |
798 | # Extend search filter |
799 | newargs = extended_search_expression(args) |
800 | |
801 | - # Original search (_founder) |
802 | - results = self._founder.search(cursor, uid, newargs, |
803 | - *rest, **kwargs |
804 | - ) |
805 | + # Original search |
806 | + results = super(res_partner_bank, self).search( |
807 | + cursor, uid, newargs, *rest, **kwargs) |
808 | return results |
809 | |
810 | def read( |
811 | @@ -894,7 +709,7 @@ |
812 | ''' |
813 | if fields and 'state' not in fields: |
814 | fields.append('state') |
815 | - records = self._founder.read(cr, uid, ids, fields, context, load) |
816 | + records = self._founder.read(self, cr, uid, ids, fields, context, load) |
817 | is_list = True |
818 | if not isinstance(records, list): |
819 | records = [records,] |
820 | @@ -954,6 +769,9 @@ |
821 | Trigger to find IBAN. When found: |
822 | 1. Reformat BBAN |
823 | 2. Autocomplete bank |
824 | + |
825 | + TODO: prevent unnecessary assignment of country_ids and |
826 | + browsing of the country |
827 | ''' |
828 | if not acc_number: |
829 | return {} |
830 | @@ -1013,6 +831,7 @@ |
831 | if country_ids: |
832 | country = country_obj.browse( |
833 | cursor, uid, country_ids[0], context=context) |
834 | + values['country_id'] = country_ids[0] |
835 | if country and country.code in sepa.IBAN.countries: |
836 | try: |
837 | info = sepa.online.account_info(country.code, acc_number) |
838 | @@ -1027,9 +846,8 @@ |
839 | info.bic or iban_acc.BIC_searchkey, |
840 | name = info.bank |
841 | ) |
842 | - values['country_id'] = country_id or \ |
843 | - country_ids and country_ids[0] or \ |
844 | - False |
845 | + if country_id: |
846 | + values['country_id'] = country_id |
847 | values['bank'] = bank_id or False |
848 | if info.bic: |
849 | values['bank_bic'] = info.bic |
850 | @@ -1038,8 +856,8 @@ |
851 | if info is None: |
852 | result.update(warning( |
853 | _('Invalid data'), |
854 | - _('The account number appears to be invalid for %(country)s') |
855 | - % {'country': country.name} |
856 | + _('The account number appears to be invalid for %s') |
857 | + % country.name |
858 | )) |
859 | except NotImplementedError: |
860 | if country.code in sepa.IBAN.countries: |
861 | @@ -1049,8 +867,8 @@ |
862 | else: |
863 | result.update(warning( |
864 | _('Invalid format'), |
865 | - _('The account number has the wrong format for %(country)s') |
866 | - % {'country': country.name} |
867 | + _('The account number has the wrong format for %s') |
868 | + % country.name |
869 | )) |
870 | return result |
871 | |
872 | @@ -1083,15 +901,10 @@ |
873 | _("The IBAN number doesn't seem to be correct") |
874 | ) |
875 | |
876 | - _constraints = [ |
877 | - # Cannot have this as a constraint as it is rejecting valid numbers from GB and DE |
878 | - # It works much better without this constraint! |
879 | - #(check_iban, _("The IBAN number doesn't seem to be correct"), ["acc_number"]) |
880 | - ] |
881 | - |
882 | res_partner_bank() |
883 | |
884 | -class res_bank(osv.osv): |
885 | + |
886 | +class res_bank(orm.Model): |
887 | ''' |
888 | Add a on_change trigger to automagically fill bank details from the |
889 | online SWIFT database. Allow hand filled names to overrule SWIFT names. |
890 | @@ -1134,7 +947,8 @@ |
891 | |
892 | res_bank() |
893 | |
894 | -class invoice(osv.osv): |
895 | + |
896 | +class invoice(orm.Model): |
897 | ''' |
898 | Create other reference types as well. |
899 | |
900 | @@ -1147,6 +961,9 @@ |
901 | |
902 | Don't forget to redefine the column "reference_type" as below or |
903 | your method will never be triggered. |
904 | + |
905 | + TODO: move 'structured' part to account_banking_payment module |
906 | + where it belongs |
907 | ''' |
908 | _inherit = 'account.invoice' |
909 | |
910 | @@ -1176,13 +993,16 @@ |
911 | |
912 | invoice() |
913 | |
914 | -class account_move_line(osv.osv): |
915 | + |
916 | +class account_move_line(orm.Model): |
917 | _inherit = "account.move.line" |
918 | |
919 | def get_balance(self, cr, uid, ids, context=None): |
920 | """ |
921 | Return the balance of any set of move lines. |
922 | - Surely this exists somewhere in account base, but I missed it. |
923 | + |
924 | + Not to be confused with the 'balance' field on this model, which |
925 | + returns the account balance that the move line applies to. |
926 | """ |
927 | total = 0.0 |
928 | if not ids: |
929 | |
930 | === modified file 'account_banking/account_banking_view.xml' |
931 | --- account_banking/account_banking_view.xml 2013-05-06 14:07:27 +0000 |
932 | +++ account_banking/account_banking_view.xml 2013-05-06 14:07:28 +0000 |
933 | @@ -134,16 +134,7 @@ |
934 | </tree> |
935 | </field> |
936 | </record> |
937 | - <record id="view_account_banking_imported_line_search" model="ir.ui.view"> |
938 | - <field name="name">account.banking.imported.line.search</field> |
939 | - <field name="model">account.bank.imported.line</field> |
940 | - <field name="type">search</field> |
941 | - <field name="arch" type="xml"> |
942 | - <search string="Search Bank Statement files"> |
943 | - <field name="company_id" /> |
944 | - </search> |
945 | - </field> |
946 | - </record> |
947 | + |
948 | <record model="ir.actions.act_window" id="action_account_banking_imported_files"> |
949 | <field name="name">Imported Bank Statements Files</field> |
950 | <field name="type">ir.actions.act_window</field> |
951 | @@ -193,7 +184,12 @@ |
952 | <field name="model">account.bank.statement</field> |
953 | <field name="type">tree</field> |
954 | <field name="arch" type="xml"> |
955 | - <field name="period_id" position="replace"/> |
956 | + <!-- Remove period from bank statement --> |
957 | + <field name="period_id" position="replace"> |
958 | + <!-- Add invisible column for identification of import file |
959 | + --> |
960 | + <field name="banking_id" invisible="True" /> |
961 | + </field> |
962 | </field> |
963 | </record> |
964 | <record id="view_banking_bank_statement_form_1" model="ir.ui.view"> |
965 | @@ -204,92 +200,52 @@ |
966 | <field name="type">form</field> |
967 | <field name="arch" type="xml"> |
968 | <data> |
969 | + <page string="Transactions" position="after"> |
970 | + <page string="Journal Entries" name="move_live_ids"> |
971 | + <field colspan="4" name="move_line_ids" nolabel="1"/> |
972 | + </page> |
973 | + </page> |
974 | <field name="period_id" position="replace"/> |
975 | - <xpath expr="/form/notebook/page[@string='Transaction']/field/tree" position="attributes"> |
976 | + |
977 | + <xpath expr="//page[@string='Transactions']/field/tree" |
978 | + position="attributes"> |
979 | <attribute name="colors">black:state == 'confirmed';darkmagenta:match_multi == True;crimson:duplicate == True;grey:state == 'draft';</attribute> |
980 | </xpath> |
981 | - <xpath expr="/form/notebook/page[@string='Transaction']/field/tree/field[@name='name']" position="replace"> |
982 | - <field name="name" required="1"/> |
983 | - </xpath> |
984 | - <xpath expr="/form/notebook/page[@string='Transaction']/field/form/field[@name='name']" position="replace"> |
985 | - <field name="name" required="1"/> |
986 | - </xpath> |
987 | - </data> |
988 | - </field> |
989 | - </record> |
990 | - <record id="view_banking_bank_statement_form_2" model="ir.ui.view"> |
991 | - <field name="name">account.bank.statement.form.banking-2</field> |
992 | - <field name="inherit_id" ref="account.view_bank_statement_form" /> |
993 | - <field name="model">account.bank.statement</field> |
994 | - <field name="type">form</field> |
995 | - <field name="arch" type="xml"> |
996 | - <xpath expr="/form/notebook/page[@string='Transaction']/field/tree/field[@name='ref']" position="after"> |
997 | - <field name="period_id"/> |
998 | - </xpath> |
999 | - </field> |
1000 | - </record> |
1001 | - <record id="view_banking_bank_statement_form_3" model="ir.ui.view"> |
1002 | - <field name="name">account.bank.statement.form.banking-3</field> |
1003 | - <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1004 | - <field name="model">account.bank.statement</field> |
1005 | - <field name="type">form</field> |
1006 | - <field name="arch" type="xml"> |
1007 | - <data> |
1008 | - <xpath expr="/form/notebook/page[@string='Transaction']/field/form/field[@name='ref']" position="after"> |
1009 | - <field name="period_id"/> |
1010 | - <field name="match_type"/> |
1011 | - <field name="match_multi"/> |
1012 | - <field name="duplicate"/> |
1013 | - </xpath> |
1014 | - </data> |
1015 | - </field> |
1016 | - </record> |
1017 | - |
1018 | - <!-- Add invisible column on bank statements tree for identification |
1019 | - of import file |
1020 | - --> |
1021 | - <record id="view_banking_bank_statement_tree_2" model="ir.ui.view"> |
1022 | - <field name="name">account.bank.statement.tree.banking-2</field> |
1023 | - <field name="inherit_id" ref="account.view_bank_statement_tree" /> |
1024 | - <field name="model">account.bank.statement</field> |
1025 | - <field name="type">tree</field> |
1026 | - <field name="arch" type="xml"> |
1027 | - <field name="state" position="after"> |
1028 | - <field name="banking_id" invisible="True" /> |
1029 | - </field> |
1030 | - </field> |
1031 | - </record> |
1032 | - |
1033 | - <!-- Add invisible field for identification of import file on bank statements |
1034 | - --> |
1035 | - <record id="view_banking_bank_statement_form_4" model="ir.ui.view"> |
1036 | - <field name="name">account.bank.statement.form.banking-4</field> |
1037 | - <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1038 | - <field name="model">account.bank.statement</field> |
1039 | - <field name="type">form</field> |
1040 | - <field name="arch" type="xml"> |
1041 | - <field name="balance_end_real" position="after"> |
1042 | - <field name="banking_id" invisible="True"/> |
1043 | - </field> |
1044 | - </field> |
1045 | - </record> |
1046 | - |
1047 | - <!-- Show bank accounts in account_bank_statement_line to enable manual |
1048 | - coupling of bank account numbers to statement lines and harvest info |
1049 | - for future matching in the process. |
1050 | - --> |
1051 | - <record id="view_banking_bank_statement_form_5" model="ir.ui.view"> |
1052 | - <field name="name">account.bank.statement.form.banking-5</field> |
1053 | - <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1054 | - <field name="model">account.bank.statement</field> |
1055 | - <field name="type">form</field> |
1056 | - <field name="arch" type="xml"> |
1057 | - <data> |
1058 | - <xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='partner_id']" position="after"> |
1059 | + |
1060 | + <xpath expr="//field[@name='line_ids']/tree/field[@name='name']" |
1061 | + position="attributes"> |
1062 | + <attribute name="required">1</attribute> |
1063 | + </xpath> |
1064 | + |
1065 | + <xpath expr="//field[@name='line_ids']/form//field[@name='name']" |
1066 | + position="attributes"> |
1067 | + <attribute name="required">1</attribute> |
1068 | + </xpath> |
1069 | + |
1070 | + <!-- Add invisible field for identification of import file |
1071 | + on bank statements |
1072 | + --> |
1073 | + <field name="balance_end_real" position="after"> |
1074 | + <field name="banking_id" invisible="True"/> |
1075 | + </field> |
1076 | + |
1077 | + <!-- Show bank accounts in account_bank_statement_line to |
1078 | + enable manualcoupling of bank account numbers to |
1079 | + statement lines and harvest info for future matching |
1080 | + in the process. |
1081 | + --> |
1082 | + <xpath expr="//field[@name='line_ids']/tree/field[@name='partner_id']" |
1083 | + position="after"> |
1084 | <!-- TODO set partner_id when partner_bank_id changes --> |
1085 | <field name="partner_bank_id"/> |
1086 | </xpath> |
1087 | - <xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='amount']" position="after"> |
1088 | + <xpath expr="//field[@name='line_ids']/form//field[@name='partner_id']" |
1089 | + position="after"> |
1090 | + <field name="partner_bank_id"/> |
1091 | + </xpath> |
1092 | + |
1093 | + <xpath expr="//field[@name='line_ids']/tree/field[@name='amount']" |
1094 | + position="after"> |
1095 | <field name="match_type"/> |
1096 | <field name="residual"/> |
1097 | <button name="match_wizard" states="draft" |
1098 | @@ -310,7 +266,9 @@ |
1099 | <field name="invoice_id"/> |
1100 | <field name="reconcile_id"/> |
1101 | </xpath> |
1102 | - <xpath expr="/form/notebook/page/field[@name='line_ids']/form/field[@name='amount']" position="after"> |
1103 | + |
1104 | + <xpath expr="//field[@name='line_ids']/form//field[@name='amount']" |
1105 | + position="after"> |
1106 | <field name="state"/> |
1107 | <field name="invoice_id"/> |
1108 | <field name="reconcile_id"/> |
1109 | @@ -318,30 +276,7 @@ |
1110 | </data> |
1111 | </field> |
1112 | </record> |
1113 | - <record id="view_banking_bank_statement_form_6" model="ir.ui.view"> |
1114 | - <field name="name">account.bank.statement.form.banking-6</field> |
1115 | - <field name="inherit_id" ref="account.view_bank_statement_form" /> |
1116 | - <field name="model">account.bank.statement</field> |
1117 | - <field name="type">form</field> |
1118 | - <field name="arch" type="xml"> |
1119 | - <xpath expr="/form/notebook/page/field[@name='line_ids']/form/field[@name='partner_id']" position="after"> |
1120 | - <field name="partner_bank_id"/> |
1121 | - </xpath> |
1122 | - </field> |
1123 | - </record> |
1124 | |
1125 | - <!-- Set trigger on IBAN and acc_number fields in res_partner_bank form --> |
1126 | - <!--record id="view_partner_bank_account_banking_form_1" model="ir.ui.view"> |
1127 | - <field name="name">res.partner.bank.form.banking-1</field> |
1128 | - <field name="model">res.partner.bank</field> |
1129 | - <field name="inherit_id" ref="base_iban.view_partner_bank_iban_form"/> |
1130 | - <field name="type">form</field> |
1131 | - <field name="arch" type="xml"> |
1132 | - <field name="iban" position="replace"> |
1133 | - <field name="iban" on_change="onchange_iban(iban)" /> |
1134 | - </field> |
1135 | - </field> |
1136 | - </record--> |
1137 | <record id="view_partner_bank_account_banking_form_2" model="ir.ui.view"> |
1138 | <field name="name">res.partner.bank.form.banking-2</field> |
1139 | <field name="model">res.partner.bank</field> |
1140 | @@ -360,53 +295,6 @@ |
1141 | </field> |
1142 | </record> |
1143 | |
1144 | - <!-- Set trigger on IBAN and acc_number field in res_partner form --> |
1145 | - <!--record id="view_partner_account_banking_form_1" model="ir.ui.view"> |
1146 | - <field name="name">res.partner.form.banking-1</field> |
1147 | - <field name="model">res.partner</field> |
1148 | - <field name="inherit_id" ref="base_iban.view_partner_iban_form"/> |
1149 | - <field name="type">form</field> |
1150 | - <field name="arch" type="xml"> |
1151 | - <field name="iban" position="replace"> |
1152 | - <field name="iban" on_change="onchange_iban(iban)" /> |
1153 | - </field> |
1154 | - </field> |
1155 | - </record--> |
1156 | - <record id="view_partner_account_banking_form_2" model="ir.ui.view"> |
1157 | - <field name="name">res.partner.form.banking-2</field> |
1158 | - <field name="model">res.partner</field> |
1159 | - <field name="inherit_id" ref="account.view_partner_property_form"/> |
1160 | - <field name="priority" eval="24"/> |
1161 | - <field name="type">form</field> |
1162 | - <field name="arch" type="xml"> |
1163 | - <data> |
1164 | - <field name="acc_number" position="attributes"> |
1165 | - <attribute name="on_change">onchange_acc_number(acc_number, acc_number_domestic, state, partner_id, country_id)</attribute> |
1166 | - </field> |
1167 | - <field name="acc_number_domestic" position="attributes"> |
1168 | - <attribute name="on_change">onchange_domestic(acc_number_domestic, partner_id, country_id)</attribute> |
1169 | - </field> |
1170 | - </data> |
1171 | - </field> |
1172 | - </record> |
1173 | - <record id="view_partner_account_banking_form_3" model="ir.ui.view"> |
1174 | - <field name="name">res.partner.form.banking-3</field> |
1175 | - <field name="model">res.partner</field> |
1176 | - <field name="inherit_id" ref="account.view_partner_property_form"/> |
1177 | - <field name="priority" eval="24"/> |
1178 | - <field name="type">form</field> |
1179 | - <field name="arch" type="xml"> |
1180 | - <data> |
1181 | - <field name="acc_number" position="attributes"> |
1182 | - <attribute name="on_change">onchange_acc_number(acc_number, acc_number_domestic, state, partner_id, country_id)</attribute> |
1183 | - </field> |
1184 | - <field name="acc_number_domestic" position="attributes"> |
1185 | - <attribute name="on_change">onchange_domestic(acc_number_domestic, partner_id, country_id)</attribute> |
1186 | - </field> |
1187 | - </data> |
1188 | - </field> |
1189 | - </record> |
1190 | - |
1191 | <!-- Set trigger on BIC in res_bank form --> |
1192 | <record id="view_res_bank_account_banking_form_1" model="ir.ui.view"> |
1193 | <field name="name">res.bank.form.banking-1</field> |
1194 | @@ -438,25 +326,25 @@ |
1195 | <field domain="[('journal_id','=',parent.journal_id)]" name="account_id"/> |
1196 | <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/> |
1197 | <field name="amount"/> |
1198 | - <field name="match_type"/> |
1199 | - <field name="residual"/> |
1200 | - <button name="match_wizard" states="draft" |
1201 | - string="Match" |
1202 | - icon="terp-gtk-jump-to-ltr" |
1203 | - type="object"/> |
1204 | - <field name="match_multi" invisible="1"/> |
1205 | - <field name="duplicate" invisible="1"/> |
1206 | - <field name="state"/> |
1207 | - <button name="confirm" states="draft" |
1208 | - string="Confirm transaction" |
1209 | - icon="gtk-ok" |
1210 | - type="object"/> |
1211 | - <button name="cancel" states="confirmed" |
1212 | - string="Cancel transaction" |
1213 | - icon="gtk-cancel" |
1214 | - type="object"/> |
1215 | - <field name="invoice_id"/> |
1216 | - <field name="reconcile_id"/> |
1217 | + <field name="match_type"/> |
1218 | + <field name="residual"/> |
1219 | + <button name="match_wizard" states="draft" |
1220 | + string="Match" |
1221 | + icon="terp-gtk-jump-to-ltr" |
1222 | + type="object"/> |
1223 | + <field name="match_multi" invisible="1"/> |
1224 | + <field name="duplicate" invisible="1"/> |
1225 | + <field name="state"/> |
1226 | + <button name="confirm" states="draft" |
1227 | + string="Confirm transaction" |
1228 | + icon="gtk-ok" |
1229 | + type="object"/> |
1230 | + <button name="cancel" states="confirmed" |
1231 | + string="Cancel transaction" |
1232 | + icon="gtk-cancel" |
1233 | + type="object"/> |
1234 | + <field name="invoice_id"/> |
1235 | + <field name="reconcile_id"/> |
1236 | </tree> |
1237 | </field> |
1238 | </record> |
1239 | |
1240 | === modified file 'account_banking/banking_import_transaction.py' |
1241 | --- account_banking/banking_import_transaction.py 2013-05-06 14:07:27 +0000 |
1242 | +++ account_banking/banking_import_transaction.py 2013-05-06 14:07:28 +0000 |
1243 | @@ -1,45 +1,42 @@ |
1244 | -# -*- encoding: utf-8 -*- |
1245 | ############################################################################## |
1246 | # |
1247 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
1248 | -# Contributions by Kaspars Vilkens (KNdati): |
1249 | -# lenghty discussions, bugreports and bugfixes |
1250 | -# Refractoring (C) 2011 Therp BV (<http://therp.nl>). |
1251 | -# (C) 2011 Smile (<http://smile.fr>). |
1252 | +# (C) 2011 Therp BV (<http://therp.nl>). |
1253 | +# (C) 2011 Smile (<http://smile.fr>). |
1254 | +# |
1255 | +# All other contributions are (C) by their respective contributors |
1256 | # |
1257 | # All Rights Reserved |
1258 | # |
1259 | # This program is free software: you can redistribute it and/or modify |
1260 | -# it under the terms of the GNU General Public License as published by |
1261 | -# the Free Software Foundation, either version 3 of the License, or |
1262 | -# (at your option) any later version. |
1263 | +# it under the terms of the GNU Affero General Public License as |
1264 | +# published by the Free Software Foundation, either version 3 of the |
1265 | +# License, or (at your option) any later version. |
1266 | # |
1267 | # This program is distributed in the hope that it will be useful, |
1268 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1269 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1270 | -# GNU General Public License for more details. |
1271 | +# GNU Affero General Public License for more details. |
1272 | # |
1273 | -# You should have received a copy of the GNU General Public License |
1274 | +# You should have received a copy of the GNU Affero General Public License |
1275 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1276 | # |
1277 | ############################################################################## |
1278 | |
1279 | -from osv import osv, fields |
1280 | -import netsvc |
1281 | -import base64 |
1282 | import datetime |
1283 | -from tools import config |
1284 | -from tools.translate import _ |
1285 | -from parsers import models |
1286 | -from parsers.convert import * |
1287 | -# from account_banking.struct import struct |
1288 | -from account_banking import sepa |
1289 | -from wizard.banktools import * |
1290 | -import decimal_precision as dp |
1291 | +from openerp.osv import orm, fields |
1292 | +from openerp import netsvc |
1293 | +from openerp.tools.translate import _ |
1294 | +from openerp.addons.decimal_precision import decimal_precision as dp |
1295 | +from openerp.addons.account_banking.parsers import models |
1296 | +from openerp.addons.account_banking.parsers import convert |
1297 | +from openerp.addons.account_banking import sepa |
1298 | +from openerp.addons.account_banking.wizard import banktools |
1299 | |
1300 | bt = models.mem_bank_transaction |
1301 | |
1302 | -class banking_import_transaction(osv.osv): |
1303 | + |
1304 | +class banking_import_transaction(orm.Model): |
1305 | """ orm representation of mem_bank_transaction() for interactive and posthoc |
1306 | configuration of reconciliation in the bank statement view. |
1307 | |
1308 | @@ -245,8 +242,8 @@ |
1309 | candidates = [ |
1310 | x for x in move_lines |
1311 | if x.partner_id.id in partner_ids and |
1312 | - (str2date(x.date, '%Y-%m-%d') <= |
1313 | - (str2date(trans.execution_date, '%Y-%m-%d') + |
1314 | + (convert.str2date(x.date, '%Y-%m-%d') <= |
1315 | + (convert.str2date(trans.execution_date, '%Y-%m-%d') + |
1316 | self.payment_window)) |
1317 | and (not _cached(x) or _remaining(x)) |
1318 | ] |
1319 | @@ -267,8 +264,8 @@ |
1320 | candidates = [ |
1321 | x for x in candidates or move_lines |
1322 | if (x.invoice and has_id_match(x.invoice, ref, msg) and |
1323 | - str2date(x.invoice.date_invoice, '%Y-%m-%d') <= |
1324 | - (str2date(trans.execution_date, '%Y-%m-%d') + |
1325 | + convert.str2date(x.invoice.date_invoice, '%Y-%m-%d') <= |
1326 | + (convert.str2date(trans.execution_date, '%Y-%m-%d') + |
1327 | self.payment_window) |
1328 | and (not _cached(x) or _remaining(x))) |
1329 | ] |
1330 | @@ -280,8 +277,8 @@ |
1331 | x for x in move_lines |
1332 | if (is_zero(x.move_id, ((x.debit or 0.0) - (x.credit or 0.0)) - |
1333 | trans.transferred_amount) |
1334 | - and str2date(x.date, '%Y-%m-%d') <= |
1335 | - (str2date(trans.execution_date, '%Y-%m-%d') + |
1336 | + and convert.str2date(x.date, '%Y-%m-%d') <= |
1337 | + (convert.str2date(trans.execution_date, '%Y-%m-%d') + |
1338 | self.payment_window) |
1339 | and (not _cached(x) or _remaining(x))) |
1340 | ] |
1341 | @@ -296,8 +293,8 @@ |
1342 | best = [x for x in candidates |
1343 | if (is_zero(x.move_id, ((x.debit or 0.0) - (x.credit or 0.0)) - |
1344 | trans.transferred_amount) |
1345 | - and str2date(x.date, '%Y-%m-%d') <= |
1346 | - (str2date(trans.execution_date, '%Y-%m-%d') + |
1347 | + and convert.str2date(x.date, '%Y-%m-%d') <= |
1348 | + (convert.str2date(trans.execution_date, '%Y-%m-%d') + |
1349 | self.payment_window)) |
1350 | ] |
1351 | if len(best) == 1: |
1352 | @@ -315,8 +312,8 @@ |
1353 | # transfers first |
1354 | paid = [x for x in move_lines |
1355 | if x.invoice and has_id_match(x.invoice, ref, msg) |
1356 | - and str2date(x.invoice.date_invoice, '%Y-%m-%d') |
1357 | - <= str2date(trans.execution_date, '%Y-%m-%d') |
1358 | + and convert.str2date(x.invoice.date_invoice, '%Y-%m-%d') |
1359 | + <= convert.str2date(trans.execution_date, '%Y-%m-%d') |
1360 | and (_cached(x) and not _remaining(x)) |
1361 | ] |
1362 | if paid: |
1363 | @@ -406,7 +403,7 @@ |
1364 | transaction = self.browse(cr, uid, transaction_id, context) |
1365 | if not transaction.move_line_id: |
1366 | if transaction.match_type == 'invoice': |
1367 | - raise osv.except_osv( |
1368 | + raise orm.except_orm( |
1369 | _("Cannot link transaction %s with invoice") % |
1370 | transaction.statement_line_id.name, |
1371 | (transaction.invoice_ids and |
1372 | @@ -416,7 +413,7 @@ |
1373 | transaction.statement_line_id.name |
1374 | ))) |
1375 | else: |
1376 | - raise osv.except_osv( |
1377 | + raise orm.except_orm( |
1378 | _("Cannot link transaction %s with accounting entry") % |
1379 | transaction.statement_line_id.name, |
1380 | (transaction.move_line_ids and |
1381 | @@ -475,7 +472,6 @@ |
1382 | 'partner_id': st_line.partner_id and st_line.partner_id.id or False, |
1383 | 'company_id': st_line.company_id.id, |
1384 | 'type':voucher_type, |
1385 | - 'company_id': st_line.company_id.id, |
1386 | 'account_id': account_id, |
1387 | 'amount': abs(st_line.amount), |
1388 | 'writeoff_amount': writeoff, |
1389 | @@ -552,7 +548,7 @@ |
1390 | def _legacy_clear_up_writeoff(self, cr, uid, transaction, context=None): |
1391 | """ |
1392 | Legacy method to support upgrades older installations of the |
1393 | - interactive wizard branch. To be removed after 6.2 |
1394 | + interactive wizard branch. To be removed after 7.0 |
1395 | clear up the writeoff move |
1396 | """ |
1397 | if transaction.writeoff_move_line_id: |
1398 | @@ -649,7 +645,7 @@ |
1399 | if not transaction.match_type: |
1400 | continue |
1401 | if transaction.match_type not in self.cancel_map: |
1402 | - raise osv.except_osv( |
1403 | + raise orm.except_orm( |
1404 | _("Cannot cancel type %s" % transaction.match_type), |
1405 | _("No method found to cancel this type")) |
1406 | self.cancel_map[transaction.match_type]( |
1407 | @@ -670,7 +666,7 @@ |
1408 | if not transaction.match_type: |
1409 | continue |
1410 | if transaction.match_type not in self.confirm_map: |
1411 | - raise osv.except_osv( |
1412 | + raise orm.except_orm( |
1413 | _("Cannot reconcile"), |
1414 | _("Cannot reconcile type %s. No method found to " + |
1415 | "reconcile this type") % |
1416 | @@ -678,7 +674,7 @@ |
1417 | ) |
1418 | if (transaction.residual and transaction.writeoff_account_id): |
1419 | if transaction.match_type not in ('invoice', 'move', 'manual'): |
1420 | - raise osv.except_osv( |
1421 | + raise orm.except_orm( |
1422 | _("Cannot reconcile"), |
1423 | _("Bank transaction %s: write off not implemented for " + |
1424 | "this match type.") % |
1425 | @@ -689,12 +685,6 @@ |
1426 | self.confirm_map[transaction.match_type]( |
1427 | self, cr, uid, transaction.id, context) |
1428 | |
1429 | - """ |
1430 | - account_ids = [ |
1431 | - x.id for x in bank_account_ids |
1432 | - if x.partner_id.id == move_line.partner_id.id |
1433 | - ][0] |
1434 | - """ |
1435 | return True |
1436 | |
1437 | signal_duplicate_keys = [ |
1438 | @@ -727,7 +717,7 @@ |
1439 | me['transferred_amount'] - trans.transferred_amount): |
1440 | dupes.append(trans.id) |
1441 | if len(dupes) < 1: |
1442 | - raise osv.except_osv(_('Cannot check for duplicate'), |
1443 | + raise orm.except_orm(_('Cannot check for duplicate'), |
1444 | _("Cannot check for duplicate. " |
1445 | "I can't find myself.")) |
1446 | if len(dupes) > 1: |
1447 | @@ -833,7 +823,6 @@ |
1448 | has_payment = bool(payment_line_obj) |
1449 | statement_line_obj = self.pool.get('account.bank.statement.line') |
1450 | statement_obj = self.pool.get('account.bank.statement') |
1451 | - payment_order_obj = self.pool.get('payment.order') |
1452 | imported_statement_ids = [] |
1453 | |
1454 | # Results |
1455 | @@ -886,7 +875,7 @@ |
1456 | |
1457 | if (transaction.statement_line_id and |
1458 | transaction.statement_line_id.state == 'confirmed'): |
1459 | - raise osv.except_osv( |
1460 | + raise orm.except_orm( |
1461 | _("Cannot perform match"), |
1462 | _("Cannot perform match on a confirmed transction")) |
1463 | |
1464 | @@ -934,7 +923,7 @@ |
1465 | account_info = info[transaction.local_account][currency_code] |
1466 | else: |
1467 | # Pull account info/currency |
1468 | - account_info = get_company_bank_account( |
1469 | + account_info = banktools.get_company_bank_account( |
1470 | self.pool, cr, uid, transaction.local_account, |
1471 | transaction.local_currency, company, results['log'] |
1472 | ) |
1473 | @@ -991,10 +980,9 @@ |
1474 | continue |
1475 | |
1476 | # Link accounting period |
1477 | - period_id = get_period( |
1478 | - self.pool, cr, uid, |
1479 | - str2date(transaction.effective_date,'%Y-%m-%d'), company, |
1480 | - results['log']) |
1481 | + period_id = banktools.get_period( |
1482 | + self.pool, cr, uid, transaction.effective_date, |
1483 | + company, results['log']) |
1484 | if not period_id: |
1485 | results['trans_skipped_cnt'] += 1 |
1486 | if not injected: |
1487 | @@ -1053,7 +1041,7 @@ |
1488 | partner_banks = [] |
1489 | else: |
1490 | # Link remote partner, import account when needed |
1491 | - partner_banks = get_bank_accounts( |
1492 | + partner_banks = banktools.get_bank_accounts( |
1493 | self.pool, cr, uid, transaction.remote_account, |
1494 | results['log'], fail=True |
1495 | ) |
1496 | @@ -1072,14 +1060,17 @@ |
1497 | country_code = company.partner_id.country.code |
1498 | else: |
1499 | country_code = None |
1500 | - partner_id = get_or_create_partner( |
1501 | + partner_id = banktools.get_or_create_partner( |
1502 | self.pool, cr, uid, transaction.remote_owner, |
1503 | transaction.remote_owner_address, |
1504 | transaction.remote_owner_postalcode, |
1505 | transaction.remote_owner_city, |
1506 | - country_code, results['log'], context=context) |
1507 | + country_code, results['log'], |
1508 | + customer=transaction.transferred_amount > 0, |
1509 | + supplier=transaction.transferred_amount < 0, |
1510 | + context=context) |
1511 | if transaction.remote_account: |
1512 | - partner_bank_id = create_bank_account( |
1513 | + partner_bank_id = banktools.create_bank_account( |
1514 | self.pool, cr, uid, partner_id, |
1515 | transaction.remote_account, |
1516 | transaction.remote_owner, |
1517 | @@ -1356,7 +1347,8 @@ |
1518 | 'account.bank.statement.line', 'Statement line', |
1519 | ondelete='CASCADE'), |
1520 | 'statement_id': fields.many2one( |
1521 | - 'account.bank.statement', 'Statement'), |
1522 | + 'account.bank.statement', 'Statement', |
1523 | + ondelete='CASCADE'), |
1524 | 'parent_id': fields.many2one( |
1525 | 'banking.import.transaction', 'Split off from this transaction'), |
1526 | # match fields |
1527 | @@ -1394,7 +1386,7 @@ |
1528 | "or reconcile it with the payment(s)"), |
1529 | ), |
1530 | 'writeoff_amount': fields.float('Difference Amount'), |
1531 | - # Legacy field: to be removed after 6.2 |
1532 | + # Legacy field: to be removed after 7.0 |
1533 | 'writeoff_move_line_id': fields.many2one( |
1534 | 'account.move.line', 'Write off move line'), |
1535 | 'writeoff_analytic_id': fields.many2one( |
1536 | @@ -1412,7 +1404,8 @@ |
1537 | |
1538 | banking_import_transaction() |
1539 | |
1540 | -class account_bank_statement_line(osv.osv): |
1541 | + |
1542 | +class account_bank_statement_line(orm.Model): |
1543 | _inherit = 'account.bank.statement.line' |
1544 | _columns = { |
1545 | 'import_transaction_id': fields.many2one( |
1546 | @@ -1483,21 +1476,20 @@ |
1547 | """ |
1548 | statement_pool = self.pool.get('account.bank.statement') |
1549 | obj_seq = self.pool.get('ir.sequence') |
1550 | - move_pool = self.pool.get('account.move') |
1551 | import_transaction_obj = self.pool.get('banking.import.transaction') |
1552 | |
1553 | for st_line in self.browse(cr, uid, ids, context): |
1554 | if st_line.state != 'draft': |
1555 | continue |
1556 | if st_line.duplicate: |
1557 | - raise osv.except_osv( |
1558 | + raise orm.except_orm( |
1559 | _('Bank transfer flagged as duplicate'), |
1560 | _("You cannot confirm a bank transfer marked as a " |
1561 | "duplicate (%s.%s)") % |
1562 | (st_line.statement_id.name, st_line.name,)) |
1563 | if st_line.analytic_account_id: |
1564 | if not st_line.statement_id.journal_id.analytic_journal_id: |
1565 | - raise osv.except_osv( |
1566 | + raise orm.except_orm( |
1567 | _('No Analytic Journal !'), |
1568 | _("You have to define an analytic journal on the '%s' " |
1569 | "journal!") % (st_line.statement_id.journal_id.name,)) |
1570 | @@ -1541,7 +1533,6 @@ |
1571 | ids = [ids] |
1572 | import_transaction_obj = self.pool.get('banking.import.transaction') |
1573 | move_pool = self.pool.get('account.move') |
1574 | - transaction_cancel_ids = [] |
1575 | set_draft_ids = [] |
1576 | move_unlink_ids = [] |
1577 | # harvest ids for various actions |
1578 | @@ -1549,7 +1540,7 @@ |
1579 | if st_line.state != 'confirmed': |
1580 | continue |
1581 | if st_line.statement_id.state != 'draft': |
1582 | - raise osv.except_osv( |
1583 | + raise orm.except_orm( |
1584 | _("Cannot cancel bank transaction"), |
1585 | _("The bank statement that this transaction belongs to has " |
1586 | "already been confirmed")) |
1587 | @@ -1584,10 +1575,10 @@ |
1588 | ids = [ids] |
1589 | for line in self.browse(cr, uid, ids, context=context): |
1590 | if line.state == 'confirmed': |
1591 | - raise osv.except_osv( |
1592 | + raise orm.except_orm( |
1593 | _('Confirmed Statement Line'), |
1594 | _("You cannot delete a confirmed Statement Line" |
1595 | - ": '%s'" % line.name)) |
1596 | + ": '%s'") % line.name) |
1597 | return super(account_bank_statement_line, self).unlink( |
1598 | cr, uid, ids, context=context) |
1599 | |
1600 | @@ -1629,7 +1620,8 @@ |
1601 | |
1602 | account_bank_statement_line() |
1603 | |
1604 | -class account_bank_statement(osv.osv): |
1605 | + |
1606 | +class account_bank_statement(orm.Model): |
1607 | _inherit = 'account.bank.statement' |
1608 | |
1609 | def _end_balance(self, cursor, user, ids, name, attr, context=None): |
1610 | @@ -1665,19 +1657,21 @@ |
1611 | self.balance_check(cr, uid, st.id, journal_type=j_type, context=context) |
1612 | if (not st.journal_id.default_credit_account_id) \ |
1613 | or (not st.journal_id.default_debit_account_id): |
1614 | - raise osv.except_osv(_('Configuration Error !'), |
1615 | + raise orm.except_orm(_('Configuration Error !'), |
1616 | _('Please verify that an account is defined in the journal.')) |
1617 | |
1618 | # protect against misguided manual changes |
1619 | for line in st.move_line_ids: |
1620 | if line.state != 'valid': |
1621 | - raise osv.except_osv(_('Error !'), |
1622 | + raise orm.except_orm(_('Error !'), |
1623 | _('The account entries lines are not in valid state.')) |
1624 | |
1625 | line_obj.confirm(cr, uid, [line.id for line in st.line_ids], context) |
1626 | st.refresh() |
1627 | - self.log(cr, uid, st.id, _('Statement %s is confirmed, journal ' |
1628 | - 'items are created.') % (st.name,)) |
1629 | + self.message_post( |
1630 | + cr, uid, [st.id], |
1631 | + body=_('Statement %s confirmed, journal items were created.') |
1632 | + % (st.name,), context=context) |
1633 | return self.write(cr, uid, ids, {'state':'confirm'}, context=context) |
1634 | |
1635 | def button_cancel(self, cr, uid, ids, context=None): |
1636 | @@ -1696,8 +1690,12 @@ |
1637 | for st in self.browse(cr, uid, ids, context=context): |
1638 | for line in st.line_ids: |
1639 | if line.state == 'confirmed': |
1640 | - raise osv.except_osv(_('Confirmed Statement Lines'), _("You cannot delete a Statement with confirmed Statement Lines: '%s'" % st.name)) |
1641 | - return super(account_bank_statement,self).unlink(cr, uid, ids, context=context) |
1642 | + raise orm.except_orm( |
1643 | + _('Confirmed Statement Lines'), |
1644 | + _("You cannot delete a Statement with confirmed " |
1645 | + "Statement Lines: '%s'") % st.name) |
1646 | + return super(account_bank_statement, self).unlink( |
1647 | + cr, uid, ids, context=context) |
1648 | |
1649 | _columns = { |
1650 | # override this field *only* to replace the |
1651 | |
1652 | === modified file 'account_banking/migrations/0.1.81/post-set-statement-line-state.py' |
1653 | --- account_banking/migrations/0.1.81/post-set-statement-line-state.py 2011-12-27 12:00:52 +0000 |
1654 | +++ account_banking/migrations/0.1.81/post-set-statement-line-state.py 2013-05-06 14:07:28 +0000 |
1655 | @@ -4,16 +4,16 @@ |
1656 | # Copyright (C) 2011 Therp BV (<http://therp.nl>) |
1657 | # |
1658 | # This program is free software: you can redistribute it and/or modify |
1659 | -# it under the terms of the GNU General Public License as published by |
1660 | +# it under the terms of the GNU Affero General Public License as published by |
1661 | # the Free Software Foundation, either version 3 of the License, or |
1662 | # (at your option) any later version. |
1663 | # |
1664 | # This program is distributed in the hope that it will be useful, |
1665 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1666 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1667 | -# GNU General Public License for more details. |
1668 | +# GNU Affero General Public License for more details. |
1669 | # |
1670 | -# You should have received a copy of the GNU General Public License |
1671 | +# You should have received a copy of the GNU Affero General Public License |
1672 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1673 | # |
1674 | ############################################################################## |
1675 | |
1676 | === modified file 'account_banking/parsers/__init__.py' |
1677 | --- account_banking/parsers/__init__.py 2010-01-26 20:55:24 +0000 |
1678 | +++ account_banking/parsers/__init__.py 2013-05-06 14:07:28 +0000 |
1679 | @@ -5,16 +5,16 @@ |
1680 | # All Rights Reserved |
1681 | # |
1682 | # This program is free software: you can redistribute it and/or modify |
1683 | -# it under the terms of the GNU General Public License as published by |
1684 | +# it under the terms of the GNU Affero General Public License as published by |
1685 | # the Free Software Foundation, either version 3 of the License, or |
1686 | # (at your option) any later version. |
1687 | # |
1688 | # This program is distributed in the hope that it will be useful, |
1689 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1690 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1691 | -# GNU General Public License for more details. |
1692 | +# GNU Affero General Public License for more details. |
1693 | # |
1694 | -# You should have received a copy of the GNU General Public License |
1695 | +# You should have received a copy of the GNU Affero General Public License |
1696 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1697 | # |
1698 | ############################################################################## |
1699 | |
1700 | === modified file 'account_banking/parsers/convert.py' |
1701 | --- account_banking/parsers/convert.py 2011-03-09 12:26:49 +0000 |
1702 | +++ account_banking/parsers/convert.py 2013-05-06 14:07:28 +0000 |
1703 | @@ -1,20 +1,20 @@ |
1704 | -# -*- encoding: utf-8 -*- |
1705 | +# -*- coding: utf-8 -*- |
1706 | ############################################################################## |
1707 | # |
1708 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
1709 | # All Rights Reserved |
1710 | # |
1711 | # This program is free software: you can redistribute it and/or modify |
1712 | -# it under the terms of the GNU General Public License as published by |
1713 | +# it under the terms of the GNU Affero General Public License as published by |
1714 | # the Free Software Foundation, either version 3 of the License, or |
1715 | # (at your option) any later version. |
1716 | # |
1717 | # This program is distributed in the hope that it will be useful, |
1718 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1719 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1720 | -# GNU General Public License for more details. |
1721 | +# GNU Affero General Public License for more details. |
1722 | # |
1723 | -# You should have received a copy of the GNU General Public License |
1724 | +# You should have received a copy of the GNU Affero General Public License |
1725 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1726 | # |
1727 | ############################################################################## |
1728 | |
1729 | === modified file 'account_banking/parsers/models.py' |
1730 | --- account_banking/parsers/models.py 2012-01-17 08:48:10 +0000 |
1731 | +++ account_banking/parsers/models.py 2013-05-06 14:07:28 +0000 |
1732 | @@ -5,16 +5,16 @@ |
1733 | # All Rights Reserved |
1734 | # |
1735 | # This program is free software: you can redistribute it and/or modify |
1736 | -# it under the terms of the GNU General Public License as published by |
1737 | +# it under the terms of the GNU Affero General Public License as published by |
1738 | # the Free Software Foundation, either version 3 of the License, or |
1739 | # (at your option) any later version. |
1740 | # |
1741 | # This program is distributed in the hope that it will be useful, |
1742 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1743 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1744 | -# GNU General Public License for more details. |
1745 | +# GNU Affero General Public License for more details. |
1746 | # |
1747 | -# You should have received a copy of the GNU General Public License |
1748 | +# You should have received a copy of the GNU Affero General Public License |
1749 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1750 | # |
1751 | ############################################################################## |
1752 | |
1753 | === modified file 'account_banking/record.py' |
1754 | --- account_banking/record.py 2011-03-10 21:54:37 +0000 |
1755 | +++ account_banking/record.py 2013-05-06 14:07:28 +0000 |
1756 | @@ -5,16 +5,16 @@ |
1757 | # All Rights Reserved |
1758 | # |
1759 | # This program is free software: you can redistribute it and/or modify |
1760 | -# it under the terms of the GNU General Public License as published by |
1761 | +# it under the terms of the GNU Affero General Public License as published by |
1762 | # the Free Software Foundation, either version 3 of the License, or |
1763 | # (at your option) any later version. |
1764 | # |
1765 | # This program is distributed in the hope that it will be useful, |
1766 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1767 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1768 | -# GNU General Public License for more details. |
1769 | +# GNU Affero General Public License for more details. |
1770 | # |
1771 | -# You should have received a copy of the GNU General Public License |
1772 | +# You should have received a copy of the GNU Affero General Public License |
1773 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1774 | # |
1775 | ############################################################################## |
1776 | |
1777 | === modified file 'account_banking/sepa/__init__.py' |
1778 | --- account_banking/sepa/__init__.py 2010-06-29 14:58:52 +0000 |
1779 | +++ account_banking/sepa/__init__.py 2013-05-06 14:07:28 +0000 |
1780 | @@ -5,16 +5,16 @@ |
1781 | # All Rights Reserved |
1782 | # |
1783 | # This program is free software: you can redistribute it and/or modify |
1784 | -# it under the terms of the GNU General Public License as published by |
1785 | +# it under the terms of the GNU Affero General Public License as published by |
1786 | # the Free Software Foundation, either version 3 of the License, or |
1787 | # (at your option) any later version. |
1788 | # |
1789 | # This program is distributed in the hope that it will be useful, |
1790 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1791 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1792 | -# GNU General Public License for more details. |
1793 | +# GNU Affero General Public License for more details. |
1794 | # |
1795 | -# You should have received a copy of the GNU General Public License |
1796 | +# You should have received a copy of the GNU Affero General Public License |
1797 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1798 | # |
1799 | ############################################################################## |
1800 | |
1801 | === modified file 'account_banking/sepa/iban.py' |
1802 | --- account_banking/sepa/iban.py 2012-05-03 09:58:01 +0000 |
1803 | +++ account_banking/sepa/iban.py 2013-05-06 14:07:28 +0000 |
1804 | @@ -5,16 +5,16 @@ |
1805 | # All Rights Reserved |
1806 | # |
1807 | # This program is free software: you can redistribute it and/or modify |
1808 | -# it under the terms of the GNU General Public License as published by |
1809 | +# it under the terms of the GNU Affero General Public License as published by |
1810 | # the Free Software Foundation, either version 3 of the License, or |
1811 | # (at your option) any later version. |
1812 | # |
1813 | # This program is distributed in the hope that it will be useful, |
1814 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1815 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1816 | -# GNU General Public License for more details. |
1817 | +# GNU Affero General Public License for more details. |
1818 | # |
1819 | -# You should have received a copy of the GNU General Public License |
1820 | +# You should have received a copy of the GNU Affero General Public License |
1821 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1822 | # |
1823 | ############################################################################## |
1824 | |
1825 | === modified file 'account_banking/sepa/online.py' |
1826 | --- account_banking/sepa/online.py 2012-01-12 09:50:06 +0000 |
1827 | +++ account_banking/sepa/online.py 2013-05-06 14:07:28 +0000 |
1828 | @@ -5,16 +5,16 @@ |
1829 | # All Rights Reserved |
1830 | # |
1831 | # This program is free software: you can redistribute it and/or modify |
1832 | -# it under the terms of the GNU General Public License as published by |
1833 | +# it under the terms of the GNU Affero General Public License as published by |
1834 | # the Free Software Foundation, either version 3 of the License, or |
1835 | # (at your option) any later version. |
1836 | # |
1837 | # This program is distributed in the hope that it will be useful, |
1838 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1839 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1840 | -# GNU General Public License for more details. |
1841 | +# GNU Affero General Public License for more details. |
1842 | # |
1843 | -# You should have received a copy of the GNU General Public License |
1844 | +# You should have received a copy of the GNU Affero General Public License |
1845 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1846 | # |
1847 | ############################################################################## |
1848 | |
1849 | === modified file 'account_banking/sepa/postalcode.py' |
1850 | --- account_banking/sepa/postalcode.py 2012-05-03 10:28:10 +0000 |
1851 | +++ account_banking/sepa/postalcode.py 2013-05-06 14:07:28 +0000 |
1852 | @@ -5,16 +5,16 @@ |
1853 | # All Rights Reserved |
1854 | # |
1855 | # This program is free software: you can redistribute it and/or modify |
1856 | -# it under the terms of the GNU General Public License as published by |
1857 | +# it under the terms of the GNU Affero General Public License as published by |
1858 | # the Free Software Foundation, either version 3 of the License, or |
1859 | # (at your option) any later version. |
1860 | # |
1861 | # This program is distributed in the hope that it will be useful, |
1862 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1863 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1864 | -# GNU General Public License for more details. |
1865 | +# GNU Affero General Public License for more details. |
1866 | # |
1867 | -# You should have received a copy of the GNU General Public License |
1868 | +# You should have received a copy of the GNU Affero General Public License |
1869 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1870 | # |
1871 | ############################################################################## |
1872 | |
1873 | === modified file 'account_banking/sepa/urlagent.py' |
1874 | --- account_banking/sepa/urlagent.py 2010-02-25 23:18:37 +0000 |
1875 | +++ account_banking/sepa/urlagent.py 2013-05-06 14:07:28 +0000 |
1876 | @@ -5,16 +5,16 @@ |
1877 | # All Rights Reserved |
1878 | # |
1879 | # This program is free software: you can redistribute it and/or modify |
1880 | -# it under the terms of the GNU General Public License as published by |
1881 | +# it under the terms of the GNU Affero General Public License as published by |
1882 | # the Free Software Foundation, either version 3 of the License, or |
1883 | # (at your option) any later version. |
1884 | # |
1885 | # This program is distributed in the hope that it will be useful, |
1886 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1887 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1888 | -# GNU General Public License for more details. |
1889 | +# GNU Affero General Public License for more details. |
1890 | # |
1891 | -# You should have received a copy of the GNU General Public License |
1892 | +# You should have received a copy of the GNU Affero General Public License |
1893 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1894 | # |
1895 | ############################################################################## |
1896 | |
1897 | === modified file 'account_banking/struct.py' |
1898 | --- account_banking/struct.py 2010-02-03 23:36:03 +0000 |
1899 | +++ account_banking/struct.py 2013-05-06 14:07:28 +0000 |
1900 | @@ -5,16 +5,16 @@ |
1901 | # All Rights Reserved |
1902 | # |
1903 | # This program is free software: you can redistribute it and/or modify |
1904 | -# it under the terms of the GNU General Public License as published by |
1905 | +# it under the terms of the GNU Affero General Public License as published by |
1906 | # the Free Software Foundation, either version 3 of the License, or |
1907 | # (at your option) any later version. |
1908 | # |
1909 | # This program is distributed in the hope that it will be useful, |
1910 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1911 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1912 | -# GNU General Public License for more details. |
1913 | +# GNU Affero General Public License for more details. |
1914 | # |
1915 | -# You should have received a copy of the GNU General Public License |
1916 | +# You should have received a copy of the GNU Affero General Public License |
1917 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1918 | # |
1919 | ############################################################################## |
1920 | |
1921 | === modified file 'account_banking/wizard/__init__.py' |
1922 | --- account_banking/wizard/__init__.py 2013-05-06 14:07:27 +0000 |
1923 | +++ account_banking/wizard/__init__.py 2013-05-06 14:07:28 +0000 |
1924 | @@ -5,16 +5,16 @@ |
1925 | # All Rights Reserved |
1926 | # |
1927 | # This program is free software: you can redistribute it and/or modify |
1928 | -# it under the terms of the GNU General Public License as published by |
1929 | +# it under the terms of the GNU Affero General Public License as published by |
1930 | # the Free Software Foundation, either version 3 of the License, or |
1931 | # (at your option) any later version. |
1932 | # |
1933 | # This program is distributed in the hope that it will be useful, |
1934 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1935 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1936 | -# GNU General Public License for more details. |
1937 | +# GNU Affero General Public License for more details. |
1938 | # |
1939 | -# You should have received a copy of the GNU General Public License |
1940 | +# You should have received a copy of the GNU Affero General Public License |
1941 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1942 | # |
1943 | ############################################################################## |
1944 | |
1945 | === modified file 'account_banking/wizard/bank_import.py' |
1946 | --- account_banking/wizard/bank_import.py 2013-05-06 14:07:27 +0000 |
1947 | +++ account_banking/wizard/bank_import.py 2013-05-06 14:07:28 +0000 |
1948 | @@ -5,16 +5,16 @@ |
1949 | # All Rights Reserved |
1950 | # |
1951 | # This program is free software: you can redistribute it and/or modify |
1952 | -# it under the terms of the GNU General Public License as published by |
1953 | +# it under the terms of the GNU Affero General Public License as published by |
1954 | # the Free Software Foundation, either version 3 of the License, or |
1955 | # (at your option) any later version. |
1956 | # |
1957 | # This program is distributed in the hope that it will be useful, |
1958 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1959 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1960 | -# GNU General Public License for more details. |
1961 | +# GNU Affero General Public License for more details. |
1962 | # |
1963 | -# You should have received a copy of the GNU General Public License |
1964 | +# You should have received a copy of the GNU Affero General Public License |
1965 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1966 | # |
1967 | ############################################################################## |
1968 | @@ -28,19 +28,15 @@ |
1969 | The parsing is done in the parser modules. Every parser module is required to |
1970 | use parser.models as a mean of communication with the business logic. |
1971 | ''' |
1972 | -from osv import osv, fields |
1973 | -import time |
1974 | -import netsvc |
1975 | +from osv import orm, fields |
1976 | import base64 |
1977 | import datetime |
1978 | -from tools import config |
1979 | -from tools.translate import _ |
1980 | -from account_banking.parsers import models |
1981 | -from account_banking.parsers.convert import * |
1982 | -from account_banking.struct import struct |
1983 | -from account_banking import sepa |
1984 | -from banktools import * |
1985 | -import decimal_precision as dp |
1986 | +from openerp.tools.translate import _ |
1987 | +from openerp.addons.account_banking.parsers import models |
1988 | +from openerp.addons.account_banking.parsers import convert |
1989 | +from openerp.addons.account_banking.struct import struct |
1990 | +from openerp.addons.account_banking.wizard import banktools |
1991 | +from openerp.addons.decimal_precision import decimal_precision as dp |
1992 | |
1993 | bt = models.mem_bank_transaction |
1994 | |
1995 | @@ -54,7 +50,8 @@ |
1996 | ''' |
1997 | return models.parser_type.get_parser_types() |
1998 | |
1999 | -class banking_import_line(osv.osv_memory): |
2000 | + |
2001 | +class banking_import_line(orm.TransientModel): |
2002 | _name = 'banking.import.line' |
2003 | _description = 'Bank import lines' |
2004 | _columns = { |
2005 | @@ -95,10 +92,9 @@ |
2006 | ], 'Transaction type'), |
2007 | 'duplicate': fields.boolean('Duplicate'), |
2008 | } |
2009 | -banking_import_line() |
2010 | |
2011 | |
2012 | -class banking_import(osv.osv_memory): |
2013 | +class banking_import(orm.TransientModel): |
2014 | _name = 'account.banking.bank.import' |
2015 | |
2016 | def import_statements_file(self, cursor, uid, ids, context): |
2017 | @@ -121,7 +117,7 @@ |
2018 | parser_code = banking_import.parser |
2019 | parser = models.create_parser(parser_code) |
2020 | if not parser: |
2021 | - raise osv.except_osv( |
2022 | + raise orm.except_orm( |
2023 | _('ERROR!'), |
2024 | _('Unable to import parser %(parser)s. Parser class not found.') % |
2025 | {'parser': parser_code} |
2026 | @@ -135,7 +131,7 @@ |
2027 | statements = parser.parse(cursor, data) |
2028 | |
2029 | if any([x for x in statements if not x.is_valid()]): |
2030 | - raise osv.except_osv( |
2031 | + raise orm.except_orm( |
2032 | _('ERROR!'), |
2033 | _('The imported statements appear to be invalid! Check your file.') |
2034 | ) |
2035 | @@ -187,7 +183,7 @@ |
2036 | |
2037 | else: |
2038 | # Pull account info/currency |
2039 | - account_info = get_company_bank_account( |
2040 | + account_info = banktools.get_company_bank_account( |
2041 | self.pool, cursor, uid, statement.local_account, |
2042 | statement.local_currency, company, results.log |
2043 | ) |
2044 | @@ -244,7 +240,7 @@ |
2045 | # matching procedure |
2046 | statement_ids = statement_obj.search(cursor, uid, [ |
2047 | ('name', '=', statement.id), |
2048 | - ('date', '=', date2str(statement.date)), |
2049 | + ('date', '=', convert.date2str(statement.date)), |
2050 | ]) |
2051 | if statement_ids: |
2052 | results.log.append( |
2053 | @@ -255,11 +251,14 @@ |
2054 | continue |
2055 | |
2056 | # Get the period for the statement (as bank statement object checks this) |
2057 | - period_ids = period_obj.search(cursor, uid, [('company_id','=',company.id), |
2058 | - ('date_start','<=',statement.date), |
2059 | - ('date_stop','>=',statement.date), |
2060 | - ('special', '=', False)]) |
2061 | - |
2062 | + period_ids = period_obj.search( |
2063 | + cursor, uid, [ |
2064 | + ('company_id', '=', company.id), |
2065 | + ('date_start', '<=', statement.date), |
2066 | + ('date_stop', '>=', statement.date), |
2067 | + ('special', '=', False), |
2068 | + ], context=context) |
2069 | + |
2070 | if not period_ids: |
2071 | results.log.append( |
2072 | _('No period found covering statement date %(date)s, ' |
2073 | @@ -274,7 +273,7 @@ |
2074 | statement_id = statement_obj.create(cursor, uid, dict( |
2075 | name = statement.id, |
2076 | journal_id = account_info.journal_id.id, |
2077 | - date = date2str(statement.date), |
2078 | + date = convert.date2str(statement.date), |
2079 | balance_start = statement.start_balance, |
2080 | balance_end_real = statement.end_balance, |
2081 | balance_end = statement.end_balance, |
2082 | @@ -302,11 +301,9 @@ |
2083 | values['local_account'] = statement.local_account |
2084 | values['local_currency'] = statement.local_currency |
2085 | |
2086 | - transaction_id = import_transaction_obj.create(cursor, uid, values, context=context) |
2087 | - if transaction_id: |
2088 | - transaction_ids.append(transaction_id) |
2089 | - else: |
2090 | - osv.except_osv('Failed to create an import transaction resource','') |
2091 | + transaction_id = import_transaction_obj.create( |
2092 | + cursor, uid, values, context=context) |
2093 | + transaction_ids.append(transaction_id) |
2094 | |
2095 | results.stat_loaded_cnt += 1 |
2096 | |
2097 | @@ -422,7 +419,6 @@ |
2098 | 'State', readonly=True), |
2099 | 'import_id': fields.many2one( |
2100 | 'account.banking.imported.file', 'Import File'), |
2101 | - # osv_memory does not seem to support one2many |
2102 | 'statement_ids': fields.many2many( |
2103 | 'account.bank.statement', 'rel_wiz_statements', 'wizard_id', |
2104 | 'statement_id', 'Imported Bank Statements'), |
2105 | @@ -442,7 +438,3 @@ |
2106 | cr, uid, 'bank.import.transaction', context=c), |
2107 | 'parser': _default_parser_type, |
2108 | } |
2109 | - |
2110 | -banking_import() |
2111 | - |
2112 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2113 | |
2114 | === modified file 'account_banking/wizard/banking_transaction_wizard.py' |
2115 | --- account_banking/wizard/banking_transaction_wizard.py 2013-05-06 14:07:27 +0000 |
2116 | +++ account_banking/wizard/banking_transaction_wizard.py 2013-05-06 14:07:28 +0000 |
2117 | @@ -2,25 +2,26 @@ |
2118 | ############################################################################## |
2119 | # |
2120 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
2121 | -# (C) 2011 Therp BV (<http://therp.nl>). |
2122 | +# (C) 2011 - 2013 Therp BV (<http://therp.nl>). |
2123 | # (C) 2011 Smile (<http://smile.fr>). |
2124 | # All Rights Reserved |
2125 | # |
2126 | # This program is free software: you can redistribute it and/or modify |
2127 | -# it under the terms of the GNU General Public License as published by |
2128 | +# it under the terms of the GNU Affero General Public License as published by |
2129 | # the Free Software Foundation, either version 3 of the License, or |
2130 | # (at your option) any later version. |
2131 | # |
2132 | # This program is distributed in the hope that it will be useful, |
2133 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2134 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2135 | -# GNU General Public License for more details. |
2136 | +# GNU Affero General Public License for more details. |
2137 | # |
2138 | -# You should have received a copy of the GNU General Public License |
2139 | +# You should have received a copy of the GNU Affero General Public License |
2140 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2141 | # |
2142 | ############################################################################## |
2143 | -from osv import osv, fields |
2144 | + |
2145 | +from osv import orm, fields |
2146 | from openerp.tools.translate import _ |
2147 | |
2148 | """ |
2149 | @@ -31,7 +32,8 @@ |
2150 | |
2151 | """ |
2152 | |
2153 | -class banking_transaction_wizard(osv.osv_memory): |
2154 | + |
2155 | +class banking_transaction_wizard(orm.TransientModel): |
2156 | _name = 'banking.transaction.wizard' |
2157 | _description = 'Match transaction' |
2158 | |
2159 | @@ -78,7 +80,7 @@ |
2160 | cr, uid, ids[0], ['import_transaction_id'], |
2161 | context=context)['import_transaction_id'][0] # many2one tuple |
2162 | import_transaction_obj.match(cr, uid, [trans_id], context=context) |
2163 | - return True |
2164 | + return self.create_act_window(cr, uid, ids, context=None) |
2165 | |
2166 | def write(self, cr, uid, ids, vals, context=None): |
2167 | """ |
2168 | @@ -162,7 +164,7 @@ |
2169 | # transaction_obj.write( |
2170 | # cr, uid, wiz.import_transaction_id.id, |
2171 | # { 'invoice_id': False, }, context=context) |
2172 | - osv.except_osv( |
2173 | + orm.except_orm( |
2174 | _("No entry found for the selected invoice"), |
2175 | _("No entry found for the selected invoice. " + |
2176 | "Try manual reconciliation.")) |
2177 | @@ -184,7 +186,7 @@ |
2178 | move_line_id = line.id |
2179 | break |
2180 | if not move_line_id: |
2181 | - osv.except_osv( |
2182 | + orm.except_orm( |
2183 | _("Cannot select for reconcilion"), |
2184 | _("No entry found for the selected invoice. ")) |
2185 | else: |
2186 | @@ -222,7 +224,7 @@ |
2187 | """ |
2188 | Just a button that triggers a write. |
2189 | """ |
2190 | - return True |
2191 | + return self.create_act_window(cr, uid, ids, context=None) |
2192 | |
2193 | def disable_match(self, cr, uid, ids, context=None): |
2194 | """ |
2195 | @@ -255,7 +257,7 @@ |
2196 | if x['import_transaction_id']] |
2197 | self.pool.get('banking.import.transaction').clear_and_write( |
2198 | cr, uid, trans_ids, context=context) |
2199 | - return True |
2200 | + return self.create_act_window(cr, uid, ids, context=None) |
2201 | |
2202 | def reverse_duplicate(self, cr, uid, ids, context=None): |
2203 | if isinstance(ids, (int, float)): |
2204 | @@ -267,7 +269,7 @@ |
2205 | transaction_obj.write( |
2206 | cr, uid, wiz['import_transaction_id'][0], |
2207 | {'duplicate': not wiz['duplicate']}, context=context) |
2208 | - return True |
2209 | + return self.create_act_window(cr, uid, ids, context=None) |
2210 | |
2211 | def _get_default_match_type(self, cr, uid, context=None): |
2212 | """ |
2213 | |
2214 | === modified file 'account_banking/wizard/banktools.py' |
2215 | --- account_banking/wizard/banktools.py 2013-02-07 09:38:41 +0000 |
2216 | +++ account_banking/wizard/banktools.py 2013-05-06 14:07:28 +0000 |
2217 | @@ -1,29 +1,27 @@ |
2218 | -# -*- encoding: utf-8 -*- |
2219 | +# -*- coding: utf-8 -*- |
2220 | ############################################################################## |
2221 | # |
2222 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
2223 | # All Rights Reserved |
2224 | # |
2225 | # This program is free software: you can redistribute it and/or modify |
2226 | -# it under the terms of the GNU General Public License as published by |
2227 | +# it under the terms of the GNU Affero General Public License as published by |
2228 | # the Free Software Foundation, either version 3 of the License, or |
2229 | # (at your option) any later version. |
2230 | # |
2231 | # This program is distributed in the hope that it will be useful, |
2232 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2233 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2234 | -# GNU General Public License for more details. |
2235 | +# GNU Affero General Public License for more details. |
2236 | # |
2237 | -# You should have received a copy of the GNU General Public License |
2238 | +# You should have received a copy of the GNU Affero General Public License |
2239 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2240 | # |
2241 | ############################################################################## |
2242 | |
2243 | -import datetime |
2244 | -from tools.translate import _ |
2245 | -from account_banking.parsers import convert |
2246 | -from account_banking import sepa |
2247 | -from account_banking.struct import struct |
2248 | +from openerp.tools.translate import _ |
2249 | +from openerp.addons.account_banking import sepa |
2250 | +from openerp.addons.account_banking.struct import struct |
2251 | |
2252 | __all__ = [ |
2253 | 'get_period', |
2254 | @@ -33,54 +31,23 @@ |
2255 | 'create_bank_account', |
2256 | ] |
2257 | |
2258 | -def get_period(pool, cursor, uid, date, company, log): |
2259 | - ''' |
2260 | - Get a suitable period for the given date range and the given company. |
2261 | - ''' |
2262 | - fiscalyear_obj = pool.get('account.fiscalyear') |
2263 | - period_obj = pool.get('account.period') |
2264 | - if not date: |
2265 | - date = convert.date2str(datetime.datetime.today()) |
2266 | - |
2267 | - search_date = convert.date2str(date) |
2268 | - fiscalyear_ids = fiscalyear_obj.search(cursor, uid, [ |
2269 | - ('date_start','<=', search_date), ('date_stop','>=', search_date), |
2270 | - ('state','=','draft'), ('company_id','=',company.id) |
2271 | - ]) |
2272 | - if not fiscalyear_ids: |
2273 | - fiscalyear_ids = fiscalyear_obj.search(cursor, uid, [ |
2274 | - ('date_start','<=',search_date), ('date_stop','>=',search_date), |
2275 | - ('state','=','draft'), ('company_id','=',None) |
2276 | - ]) |
2277 | - if not fiscalyear_ids: |
2278 | - log.append( |
2279 | - _('No suitable fiscal year found for date %(date)s and company %(company_name)s') |
2280 | - % dict(company_name=company.name, date=date) |
2281 | - ) |
2282 | - return False |
2283 | - elif len(fiscalyear_ids) > 1: |
2284 | - log.append( |
2285 | - _('Multiple overlapping fiscal years found for date %(date)s and company %(company_name)s') |
2286 | - % dict(company_name=company.name, date=date) |
2287 | - ) |
2288 | - return False |
2289 | - |
2290 | - fiscalyear_id = fiscalyear_ids[0] |
2291 | - period_ids = period_obj.search(cursor, uid, [ |
2292 | - ('date_start','<=',search_date), ('date_stop','>=',search_date), |
2293 | - ('fiscalyear_id','=',fiscalyear_id), ('state','=','draft'), |
2294 | - ('special', '=', False), |
2295 | - ]) |
2296 | - if not period_ids: |
2297 | - log.append(_('No suitable period found for date %(date)s and company %(company_name)s') |
2298 | - % dict(company_name=company.name, date=date) |
2299 | - ) |
2300 | - return False |
2301 | - if len(period_ids) != 1: |
2302 | - log.append(_('Multiple overlapping periods for date %(date)s and company %(company_name)s') |
2303 | - % dict(company_name=company.name, date=date) |
2304 | - ) |
2305 | - return False |
2306 | +def get_period(pool, cr, uid, date, company, log=None): |
2307 | + ''' |
2308 | + Wrapper over account_period.find() to log exceptions of |
2309 | + missing periods instead of raising. |
2310 | + ''' |
2311 | + context = {'account_period_prefer_normal': True} |
2312 | + if company: |
2313 | + context['company_id'] = company.id |
2314 | + try: |
2315 | + period_ids = pool.get('account.period').find( |
2316 | + cr, uid, dt=date, context=context) |
2317 | + except Exception, e: |
2318 | + if log is None: |
2319 | + raise |
2320 | + else: |
2321 | + log.append(e) |
2322 | + return False |
2323 | return period_ids[0] |
2324 | |
2325 | def get_bank_accounts(pool, cursor, uid, account_number, log, fail=False): |
2326 | @@ -119,7 +86,8 @@ |
2327 | return False |
2328 | |
2329 | def get_or_create_partner(pool, cr, uid, name, address, postal_code, city, |
2330 | - country_code, log, context=None): |
2331 | + country_code, log, supplier=False, customer=False, |
2332 | + context=None): |
2333 | ''' |
2334 | Get or create the partner belonging to the account holders name <name> |
2335 | |
2336 | @@ -141,11 +109,11 @@ |
2337 | cr, uid, [('code', '=', country_code.upper())], |
2338 | context=context) |
2339 | country_id = country_ids and country_ids[0] or False |
2340 | - criteria.append(('address.country_id', '=', country_id)) |
2341 | + criteria.append(('country_id', '=', country_id)) |
2342 | if city: |
2343 | - criteria.append(('address.city', 'ilike', city)) |
2344 | + criteria.append(('city', 'ilike', city)) |
2345 | if postal_code: |
2346 | - criteria.append(('address.zip', 'ilike', postal_code)) |
2347 | + criteria.append(('zip', 'ilike', postal_code)) |
2348 | partner_search_ids = partner_obj.search( |
2349 | cr, uid, criteria, context=context) |
2350 | key = name.lower() |
2351 | @@ -164,16 +132,20 @@ |
2352 | user.company_id.partner_id.country.id or |
2353 | False |
2354 | ) |
2355 | - partner_id = partner_obj.create(cr, uid, dict( |
2356 | - name=name, active=True, |
2357 | - comment='Generated from Bank Statements Import', |
2358 | - address=[(0,0,{ |
2359 | + partner_id = partner_obj.create( |
2360 | + cr, uid, { |
2361 | + 'name': name, |
2362 | + 'active': True, |
2363 | + 'comment': 'Generated from Bank Statements Import', |
2364 | 'street': address and address[0] or '', |
2365 | 'street2': len(address) > 1 and address[1] or '', |
2366 | 'city': city, |
2367 | 'zip': postal_code or '', |
2368 | 'country_id': country_id, |
2369 | - })]), context=context) |
2370 | + 'is_company': True, |
2371 | + 'supplier': supplier, |
2372 | + 'customer': customer, |
2373 | + }, context=context) |
2374 | else: |
2375 | if len(partner_ids) > 1: |
2376 | log.append( |
2377 | |
2378 | === modified file 'account_banking_fi_patu/__init__.py' |
2379 | --- account_banking_fi_patu/__init__.py 2010-06-30 07:11:08 +0000 |
2380 | +++ account_banking_fi_patu/__init__.py 2013-05-06 14:07:28 +0000 |
2381 | @@ -12,16 +12,16 @@ |
2382 | # garantees and support are strongly adviced to contract EduSense BV |
2383 | # |
2384 | # This program is free software: you can redistribute it and/or modify |
2385 | -# it under the terms of the GNU General Public License as published by |
2386 | +# it under the terms of the GNU Affero General Public License as published by |
2387 | # the Free Software Foundation, either version 3 of the License, or |
2388 | # (at your option) any later version. |
2389 | # |
2390 | # This program is distributed in the hope that it will be useful, |
2391 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2392 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2393 | -# GNU General Public License for more details. |
2394 | +# GNU Affero General Public License for more details. |
2395 | # |
2396 | -# You should have received a copy of the GNU General Public License |
2397 | +# You should have received a copy of the GNU Affero General Public License |
2398 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2399 | # |
2400 | ############################################################################## |
2401 | |
2402 | === renamed file 'account_banking_fi_patu/__terp__.py' => 'account_banking_fi_patu/__openerp__.py' |
2403 | --- account_banking_fi_patu/__terp__.py 2011-05-05 10:29:28 +0000 |
2404 | +++ account_banking_fi_patu/__openerp__.py 2013-05-06 14:07:28 +0000 |
2405 | @@ -11,23 +11,23 @@ |
2406 | # garantees and support are strongly adviced to contract EduSense BV |
2407 | # |
2408 | # This program is free software: you can redistribute it and/or modify |
2409 | -# it under the terms of the GNU General Public License as published by |
2410 | +# it under the terms of the GNU Affero General Public License as published by |
2411 | # the Free Software Foundation, either version 3 of the License, or |
2412 | # (at your option) any later version. |
2413 | # |
2414 | # This program is distributed in the hope that it will be useful, |
2415 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2416 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2417 | -# GNU General Public License for more details. |
2418 | +# GNU Affero General Public License for more details. |
2419 | # |
2420 | -# You should have received a copy of the GNU General Public License |
2421 | +# You should have received a copy of the GNU Affero General Public License |
2422 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2423 | # |
2424 | ############################################################################## |
2425 | { |
2426 | 'name': 'Account Banking PATU module', |
2427 | 'version': '0.62', |
2428 | - 'license': 'GPL-3', |
2429 | + 'license': 'AGPL-3', |
2430 | 'author': 'Sami Haahtinen', |
2431 | 'website': 'http://ressukka.net', |
2432 | 'category': 'Account Banking', |
2433 | |
2434 | === modified file 'account_banking_fi_patu/patu.py' |
2435 | --- account_banking_fi_patu/patu.py 2012-01-17 08:48:10 +0000 |
2436 | +++ account_banking_fi_patu/patu.py 2013-05-06 14:07:28 +0000 |
2437 | @@ -6,16 +6,16 @@ |
2438 | # All Rights Reserved |
2439 | # |
2440 | # This program is free software: you can redistribute it and/or modify |
2441 | -# it under the terms of the GNU General Public License as published by |
2442 | +# it under the terms of the GNU Affero General Public License as published by |
2443 | # the Free Software Foundation, either version 3 of the License, or |
2444 | # (at your option) any later version. |
2445 | # |
2446 | # This program is distributed in the hope that it will be useful, |
2447 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2448 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2449 | -# GNU General Public License for more details. |
2450 | +# GNU Affero General Public License for more details. |
2451 | # |
2452 | -# You should have received a copy of the GNU General Public License |
2453 | +# You should have received a copy of the GNU Affero General Public License |
2454 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2455 | # |
2456 | ############################################################################## |
2457 | |
2458 | === modified file 'account_banking_nl_abnamro/__init__.py' |
2459 | --- account_banking_nl_abnamro/__init__.py 2011-04-26 21:00:12 +0000 |
2460 | +++ account_banking_nl_abnamro/__init__.py 2013-05-06 14:07:28 +0000 |
2461 | @@ -1,31 +1,2 @@ |
2462 | -# -*- encoding: utf-8 -*- |
2463 | -############################################################################## |
2464 | -# |
2465 | -# Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) |
2466 | -# and Therp BV (<http://therp.nl>) |
2467 | -# All Rights Reserved |
2468 | -# |
2469 | -# WARNING: This program as such is intended to be used by professional |
2470 | -# programmers who take the whole responsability of assessing all potential |
2471 | -# consequences resulting from its eventual inadequacies and bugs |
2472 | -# End users who are looking for a ready-to-use solution with commercial |
2473 | -# garantees and support are strongly adviced to contract EduSense BV |
2474 | -# or Therp BV |
2475 | -# |
2476 | -# This program is free software: you can redistribute it and/or modify |
2477 | -# it under the terms of the GNU General Public License as published by |
2478 | -# the Free Software Foundation, either version 3 of the License, or |
2479 | -# (at your option) any later version. |
2480 | -# |
2481 | -# This program is distributed in the hope that it will be useful, |
2482 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2483 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2484 | -# GNU General Public License for more details. |
2485 | -# |
2486 | -# You should have received a copy of the GNU General Public License |
2487 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2488 | -# |
2489 | -############################################################################## |
2490 | +# -*- coding: utf-8 -*- |
2491 | import abnamro |
2492 | - |
2493 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2494 | |
2495 | === modified file 'account_banking_nl_abnamro/__openerp__.py' |
2496 | --- account_banking_nl_abnamro/__openerp__.py 2013-02-26 21:06:36 +0000 |
2497 | +++ account_banking_nl_abnamro/__openerp__.py 2013-05-06 14:07:28 +0000 |
2498 | @@ -1,43 +1,33 @@ |
2499 | +# -*- coding: utf-8 -*- |
2500 | ############################################################################## |
2501 | # |
2502 | # Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) |
2503 | # and Therp BV (<http://therp.nl>) |
2504 | # All Rights Reserved |
2505 | # |
2506 | -# WARNING: This program as such is intended to be used by professional |
2507 | -# programmers who take the whole responsability of assessing all potential |
2508 | -# consequences resulting from its eventual inadequacies and bugs |
2509 | -# End users who are looking for a ready-to-use solution with commercial |
2510 | -# garantees and support are strongly adviced to contract EduSense BV |
2511 | -# or Therp BV |
2512 | -# |
2513 | # This program is free software: you can redistribute it and/or modify |
2514 | -# it under the terms of the GNU General Public License as published by |
2515 | -# the Free Software Foundation, either version 3 of the License, or |
2516 | -# (at your option) any later version. |
2517 | +# it under the terms of the GNU Affero General Public License as |
2518 | +# published by the Free Software Foundation, either version 3 of the |
2519 | +# License, or (at your option) any later version. |
2520 | # |
2521 | # This program is distributed in the hope that it will be useful, |
2522 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2523 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2524 | -# GNU General Public License for more details. |
2525 | +# GNU Affero General Public License for more details. |
2526 | # |
2527 | -# You should have received a copy of the GNU General Public License |
2528 | +# You should have received a copy of the GNU Affero General Public License |
2529 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2530 | # |
2531 | ############################################################################## |
2532 | + |
2533 | { |
2534 | 'name': 'abnamro (NL) Bank Statements Import', |
2535 | 'version': '0.1', |
2536 | - 'license': 'GPL-3', |
2537 | - 'author': 'Therp BV / EduSense BV', |
2538 | - 'website': 'https://launchpad.net/account-banking', |
2539 | - 'category': 'Account Banking', |
2540 | + 'license': 'AGPL-3', |
2541 | + 'author': ['Therp BV', 'EduSense BV'], |
2542 | + 'website': 'https://launchpad.net/banking-addons', |
2543 | + 'category': 'Banking addons', |
2544 | 'depends': ['account_banking'], |
2545 | - 'init_xml': [], |
2546 | - 'update_xml': [ |
2547 | - #'security/ir.model.access.csv', |
2548 | - ], |
2549 | - 'demo_xml': [], |
2550 | 'description': ''' |
2551 | Import filter for abnamro (NL) bank transaction files (txt/tab format). |
2552 | |
2553 | @@ -48,6 +38,5 @@ |
2554 | Imported bank transfers are organized in statements covering periods of one week, |
2555 | even if the imported files cover a different period. |
2556 | ''', |
2557 | - 'active': False, |
2558 | - 'installable': False, |
2559 | + 'installable': True, |
2560 | } |
2561 | |
2562 | === removed file 'account_banking_nl_abnamro/__terp__.py' |
2563 | --- account_banking_nl_abnamro/__terp__.py 2011-05-05 10:29:28 +0000 |
2564 | +++ account_banking_nl_abnamro/__terp__.py 1970-01-01 00:00:00 +0000 |
2565 | @@ -1,53 +0,0 @@ |
2566 | -############################################################################## |
2567 | -# |
2568 | -# Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) |
2569 | -# and Therp BV (<http://therp.nl>) |
2570 | -# All Rights Reserved |
2571 | -# |
2572 | -# WARNING: This program as such is intended to be used by professional |
2573 | -# programmers who take the whole responsability of assessing all potential |
2574 | -# consequences resulting from its eventual inadequacies and bugs |
2575 | -# End users who are looking for a ready-to-use solution with commercial |
2576 | -# garantees and support are strongly adviced to contract EduSense BV |
2577 | -# or Therp BV |
2578 | -# |
2579 | -# This program is free software: you can redistribute it and/or modify |
2580 | -# it under the terms of the GNU General Public License as published by |
2581 | -# the Free Software Foundation, either version 3 of the License, or |
2582 | -# (at your option) any later version. |
2583 | -# |
2584 | -# This program is distributed in the hope that it will be useful, |
2585 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2586 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2587 | -# GNU General Public License for more details. |
2588 | -# |
2589 | -# You should have received a copy of the GNU General Public License |
2590 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
2591 | -# |
2592 | -############################################################################## |
2593 | -{ |
2594 | - 'name': 'abnamro (NL) Bank Statements Import', |
2595 | - 'version': '0.62', |
2596 | - 'license': 'GPL-3', |
2597 | - 'author': 'Therp BV / EduSense BV', |
2598 | - 'website': 'https://launchpad.net/account-banking', |
2599 | - 'category': 'Account Banking', |
2600 | - 'depends': ['account_banking'], |
2601 | - 'init_xml': [], |
2602 | - 'update_xml': [ |
2603 | - #'security/ir.model.access.csv', |
2604 | - ], |
2605 | - 'demo_xml': [], |
2606 | - 'description': ''' |
2607 | -Import filter for abnamro (NL) bank transaction files (txt/tab format). |
2608 | - |
2609 | -No formal specifications of the file layout are released by abnamro. You can |
2610 | -help improve the performance of this import filter on |
2611 | -https://launchpad.net/account-banking. |
2612 | - |
2613 | -Imported bank transfers are organized in statements covering periods of one week, |
2614 | -even if the imported files cover a different period. |
2615 | - ''', |
2616 | - 'active': False, |
2617 | - 'installable': True, |
2618 | -} |
2619 | |
2620 | === modified file 'account_banking_nl_abnamro/abnamro.py' |
2621 | --- account_banking_nl_abnamro/abnamro.py 2013-04-17 14:24:33 +0000 |
2622 | +++ account_banking_nl_abnamro/abnamro.py 2013-05-06 14:07:28 +0000 |
2623 | @@ -1,21 +1,22 @@ |
2624 | -# -*- encoding: utf-8 -*- |
2625 | +# -*- coding: utf-8 -*- |
2626 | ############################################################################## |
2627 | # |
2628 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>) |
2629 | # 2011 Therp BV (<http://therp.nl>) |
2630 | +# |
2631 | # All Rights Reserved |
2632 | # |
2633 | # This program is free software: you can redistribute it and/or modify |
2634 | -# it under the terms of the GNU General Public License as published by |
2635 | -# the Free Software Foundation, either version 3 of the License, or |
2636 | -# (at your option) any later version. |
2637 | +# it under the terms of the GNU Affero General Public License as |
2638 | +# published by the Free Software Foundation, either version 3 of the |
2639 | +# License, or (at your option) any later version. |
2640 | # |
2641 | # This program is distributed in the hope that it will be useful, |
2642 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2643 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2644 | -# GNU General Public License for more details. |
2645 | +# GNU Affero General Public License for more details. |
2646 | # |
2647 | -# You should have received a copy of the GNU General Public License |
2648 | +# You should have received a copy of the GNU Affero General Public License |
2649 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2650 | # |
2651 | ############################################################################## |
2652 | @@ -28,11 +29,11 @@ |
2653 | Every transaction is bound to a Bank Statement. As such, this module generates |
2654 | Bank Statements along with Bank Transactions. |
2655 | ''' |
2656 | -from account_banking.parsers import models |
2657 | -from account_banking.parsers.convert import str2date |
2658 | -from account_banking.sepa import postalcode |
2659 | -from tools.translate import _ |
2660 | -from osv import osv |
2661 | +from openerp.addons.account_banking.parsers import models |
2662 | +from openerp.addons.account_banking.parsers.convert import str2date |
2663 | +from openerp.addons.account_banking.sepa import postalcode |
2664 | +from openerp.tools.translate import _ |
2665 | +from openerp.osv import orm |
2666 | |
2667 | import re |
2668 | import csv |
2669 | @@ -120,7 +121,7 @@ |
2670 | self.error_message = _('No remote account for transaction type ' |
2671 | '%s') % self.transfer_type |
2672 | if self.error_message: |
2673 | - raise osv.except_osv(_('Error !'), _(self.error_message)) |
2674 | + raise orm.except_orm(_('Error !'), _(self.error_message)) |
2675 | return not self.error_message |
2676 | |
2677 | def parse_message(self): |
2678 | @@ -223,7 +224,7 @@ |
2679 | remote_account = account_match.group(1).zfill(10) |
2680 | remote_owner = account_match.group(2).strip() or '' |
2681 | else: |
2682 | - raise osv.except_osv( |
2683 | + raise orm.except_orm( |
2684 | _('Error !'), |
2685 | _('unable to parse GIRO string: %s') % field) |
2686 | elif field.startswith('BEA '): |
2687 | |
2688 | === modified file 'account_banking_nl_clieop/__init__.py' |
2689 | --- account_banking_nl_clieop/__init__.py 2010-01-26 20:55:24 +0000 |
2690 | +++ account_banking_nl_clieop/__init__.py 2013-05-06 14:07:28 +0000 |
2691 | @@ -11,16 +11,16 @@ |
2692 | # garantees and support are strongly adviced to contract EduSense BV |
2693 | # |
2694 | # This program is free software: you can redistribute it and/or modify |
2695 | -# it under the terms of the GNU General Public License as published by |
2696 | +# it under the terms of the GNU Affero General Public License as published by |
2697 | # the Free Software Foundation, either version 3 of the License, or |
2698 | # (at your option) any later version. |
2699 | # |
2700 | # This program is distributed in the hope that it will be useful, |
2701 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2702 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2703 | -# GNU General Public License for more details. |
2704 | +# GNU Affero General Public License for more details. |
2705 | # |
2706 | -# You should have received a copy of the GNU General Public License |
2707 | +# You should have received a copy of the GNU Affero General Public License |
2708 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2709 | # |
2710 | ############################################################################## |
2711 | |
2712 | === renamed file 'account_banking_nl_clieop/__terp__.py' => 'account_banking_nl_clieop/__openerp__.py' |
2713 | --- account_banking_nl_clieop/__terp__.py 2013-05-06 14:07:27 +0000 |
2714 | +++ account_banking_nl_clieop/__openerp__.py 2013-05-06 14:07:28 +0000 |
2715 | @@ -3,48 +3,39 @@ |
2716 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
2717 | # All Rights Reserved |
2718 | # |
2719 | -# WARNING: This program as such is intended to be used by professional |
2720 | -# programmers who take the whole responsability of assessing all potential |
2721 | -# consequences resulting from its eventual inadequacies and bugs |
2722 | -# End users who are looking for a ready-to-use solution with commercial |
2723 | -# garantees and support are strongly adviced to contract EduSense BV |
2724 | -# |
2725 | # This program is free software: you can redistribute it and/or modify |
2726 | -# it under the terms of the GNU General Public License as published by |
2727 | +# it under the terms of the GNU Affero General Public License as published by |
2728 | # the Free Software Foundation, either version 3 of the License, or |
2729 | # (at your option) any later version. |
2730 | # |
2731 | # This program is distributed in the hope that it will be useful, |
2732 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2733 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2734 | -# GNU General Public License for more details. |
2735 | +# GNU Affero General Public License for more details. |
2736 | # |
2737 | -# You should have received a copy of the GNU General Public License |
2738 | +# You should have received a copy of the GNU Affero General Public License |
2739 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2740 | # |
2741 | ############################################################################## |
2742 | { |
2743 | 'name': 'Account Banking NL ClieOp', |
2744 | 'version': '0.92', |
2745 | - 'license': 'GPL-3', |
2746 | + 'license': 'AGPL-3', |
2747 | 'author': 'EduSense BV', |
2748 | 'website': 'http://www.edusense.nl', |
2749 | 'category': 'Account Banking', |
2750 | 'depends': ['account_banking_payment'], |
2751 | - 'init_xml': [], |
2752 | - 'update_xml': [ |
2753 | + 'data': [ |
2754 | 'account_banking_nl_clieop.xml', |
2755 | 'wizard/export_clieop_view.xml', |
2756 | 'data/banking_export_clieop.xml', |
2757 | 'security/ir.model.access.csv', |
2758 | ], |
2759 | - 'demo_xml': [], |
2760 | 'description': ''' |
2761 | Module to export payment orders in ClieOp format. |
2762 | |
2763 | ClieOp format is used by Dutch banks to batch national bank transfers. |
2764 | This module uses the account_banking logic. |
2765 | ''', |
2766 | - 'active': False, |
2767 | - 'installable': True, |
2768 | + 'installable': False, |
2769 | } |
2770 | |
2771 | === modified file 'account_banking_nl_clieop/account_banking_nl_clieop.py' |
2772 | --- account_banking_nl_clieop/account_banking_nl_clieop.py 2012-12-30 10:55:49 +0000 |
2773 | +++ account_banking_nl_clieop/account_banking_nl_clieop.py 2013-05-06 14:07:28 +0000 |
2774 | @@ -4,16 +4,16 @@ |
2775 | # All Rights Reserved |
2776 | # |
2777 | # This program is free software: you can redistribute it and/or modify |
2778 | -# it under the terms of the GNU General Public License as published by |
2779 | +# it under the terms of the GNU Affero General Public License as published by |
2780 | # the Free Software Foundation, either version 3 of the License, or |
2781 | # (at your option) any later version. |
2782 | # |
2783 | # This program is distributed in the hope that it will be useful, |
2784 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2785 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2786 | -# GNU General Public License for more details. |
2787 | +# GNU Affero General Public License for more details. |
2788 | # |
2789 | -# You should have received a copy of the GNU General Public License |
2790 | +# You should have received a copy of the GNU Affero General Public License |
2791 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2792 | # |
2793 | ############################################################################## |
2794 | |
2795 | === modified file 'account_banking_nl_clieop/migrations/0.63/post-fill-ir_model_id.py' |
2796 | --- account_banking_nl_clieop/migrations/0.63/post-fill-ir_model_id.py 2011-07-24 18:58:32 +0000 |
2797 | +++ account_banking_nl_clieop/migrations/0.63/post-fill-ir_model_id.py 2013-05-06 14:07:28 +0000 |
2798 | @@ -4,16 +4,16 @@ |
2799 | # Copyright (C) 2011 Therp BV (<http://therp.nl>) |
2800 | # |
2801 | # This program is free software: you can redistribute it and/or modify |
2802 | -# it under the terms of the GNU General Public License as published by |
2803 | +# it under the terms of the GNU Affero General Public License as published by |
2804 | # the Free Software Foundation, either version 3 of the License, or |
2805 | # (at your option) any later version. |
2806 | # |
2807 | # This program is distributed in the hope that it will be useful, |
2808 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2809 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2810 | -# GNU General Public License for more details. |
2811 | +# GNU Affero General Public License for more details. |
2812 | # |
2813 | -# You should have received a copy of the GNU General Public License |
2814 | +# You should have received a copy of the GNU Affero General Public License |
2815 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2816 | # |
2817 | ############################################################################## |
2818 | |
2819 | === modified file 'account_banking_nl_clieop/migrations/0.64/post-set-payment-order-type.py' |
2820 | --- account_banking_nl_clieop/migrations/0.64/post-set-payment-order-type.py 2011-12-27 12:00:52 +0000 |
2821 | +++ account_banking_nl_clieop/migrations/0.64/post-set-payment-order-type.py 2013-05-06 14:07:28 +0000 |
2822 | @@ -4,16 +4,16 @@ |
2823 | # Copyright (C) 2011 Therp BV (<http://therp.nl>) |
2824 | # |
2825 | # This program is free software: you can redistribute it and/or modify |
2826 | -# it under the terms of the GNU General Public License as published by |
2827 | +# it under the terms of the GNU Affero General Public License as published by |
2828 | # the Free Software Foundation, either version 3 of the License, or |
2829 | # (at your option) any later version. |
2830 | # |
2831 | # This program is distributed in the hope that it will be useful, |
2832 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2833 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2834 | -# GNU General Public License for more details. |
2835 | +# GNU Affero General Public License for more details. |
2836 | # |
2837 | -# You should have received a copy of the GNU General Public License |
2838 | +# You should have received a copy of the GNU Affero General Public License |
2839 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2840 | # |
2841 | ############################################################################## |
2842 | |
2843 | === modified file 'account_banking_nl_clieop/wizard/__init__.py' |
2844 | --- account_banking_nl_clieop/wizard/__init__.py 2010-01-26 20:55:24 +0000 |
2845 | +++ account_banking_nl_clieop/wizard/__init__.py 2013-05-06 14:07:28 +0000 |
2846 | @@ -5,16 +5,16 @@ |
2847 | # All Rights Reserved |
2848 | # |
2849 | # This program is free software: you can redistribute it and/or modify |
2850 | -# it under the terms of the GNU General Public License as published by |
2851 | +# it under the terms of the GNU Affero General Public License as published by |
2852 | # the Free Software Foundation, either version 3 of the License, or |
2853 | # (at your option) any later version. |
2854 | # |
2855 | # This program is distributed in the hope that it will be useful, |
2856 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2857 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2858 | -# GNU General Public License for more details. |
2859 | +# GNU Affero General Public License for more details. |
2860 | # |
2861 | -# You should have received a copy of the GNU General Public License |
2862 | +# You should have received a copy of the GNU Affero General Public License |
2863 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2864 | # |
2865 | ############################################################################## |
2866 | |
2867 | === modified file 'account_banking_nl_clieop/wizard/clieop.py' |
2868 | --- account_banking_nl_clieop/wizard/clieop.py 2013-01-28 10:19:32 +0000 |
2869 | +++ account_banking_nl_clieop/wizard/clieop.py 2013-05-06 14:07:28 +0000 |
2870 | @@ -5,16 +5,16 @@ |
2871 | # All Rights Reserved |
2872 | # |
2873 | # This program is free software: you can redistribute it and/or modify |
2874 | -# it under the terms of the GNU General Public License as published by |
2875 | +# it under the terms of the GNU Affero General Public License as published by |
2876 | # the Free Software Foundation, either version 3 of the License, or |
2877 | # (at your option) any later version. |
2878 | # |
2879 | # This program is distributed in the hope that it will be useful, |
2880 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2881 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2882 | -# GNU General Public License for more details. |
2883 | +# GNU Affero General Public License for more details. |
2884 | # |
2885 | -# You should have received a copy of the GNU General Public License |
2886 | +# You should have received a copy of the GNU Affero General Public License |
2887 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2888 | # |
2889 | ############################################################################## |
2890 | |
2891 | === modified file 'account_banking_nl_clieop/wizard/export_clieop.py' |
2892 | --- account_banking_nl_clieop/wizard/export_clieop.py 2013-01-02 15:14:53 +0000 |
2893 | +++ account_banking_nl_clieop/wizard/export_clieop.py 2013-05-06 14:07:28 +0000 |
2894 | @@ -5,16 +5,16 @@ |
2895 | # All Rights Reserved |
2896 | # |
2897 | # This program is free software: you can redistribute it and/or modify |
2898 | -# it under the terms of the GNU General Public License as published by |
2899 | +# it under the terms of the GNU Affero General Public License as published by |
2900 | # the Free Software Foundation, either version 3 of the License, or |
2901 | # (at your option) any later version. |
2902 | # |
2903 | # This program is distributed in the hope that it will be useful, |
2904 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2905 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2906 | -# GNU General Public License for more details. |
2907 | +# GNU Affero General Public License for more details. |
2908 | # |
2909 | -# You should have received a copy of the GNU General Public License |
2910 | +# You should have received a copy of the GNU Affero General Public License |
2911 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2912 | # |
2913 | ############################################################################## |
2914 | |
2915 | === modified file 'account_banking_nl_girotel/__init__.py' |
2916 | --- account_banking_nl_girotel/__init__.py 2010-07-16 15:28:32 +0000 |
2917 | +++ account_banking_nl_girotel/__init__.py 2013-05-06 14:07:28 +0000 |
2918 | @@ -11,16 +11,16 @@ |
2919 | # garantees and support are strongly adviced to contract EduSense BV |
2920 | # |
2921 | # This program is free software: you can redistribute it and/or modify |
2922 | -# it under the terms of the GNU General Public License as published by |
2923 | +# it under the terms of the GNU Affero General Public License as published by |
2924 | # the Free Software Foundation, either version 3 of the License, or |
2925 | # (at your option) any later version. |
2926 | # |
2927 | # This program is distributed in the hope that it will be useful, |
2928 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2929 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2930 | -# GNU General Public License for more details. |
2931 | +# GNU Affero General Public License for more details. |
2932 | # |
2933 | -# You should have received a copy of the GNU General Public License |
2934 | +# You should have received a copy of the GNU Affero General Public License |
2935 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2936 | # |
2937 | ############################################################################## |
2938 | |
2939 | === renamed file 'account_banking_nl_girotel/__terp__.py' => 'account_banking_nl_girotel/__openerp__.py' |
2940 | --- account_banking_nl_girotel/__terp__.py 2011-05-05 10:29:28 +0000 |
2941 | +++ account_banking_nl_girotel/__openerp__.py 2013-05-06 14:07:28 +0000 |
2942 | @@ -3,44 +3,35 @@ |
2943 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
2944 | # All Rights Reserved |
2945 | # |
2946 | -# WARNING: This program as such is intended to be used by professional |
2947 | -# programmers who take the whole responsability of assessing all potential |
2948 | -# consequences resulting from its eventual inadequacies and bugs |
2949 | -# End users who are looking for a ready-to-use solution with commercial |
2950 | -# garantees and support are strongly adviced to contract EduSense BV |
2951 | -# |
2952 | # This program is free software: you can redistribute it and/or modify |
2953 | -# it under the terms of the GNU General Public License as published by |
2954 | +# it under the terms of the GNU Affero General Public License as published by |
2955 | # the Free Software Foundation, either version 3 of the License, or |
2956 | # (at your option) any later version. |
2957 | # |
2958 | # This program is distributed in the hope that it will be useful, |
2959 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2960 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2961 | -# GNU General Public License for more details. |
2962 | +# GNU Affero General Public License for more details. |
2963 | # |
2964 | -# You should have received a copy of the GNU General Public License |
2965 | +# You should have received a copy of the GNU Affero General Public License |
2966 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
2967 | # |
2968 | ############################################################################## |
2969 | { |
2970 | 'name': 'Account Banking - Girotel', |
2971 | 'version': '0.62', |
2972 | - 'license': 'GPL-3', |
2973 | + 'license': 'AGPL-3', |
2974 | 'author': 'EduSense BV', |
2975 | 'website': 'http://www.edusense.nl', |
2976 | 'category': 'Account Banking', |
2977 | 'depends': ['account_banking'], |
2978 | - 'init_xml': [], |
2979 | - 'update_xml': [ |
2980 | + 'data': [ |
2981 | #'security/ir.model.access.csv', |
2982 | ], |
2983 | - 'demo_xml': [], |
2984 | 'description': ''' |
2985 | Module to import Dutch Girotel format transation files. |
2986 | |
2987 | This modules contains no logic, just an import filter for account_banking. |
2988 | ''', |
2989 | - 'active': False, |
2990 | 'installable': True, |
2991 | } |
2992 | |
2993 | === modified file 'account_banking_nl_girotel/girotel.py' |
2994 | --- account_banking_nl_girotel/girotel.py 2012-07-09 17:04:14 +0000 |
2995 | +++ account_banking_nl_girotel/girotel.py 2013-05-06 14:07:28 +0000 |
2996 | @@ -5,16 +5,16 @@ |
2997 | # All Rights Reserved |
2998 | # |
2999 | # This program is free software: you can redistribute it and/or modify |
3000 | -# it under the terms of the GNU General Public License as published by |
3001 | +# it under the terms of the GNU Affero General Public License as published by |
3002 | # the Free Software Foundation, either version 3 of the License, or |
3003 | # (at your option) any later version. |
3004 | # |
3005 | # This program is distributed in the hope that it will be useful, |
3006 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3007 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3008 | -# GNU General Public License for more details. |
3009 | +# GNU Affero General Public License for more details. |
3010 | # |
3011 | -# You should have received a copy of the GNU General Public License |
3012 | +# You should have received a copy of the GNU Affero General Public License |
3013 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3014 | # |
3015 | ############################################################################## |
3016 | |
3017 | === modified file 'account_banking_nl_ing/__init__.py' |
3018 | --- account_banking_nl_ing/__init__.py 2011-12-11 16:09:20 +0000 |
3019 | +++ account_banking_nl_ing/__init__.py 2013-05-06 14:07:28 +0000 |
3020 | @@ -1,4 +1,2 @@ |
3021 | -# -*- encoding: utf-8 -*- |
3022 | +# -*- coding: utf-8 -*- |
3023 | import ing |
3024 | - |
3025 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
3026 | |
3027 | === modified file 'account_banking_nl_ing/__openerp__.py' |
3028 | --- account_banking_nl_ing/__openerp__.py 2013-02-26 21:06:36 +0000 |
3029 | +++ account_banking_nl_ing/__openerp__.py 2013-05-06 14:07:28 +0000 |
3030 | @@ -8,39 +8,29 @@ |
3031 | # |
3032 | # All Rights Reserved |
3033 | # |
3034 | -# WARNING: This program as such is intended to be used by professional |
3035 | -# programmers who take the whole responsability of assessing all potential |
3036 | -# consequences resulting from its eventual inadequacies and bugs |
3037 | -# End users who are looking for a ready-to-use solution with commercial |
3038 | -# garantees and support are strongly adviced to contract EduSense BV |
3039 | -# or Therp BV |
3040 | -# |
3041 | # This program is free software: you can redistribute it and/or modify |
3042 | -# it under the terms of the GNU General Public License as published by |
3043 | -# the Free Software Foundation, either version 3 of the License, or |
3044 | -# (at your option) any later version. |
3045 | +# it under the terms of the GNU Affero General Public License as |
3046 | +# published by the Free Software Foundation, either version 3 of the |
3047 | +# License, or (at your option) any later version. |
3048 | # |
3049 | # This program is distributed in the hope that it will be useful, |
3050 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3051 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3052 | -# GNU General Public License for more details. |
3053 | +# GNU Affero General Public License for more details. |
3054 | # |
3055 | -# You should have received a copy of the GNU General Public License |
3056 | +# You should have received a copy of the GNU Affero General Public License |
3057 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3058 | # |
3059 | ############################################################################## |
3060 | + |
3061 | { |
3062 | 'name': 'ING (NL) Bank Statements Import', |
3063 | 'version': '0.1.140', |
3064 | - 'license': 'GPL-3', |
3065 | + 'license': 'AGPL-3', |
3066 | 'author': ['Smile', 'Therp BV', 'EduSense BV'], |
3067 | 'website': 'https://launchpad.net/banking-addons', |
3068 | 'category': 'Banking addons', |
3069 | 'depends': ['account_banking'], |
3070 | - 'init_xml': [], |
3071 | - 'update_xml': [ |
3072 | - ], |
3073 | - 'demo_xml': [], |
3074 | 'description': ''' |
3075 | Module to import Dutch ING bank format transaction files. The format covered |
3076 | is the CSV format with either 'dd-mm-yyyy' or 'yyyymmdd' date syntax. |
3077 | @@ -57,6 +47,5 @@ |
3078 | |
3079 | This modules contains no logic, just an import filter for account_banking. |
3080 | ''', |
3081 | - 'active': False, |
3082 | - 'installable': False, |
3083 | + 'installable': True, |
3084 | } |
3085 | |
3086 | === removed file 'account_banking_nl_ing/__terp__.py' |
3087 | --- account_banking_nl_ing/__terp__.py 2011-12-21 11:26:36 +0000 |
3088 | +++ account_banking_nl_ing/__terp__.py 1970-01-01 00:00:00 +0000 |
3089 | @@ -1,58 +0,0 @@ |
3090 | -############################################################################## |
3091 | -# |
3092 | -# Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) |
3093 | -# and Therp BV (<http://therp.nl>) |
3094 | -# All Rights Reserved |
3095 | -# |
3096 | -# WARNING: This program as such is intended to be used by professional |
3097 | -# programmers who take the whole responsability of assessing all potential |
3098 | -# consequences resulting from its eventual inadequacies and bugs |
3099 | -# End users who are looking for a ready-to-use solution with commercial |
3100 | -# garantees and support are strongly adviced to contract EduSense BV |
3101 | -# or Therp BV |
3102 | -# |
3103 | -# This program is free software: you can redistribute it and/or modify |
3104 | -# it under the terms of the GNU General Public License as published by |
3105 | -# the Free Software Foundation, either version 3 of the License, or |
3106 | -# (at your option) any later version. |
3107 | -# |
3108 | -# This program is distributed in the hope that it will be useful, |
3109 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3110 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3111 | -# GNU General Public License for more details. |
3112 | -# |
3113 | -# You should have received a copy of the GNU General Public License |
3114 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3115 | -# |
3116 | -############################################################################## |
3117 | -{ |
3118 | - 'name': 'ING (NL) Bank Statements Import', |
3119 | - 'version': '0.1.89', |
3120 | - 'license': 'GPL-3', |
3121 | - 'author': 'Smile / Therp BV / EduSense BV', |
3122 | - 'website': 'https://launchpad.net/banking-addons', |
3123 | - 'category': 'Banking addons', |
3124 | - 'depends': ['account_banking'], |
3125 | - 'init_xml': [], |
3126 | - 'update_xml': [ |
3127 | - ], |
3128 | - 'demo_xml': [], |
3129 | - 'description': ''' |
3130 | - |
3131 | -Module to import Dutch ING bank format transation files (CSV format). |
3132 | - |
3133 | -As the ING bank does not provide detailed specification concerning possible |
3134 | -values and their meaning for the fields in the CSV file format, the statements |
3135 | -are parsed according to an educated guess based on incomplete information. |
3136 | -You can contact the banking-addons developers through their launchpad page and |
3137 | -help improve the performance of this import filter on |
3138 | -https://launchpad.net/banking-addons. |
3139 | - |
3140 | -Note that imported bank transfers are organized in statements covering periods |
3141 | -of one week, even if the imported files cover a different period. |
3142 | - |
3143 | -This modules contains no logic, just an import filter for account_banking. |
3144 | - ''', |
3145 | - 'active': False, |
3146 | - 'installable': True, |
3147 | -} |
3148 | |
3149 | === modified file 'account_banking_nl_ing/ing.py' |
3150 | --- account_banking_nl_ing/ing.py 2012-10-04 08:56:19 +0000 |
3151 | +++ account_banking_nl_ing/ing.py 2013-05-06 14:07:28 +0000 |
3152 | @@ -1,4 +1,4 @@ |
3153 | -# -*- encoding: utf-8 -*- |
3154 | +# -*- coding: utf-8 -*- |
3155 | ############################################################################## |
3156 | # |
3157 | # Copyright (C) 2011 Smile (<http://smile.fr>). |
3158 | @@ -10,25 +10,25 @@ |
3159 | # All Rights Reserved |
3160 | # |
3161 | # This program is free software: you can redistribute it and/or modify |
3162 | -# it under the terms of the GNU General Public License as published by |
3163 | -# the Free Software Foundation, either version 3 of the License, or |
3164 | -# (at your option) any later version. |
3165 | +# it under the terms of the GNU Affero General Public License as |
3166 | +# published by the Free Software Foundation, either version 3 of the |
3167 | +# License, or (at your option) any later version. |
3168 | # |
3169 | # This program is distributed in the hope that it will be useful, |
3170 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3171 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3172 | -# GNU General Public License for more details. |
3173 | +# GNU Affero General Public License for more details. |
3174 | # |
3175 | -# You should have received a copy of the GNU General Public License |
3176 | +# You should have received a copy of the GNU Affero General Public License |
3177 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3178 | # |
3179 | ############################################################################## |
3180 | |
3181 | from datetime import datetime |
3182 | -from account_banking.parsers import models |
3183 | -from account_banking.parsers.convert import str2date |
3184 | -from account_banking.sepa import postalcode |
3185 | -from tools.translate import _ |
3186 | +from openerp.addons.account_banking.parsers import models |
3187 | +from openerp.addons.account_banking.parsers.convert import str2date |
3188 | +from openerp.addons.account_banking.sepa import postalcode |
3189 | +from openerp.tools.translate import _ |
3190 | |
3191 | import re |
3192 | import csv |
3193 | |
3194 | === modified file 'account_banking_nl_multibank/__init__.py' |
3195 | --- account_banking_nl_multibank/__init__.py 2010-01-26 20:55:24 +0000 |
3196 | +++ account_banking_nl_multibank/__init__.py 2013-05-06 14:07:28 +0000 |
3197 | @@ -11,16 +11,16 @@ |
3198 | # garantees and support are strongly adviced to contract EduSense BV |
3199 | # |
3200 | # This program is free software: you can redistribute it and/or modify |
3201 | -# it under the terms of the GNU General Public License as published by |
3202 | +# it under the terms of the GNU Affero General Public License as published by |
3203 | # the Free Software Foundation, either version 3 of the License, or |
3204 | # (at your option) any later version. |
3205 | # |
3206 | # This program is distributed in the hope that it will be useful, |
3207 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3208 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3209 | -# GNU General Public License for more details. |
3210 | +# GNU Affero General Public License for more details. |
3211 | # |
3212 | -# You should have received a copy of the GNU General Public License |
3213 | +# You should have received a copy of the GNU Affero General Public License |
3214 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3215 | # |
3216 | ############################################################################## |
3217 | |
3218 | === renamed file 'account_banking_nl_multibank/__terp__.py' => 'account_banking_nl_multibank/__openerp__.py' |
3219 | --- account_banking_nl_multibank/__terp__.py 2011-05-05 10:29:28 +0000 |
3220 | +++ account_banking_nl_multibank/__openerp__.py 2013-05-06 14:07:28 +0000 |
3221 | @@ -1,46 +1,36 @@ |
3222 | +# -*- coding: utf-8 -*- |
3223 | ############################################################################## |
3224 | # |
3225 | # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). |
3226 | # All Rights Reserved |
3227 | # |
3228 | -# WARNING: This program as such is intended to be used by professional |
3229 | -# programmers who take the whole responsability of assessing all potential |
3230 | -# consequences resulting from its eventual inadequacies and bugs |
3231 | -# End users who are looking for a ready-to-use solution with commercial |
3232 | -# garantees and support are strongly adviced to contract EduSense BV |
3233 | -# |
3234 | # This program is free software: you can redistribute it and/or modify |
3235 | -# it under the terms of the GNU General Public License as published by |
3236 | -# the Free Software Foundation, either version 3 of the License, or |
3237 | -# (at your option) any later version. |
3238 | +# it under the terms of the GNU Affero General Public License as |
3239 | +# published by the Free Software Foundation, either version 3 of the |
3240 | +# License, or (at your option) any later version. |
3241 | # |
3242 | # This program is distributed in the hope that it will be useful, |
3243 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3244 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3245 | -# GNU General Public License for more details. |
3246 | +# GNU Affero General Public License for more details. |
3247 | # |
3248 | -# You should have received a copy of the GNU General Public License |
3249 | +# You should have received a copy of the GNU Affero General Public License |
3250 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3251 | # |
3252 | ############################################################################## |
3253 | + |
3254 | { |
3255 | 'name': 'Account Banking', |
3256 | 'version': '0.62', |
3257 | - 'license': 'GPL-3', |
3258 | + 'license': 'AGPL-3', |
3259 | 'author': 'EduSense BV', |
3260 | 'website': 'http://www.edusense.nl', |
3261 | 'category': 'Account Banking', |
3262 | 'depends': ['account_banking'], |
3263 | - 'init_xml': [], |
3264 | - 'update_xml': [ |
3265 | - #'security/ir.model.access.csv', |
3266 | - ], |
3267 | - 'demo_xml': [], |
3268 | 'description': ''' |
3269 | Module to import Dutch Multibank format transation files. |
3270 | |
3271 | This modules contains no logic, just an import filter for account_banking. |
3272 | ''', |
3273 | - 'active': False, |
3274 | 'installable': True, |
3275 | } |
3276 | |
3277 | === modified file 'account_banking_nl_multibank/multibank.py' |
3278 | --- account_banking_nl_multibank/multibank.py 2012-01-17 08:48:10 +0000 |
3279 | +++ account_banking_nl_multibank/multibank.py 2013-05-06 14:07:28 +0000 |
3280 | @@ -5,16 +5,16 @@ |
3281 | # All Rights Reserved |
3282 | # |
3283 | # This program is free software: you can redistribute it and/or modify |
3284 | -# it under the terms of the GNU General Public License as published by |
3285 | +# it under the terms of the GNU Affero General Public License as published by |
3286 | # the Free Software Foundation, either version 3 of the License, or |
3287 | # (at your option) any later version. |
3288 | # |
3289 | # This program is distributed in the hope that it will be useful, |
3290 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3291 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3292 | -# GNU General Public License for more details. |
3293 | +# GNU Affero General Public License for more details. |
3294 | # |
3295 | -# You should have received a copy of the GNU General Public License |
3296 | +# You should have received a copy of the GNU Affero General Public License |
3297 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3298 | # |
3299 | ############################################################################## |
3300 | |
3301 | === modified file 'account_banking_nl_triodos/__init__.py' |
3302 | --- account_banking_nl_triodos/__init__.py 2011-04-26 21:00:12 +0000 |
3303 | +++ account_banking_nl_triodos/__init__.py 2013-05-06 14:07:28 +0000 |
3304 | @@ -13,16 +13,16 @@ |
3305 | # or Therp BV |
3306 | # |
3307 | # This program is free software: you can redistribute it and/or modify |
3308 | -# it under the terms of the GNU General Public License as published by |
3309 | +# it under the terms of the GNU Affero General Public License as published by |
3310 | # the Free Software Foundation, either version 3 of the License, or |
3311 | # (at your option) any later version. |
3312 | # |
3313 | # This program is distributed in the hope that it will be useful, |
3314 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3315 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3316 | -# GNU General Public License for more details. |
3317 | +# GNU Affero General Public License for more details. |
3318 | # |
3319 | -# You should have received a copy of the GNU General Public License |
3320 | +# You should have received a copy of the GNU Affero General Public License |
3321 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3322 | # |
3323 | ############################################################################## |
3324 | |
3325 | === modified file 'account_banking_nl_triodos/__openerp__.py' |
3326 | --- account_banking_nl_triodos/__openerp__.py 2013-02-26 21:06:36 +0000 |
3327 | +++ account_banking_nl_triodos/__openerp__.py 2013-05-06 14:07:28 +0000 |
3328 | @@ -4,40 +4,28 @@ |
3329 | # and Therp BV (<http://therp.nl>) |
3330 | # All Rights Reserved |
3331 | # |
3332 | -# WARNING: This program as such is intended to be used by professional |
3333 | -# programmers who take the whole responsability of assessing all potential |
3334 | -# consequences resulting from its eventual inadequacies and bugs |
3335 | -# End users who are looking for a ready-to-use solution with commercial |
3336 | -# garantees and support are strongly adviced to contract EduSense BV |
3337 | -# or Therp BV |
3338 | -# |
3339 | # This program is free software: you can redistribute it and/or modify |
3340 | -# it under the terms of the GNU General Public License as published by |
3341 | +# it under the terms of the GNU Affero General Public License as published by |
3342 | # the Free Software Foundation, either version 3 of the License, or |
3343 | # (at your option) any later version. |
3344 | # |
3345 | # This program is distributed in the hope that it will be useful, |
3346 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3347 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3348 | -# GNU General Public License for more details. |
3349 | +# GNU Affero General Public License for more details. |
3350 | # |
3351 | -# You should have received a copy of the GNU General Public License |
3352 | +# You should have received a copy of the GNU Affero General Public License |
3353 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3354 | # |
3355 | ############################################################################## |
3356 | { |
3357 | 'name': 'Triodos (NL) Bank Statements Import', |
3358 | 'version': '0.92', |
3359 | - 'license': 'GPL-3', |
3360 | - 'author': 'Therp BV / EduSense BV', |
3361 | + 'license': 'AGPL-3', |
3362 | + 'author': ['Therp BV', 'EduSense BV'], |
3363 | 'website': 'https://launchpad.net/account-banking', |
3364 | 'category': 'Account Banking', |
3365 | 'depends': ['account_banking'], |
3366 | - 'init_xml': [], |
3367 | - 'update_xml': [ |
3368 | - #'security/ir.model.access.csv', |
3369 | - ], |
3370 | - 'demo_xml': [], |
3371 | 'description': ''' |
3372 | Module to import Dutch Triodos bank format transation files (CSV format). |
3373 | |
3374 | @@ -53,6 +41,5 @@ |
3375 | |
3376 | This modules contains no logic, just an import filter for account_banking. |
3377 | ''', |
3378 | - 'active': False, |
3379 | - 'installable': False, |
3380 | + 'installable': True, |
3381 | } |
3382 | |
3383 | === removed file 'account_banking_nl_triodos/__terp__.py' |
3384 | --- account_banking_nl_triodos/__terp__.py 2011-05-05 10:29:28 +0000 |
3385 | +++ account_banking_nl_triodos/__terp__.py 1970-01-01 00:00:00 +0000 |
3386 | @@ -1,58 +0,0 @@ |
3387 | -############################################################################## |
3388 | -# |
3389 | -# Copyright (C) 2009 - 2011 EduSense BV (<http://www.edusense.nl>) |
3390 | -# and Therp BV (<http://therp.nl>) |
3391 | -# All Rights Reserved |
3392 | -# |
3393 | -# WARNING: This program as such is intended to be used by professional |
3394 | -# programmers who take the whole responsability of assessing all potential |
3395 | -# consequences resulting from its eventual inadequacies and bugs |
3396 | -# End users who are looking for a ready-to-use solution with commercial |
3397 | -# garantees and support are strongly adviced to contract EduSense BV |
3398 | -# or Therp BV |
3399 | -# |
3400 | -# This program is free software: you can redistribute it and/or modify |
3401 | -# it under the terms of the GNU General Public License as published by |
3402 | -# the Free Software Foundation, either version 3 of the License, or |
3403 | -# (at your option) any later version. |
3404 | -# |
3405 | -# This program is distributed in the hope that it will be useful, |
3406 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
3407 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3408 | -# GNU General Public License for more details. |
3409 | -# |
3410 | -# You should have received a copy of the GNU General Public License |
3411 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
3412 | -# |
3413 | -############################################################################## |
3414 | -{ |
3415 | - 'name': 'Triodos (NL) Bank Statements Import', |
3416 | - 'version': '0.62', |
3417 | - 'license': 'GPL-3', |
3418 | - 'author': 'Therp BV / EduSense BV', |
3419 | - 'website': 'https://launchpad.net/account-banking', |
3420 | - 'category': 'Account Banking', |
3421 | - 'depends': ['account_banking'], |
3422 | - 'init_xml': [], |
3423 | - 'update_xml': [ |
3424 | - #'security/ir.model.access.csv', |
3425 | - ], |
3426 | - 'demo_xml': [], |
3427 | - 'description': ''' |
3428 | -Module to import Dutch Triodos bank format transation files (CSV format). |
3429 | - |
3430 | -As the Triodos bank does not provide detailed specification concerning possible |
3431 | -values and their meaning for the fields in the CSV file format, the statements |
3432 | -are parsed according to an educated guess based on incomplete information. |
3433 | -You can contact the account-banking developers through their launchpad page and |
3434 | -help improve the performance of this import filter on |
3435 | -https://launchpad.net/account-banking. |
3436 | - |
3437 | -Note that imported bank transfers are organized in statements covering periods |
3438 | -of one week, even if the imported files cover a different period. |
3439 | - |
3440 | -This modules contains no logic, just an import filter for account_banking. |
3441 | - ''', |
3442 | - 'active': False, |
3443 | - 'installable': True, |
3444 | -} |
3445 | |
3446 | === modified file 'account_banking_nl_triodos/triodos.py' |
3447 | --- account_banking_nl_triodos/triodos.py 2012-01-17 08:48:10 +0000 |
3448 | +++ account_banking_nl_triodos/triodos.py 2013-05-06 14:07:28 +0000 |
3449 | @@ -6,16 +6,16 @@ |
3450 | # All Rights Reserved |
3451 | # |
3452 | # This program is free software: you can redistribute it and/or modify |
3453 | -# it under the terms of the GNU General Public License as published by |
3454 | +# it under the terms of the GNU Affero General Public License as published by |
3455 | # the Free Software Foundation, either version 3 of the License, or |
3456 | # (at your option) any later version. |
3457 | # |
3458 | # This program is distributed in the hope that it will be useful, |
3459 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3460 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3461 | -# GNU General Public License for more details. |
3462 | +# GNU Affero General Public License for more details. |
3463 | # |
3464 | -# You should have received a copy of the GNU General Public License |
3465 | +# You should have received a copy of the GNU Affero General Public License |
3466 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3467 | # |
3468 | ############################################################################## |
3469 | |
3470 | === modified file 'account_banking_uk_hsbc/__openerp__.py' |
3471 | --- account_banking_uk_hsbc/__openerp__.py 2013-02-26 21:06:36 +0000 |
3472 | +++ account_banking_uk_hsbc/__openerp__.py 2013-05-06 14:07:28 +0000 |
3473 | @@ -26,15 +26,13 @@ |
3474 | 'website': 'http://www.credativ.co.uk', |
3475 | 'category': 'Account Banking', |
3476 | 'depends': ['account_banking'], |
3477 | - 'init_xml': [], |
3478 | - 'update_xml': [ |
3479 | + 'data': [ |
3480 | 'account_banking_uk_hsbc.xml', |
3481 | 'hsbc_clientid_view.xml', |
3482 | 'data/banking_export_hsbc.xml', |
3483 | 'wizard/export_hsbc_view.xml', |
3484 | 'security/ir.model.access.csv', |
3485 | ], |
3486 | - 'demo_xml': [], |
3487 | 'description': ''' |
3488 | Module to import HSBC format transation files (S.W.I.F.T MT940) and to export payments for HSBC.net (PAYMUL). |
3489 | |
3490 | @@ -47,6 +45,5 @@ |
3491 | |
3492 | Initial release of this module was co-sponsored by Canonical. |
3493 | ''', |
3494 | - 'active': False, |
3495 | - 'installable': False, |
3496 | + 'installable': True, |
3497 | } |
3498 | |
3499 | === modified file 'account_banking_uk_hsbc/account_banking_uk_hsbc.py' |
3500 | --- account_banking_uk_hsbc/account_banking_uk_hsbc.py 2012-03-27 14:55:03 +0000 |
3501 | +++ account_banking_uk_hsbc/account_banking_uk_hsbc.py 2013-05-06 14:07:28 +0000 |
3502 | @@ -5,16 +5,16 @@ |
3503 | # All Rights Reserved |
3504 | # |
3505 | # This program is free software: you can redistribute it and/or modify |
3506 | -# it under the terms of the GNU General Public License as published by |
3507 | +# it under the terms of the GNU Affero General Public License as published by |
3508 | # the Free Software Foundation, either version 3 of the License, or |
3509 | # (at your option) any later version. |
3510 | # |
3511 | # This program is distributed in the hope that it will be useful, |
3512 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3513 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3514 | -# GNU General Public License for more details. |
3515 | +# GNU Affero General Public License for more details. |
3516 | # |
3517 | -# You should have received a copy of the GNU General Public License |
3518 | +# You should have received a copy of the GNU Affero General Public License |
3519 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3520 | # |
3521 | ############################################################################## |
3522 | |
3523 | === modified file 'account_banking_uk_hsbc/wizard/__init__.py' |
3524 | --- account_banking_uk_hsbc/wizard/__init__.py 2011-10-24 15:26:13 +0000 |
3525 | +++ account_banking_uk_hsbc/wizard/__init__.py 2013-05-06 14:07:28 +0000 |
3526 | @@ -6,16 +6,16 @@ |
3527 | # All Rights Reserved |
3528 | # |
3529 | # This program is free software: you can redistribute it and/or modify |
3530 | -# it under the terms of the GNU General Public License as published by |
3531 | +# it under the terms of the GNU Affero General Public License as published by |
3532 | # the Free Software Foundation, either version 3 of the License, or |
3533 | # (at your option) any later version. |
3534 | # |
3535 | # This program is distributed in the hope that it will be useful, |
3536 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3537 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3538 | -# GNU General Public License for more details. |
3539 | +# GNU Affero General Public License for more details. |
3540 | # |
3541 | -# You should have received a copy of the GNU General Public License |
3542 | +# You should have received a copy of the GNU Affero General Public License |
3543 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3544 | # |
3545 | ############################################################################## |
3546 | |
3547 | === modified file 'account_banking_uk_hsbc/wizard/export_hsbc.py' |
3548 | --- account_banking_uk_hsbc/wizard/export_hsbc.py 2012-03-22 12:07:57 +0000 |
3549 | +++ account_banking_uk_hsbc/wizard/export_hsbc.py 2013-05-06 14:07:28 +0000 |
3550 | @@ -6,16 +6,16 @@ |
3551 | # All Rights Reserved |
3552 | # |
3553 | # This program is free software: you can redistribute it and/or modify |
3554 | -# it under the terms of the GNU General Public License as published by |
3555 | +# it under the terms of the GNU Affero General Public License as published by |
3556 | # the Free Software Foundation, either version 3 of the License, or |
3557 | # (at your option) any later version. |
3558 | # |
3559 | # This program is distributed in the hope that it will be useful, |
3560 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3561 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3562 | -# GNU General Public License for more details. |
3563 | +# GNU Affero General Public License for more details. |
3564 | # |
3565 | -# You should have received a copy of the GNU General Public License |
3566 | +# You should have received a copy of the GNU Affero General Public License |
3567 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3568 | # |
3569 | ############################################################################## |
3570 | |
3571 | === modified file 'account_banking_uk_hsbc/wizard/paymul.py' |
3572 | --- account_banking_uk_hsbc/wizard/paymul.py 2012-03-22 12:07:57 +0000 |
3573 | +++ account_banking_uk_hsbc/wizard/paymul.py 2013-05-06 14:07:28 +0000 |
3574 | @@ -5,16 +5,16 @@ |
3575 | # All Rights Reserved |
3576 | # |
3577 | # This program is free software: you can redistribute it and/or modify |
3578 | -# it under the terms of the GNU General Public License as published by |
3579 | +# it under the terms of the GNU Affero General Public License as published by |
3580 | # the Free Software Foundation, either version 3 of the License, or |
3581 | # (at your option) any later version. |
3582 | # |
3583 | # This program is distributed in the hope that it will be useful, |
3584 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3585 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3586 | -# GNU General Public License for more details. |
3587 | +# GNU Affero General Public License for more details. |
3588 | # |
3589 | -# You should have received a copy of the GNU General Public License |
3590 | +# You should have received a copy of the GNU Affero General Public License |
3591 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3592 | # |
3593 | ############################################################################## |
3594 | |
3595 | === modified file 'account_banking_uk_hsbc/wizard/paymul_test.py' |
3596 | --- account_banking_uk_hsbc/wizard/paymul_test.py 2011-10-24 15:26:13 +0000 |
3597 | +++ account_banking_uk_hsbc/wizard/paymul_test.py 2013-05-06 14:07:28 +0000 |
3598 | @@ -5,16 +5,16 @@ |
3599 | # All Rights Reserved |
3600 | # |
3601 | # This program is free software: you can redistribute it and/or modify |
3602 | -# it under the terms of the GNU General Public License as published by |
3603 | +# it under the terms of the GNU Affero General Public License as published by |
3604 | # the Free Software Foundation, either version 3 of the License, or |
3605 | # (at your option) any later version. |
3606 | # |
3607 | # This program is distributed in the hope that it will be useful, |
3608 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3609 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3610 | -# GNU General Public License for more details. |
3611 | +# GNU Affero General Public License for more details. |
3612 | # |
3613 | -# You should have received a copy of the GNU General Public License |
3614 | +# You should have received a copy of the GNU Affero General Public License |
3615 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3616 | # |
3617 | ############################################################################## |
3618 | |
3619 | === modified file 'account_direct_debit/__openerp__.py' |
3620 | --- account_direct_debit/__openerp__.py 2013-02-26 21:06:36 +0000 |
3621 | +++ account_direct_debit/__openerp__.py 2013-05-06 14:07:28 +0000 |
3622 | @@ -4,43 +4,35 @@ |
3623 | # Copyright (C) 2011 Smile (<http://smile.fr>). |
3624 | # All Rights Reserved |
3625 | # |
3626 | -# WARNING: This program as such is intended to be used by professional |
3627 | -# programmers who take the whole responsability of assessing all potential |
3628 | -# consequences resulting from its eventual inadequacies and bugs |
3629 | -# End users who are looking for a ready-to-use solution with commercial |
3630 | -# garantees and support are strongly adviced to contract EduSense BV |
3631 | -# |
3632 | # This program is free software: you can redistribute it and/or modify |
3633 | -# it under the terms of the GNU General Public License as published by |
3634 | +# it under the terms of the GNU Affero General Public License as published by |
3635 | # the Free Software Foundation, either version 3 of the License, or |
3636 | # (at your option) any later version. |
3637 | # |
3638 | # This program is distributed in the hope that it will be useful, |
3639 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3640 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3641 | -# GNU General Public License for more details. |
3642 | +# GNU Affero General Public License for more details. |
3643 | # |
3644 | -# You should have received a copy of the GNU General Public License |
3645 | +# You should have received a copy of the GNU Affero General Public License |
3646 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3647 | # |
3648 | ############################################################################## |
3649 | { |
3650 | 'name': 'Direct Debit', |
3651 | 'version': '6.1.1.134', |
3652 | - 'license': 'GPL-3', |
3653 | + 'license': 'AGPL-3', |
3654 | 'author': 'Therp BV / Smile', |
3655 | 'website': 'https://launchpad.net/banking-addons', |
3656 | 'category': 'Banking addons', |
3657 | 'depends': ['account_banking'], |
3658 | - 'init_xml': [], |
3659 | - 'update_xml': [ |
3660 | + 'data': [ |
3661 | 'view/account_payment.xml', |
3662 | 'view/account_invoice.xml', |
3663 | 'workflow/account_invoice.xml', |
3664 | 'workflow/account_payment.xml', |
3665 | 'data/account_payment_term.xml', |
3666 | ], |
3667 | - 'demo_xml': [], |
3668 | 'description': ''' |
3669 | This module adds support for direct debit orders, analogous to payment orders. |
3670 | A new entry in the Accounting/Payment menu allow you to create a direct debit |
3671 | @@ -57,6 +49,5 @@ |
3672 | banking institutions. The banking addons are a continuation of Account Banking |
3673 | Framework by Edusense BV. See https://launchpad.net/banking-addons. |
3674 | ''', |
3675 | - 'active': False, |
3676 | 'installable': False, |
3677 | } |
3678 | |
3679 | === modified file 'account_payment_shortcut/__openerp__.py' |
3680 | --- account_payment_shortcut/__openerp__.py 2013-02-26 21:06:36 +0000 |
3681 | +++ account_payment_shortcut/__openerp__.py 2013-05-06 14:07:28 +0000 |
3682 | @@ -4,41 +4,30 @@ |
3683 | # 2011 Smile BV (<http://smile.fr>). |
3684 | # All Rights Reserved |
3685 | # |
3686 | -# WARNING: This program as such is intended to be used by professional |
3687 | -# programmers who take the whole responsability of assessing all potential |
3688 | -# consequences resulting from its eventual inadequacies and bugs |
3689 | -# End users who are looking for a ready-to-use solution with commercial |
3690 | -# garantees and support are strongly adviced to contract EduSense BV |
3691 | -# |
3692 | # This program is free software: you can redistribute it and/or modify |
3693 | -# it under the terms of the GNU General Public License as published by |
3694 | +# it under the terms of the GNU Affero General Public License as published by |
3695 | # the Free Software Foundation, either version 3 of the License, or |
3696 | # (at your option) any later version. |
3697 | # |
3698 | # This program is distributed in the hope that it will be useful, |
3699 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
3700 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3701 | -# GNU General Public License for more details. |
3702 | +# GNU Affero General Public License for more details. |
3703 | # |
3704 | -# You should have received a copy of the GNU General Public License |
3705 | +# You should have received a copy of the GNU Affero General Public License |
3706 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
3707 | # |
3708 | ############################################################################## |
3709 | { |
3710 | 'name': 'Account Payment Invoice Selection Shortcut', |
3711 | 'version': '6.1.1.134', |
3712 | - 'license': 'GPL-3', |
3713 | + 'license': 'AGPL-3', |
3714 | 'author': 'Smile / Therp BV', |
3715 | 'website': 'https://launchpad.net/banking-addons', |
3716 | 'category': 'Banking addons', |
3717 | 'depends': ['account_payment'], |
3718 | - 'init_xml': [], |
3719 | - 'update_xml': [ |
3720 | - ], |
3721 | - 'demo_xml': [], |
3722 | 'description': ''' |
3723 | When composing a payment order, select all candidates by default (in the second step of the "Select invoices to pay" wizard). |
3724 | ''', |
3725 | - 'active': False, |
3726 | 'installable': False, |
3727 | } |
I'm really not fond of "import *" in production code, especially if, as in here, there several such imports in the same module.
I suggest:
* either importing explicitely the symbols you are using
* of importing just the module (maybe with the "as" keyword to perform an on the fly aliasing) and using a qualified access
Question: what do the "AB" comments stand for?