Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_bank_statement_auto_reconcile_mdh into lp:banking-addons/bank-statement-reconcile-70

Proposed by Matthieu Dietrich @ camptocamp
Status: Rejected
Rejected by: Nicolas Bessi - Camptocamp
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_bank_statement_auto_reconcile_mdh
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 532 lines (+459/-2)
10 files modified
account_advanced_reconcile_bank_statement/__init__.py (+22/-0)
account_advanced_reconcile_bank_statement/__openerp__.py (+45/-0)
account_advanced_reconcile_bank_statement/advanced_reconciliation.py (+82/-0)
account_advanced_reconcile_bank_statement/easy_reconcile.py (+37/-0)
account_advanced_reconcile_bank_statement/easy_reconcile_view.xml (+19/-0)
account_advanced_reconcile_bank_statement/i18n/account_advanced_reconcile_bank_statement.po (+107/-0)
account_advanced_reconcile_bank_statement/i18n/fr.po (+103/-0)
account_easy_reconcile/easy_reconcile.py (+25/-1)
account_easy_reconcile/easy_reconcile.xml (+18/-0)
account_easy_reconcile/easy_reconcile_history.py (+1/-1)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_bank_statement_auto_reconcile_mdh
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp Needs Fixing
Joël Grand-Guillaume @ camptocamp Pending
Review via email: mp+221093@code.launchpad.net

Commit message

[ADD] new reconciliation rule using bank statements

Description of the change

A new rule for automatic reconciliation: this allows for credit lines to use another bank statement as reference, and do a reconciliation with all its lines (debit AND credit, as the commission line can be created in that statement as well).

The main goal is to allow to create "bank lines" for when the payment for credit cards arrives, and reconcile it with a previous bank statement import of those cards.

To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

copyrights:

Missing date

And author mismatch

review: Needs Fixing
157. By Matthieu Dietrich @ camptocamp

[FIX] updated copyrights

158. By Matthieu Dietrich @ camptocamp

[FIX] optimize new rule

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/bank-statement-reconcile. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

159. By Nicolas Bessi - Camptocamp

[MRG] [ADD] a cron to run reconciles.
  By default it runs one reconcile after the other to be more atomic
  and memory friendly. But you can set run_all agrument to have all reconcile
  run at once

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Unmerged revisions

159. By Nicolas Bessi - Camptocamp

[MRG] [ADD] a cron to run reconciles.
  By default it runs one reconcile after the other to be more atomic
  and memory friendly. But you can set run_all agrument to have all reconcile
  run at once

158. By Matthieu Dietrich @ camptocamp

[FIX] optimize new rule

157. By Matthieu Dietrich @ camptocamp

[FIX] updated copyrights

156. By Matthieu Dietrich @ camptocamp

[ADD] new reconciliation rule using bank statements

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_advanced_reconcile_bank_statement'
2=== added file 'account_advanced_reconcile_bank_statement/__init__.py'
3--- account_advanced_reconcile_bank_statement/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_advanced_reconcile_bank_statement/__init__.py 2014-07-08 09:51:55 +0000
5@@ -0,0 +1,22 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Author: Romain Deheele. Copyright Camptocamp SA
10+#
11+# This program is free software: you can redistribute it and/or modify
12+# it under the terms of the GNU Affero General Public License as
13+# published by the Free Software Foundation, either version 3 of the
14+# License, or (at your option) any later version.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU Affero General Public License for more details.
20+#
21+# You should have received a copy of the GNU Affero General Public License
22+# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+#
24+##############################################################################
25+
26+from . import easy_reconcile
27+from . import advanced_reconciliation
28
29=== added file 'account_advanced_reconcile_bank_statement/__openerp__.py'
30--- account_advanced_reconcile_bank_statement/__openerp__.py 1970-01-01 00:00:00 +0000
31+++ account_advanced_reconcile_bank_statement/__openerp__.py 2014-07-08 09:51:55 +0000
32@@ -0,0 +1,45 @@
33+# -*- coding: utf-8 -*-
34+##############################################################################
35+#
36+# Author: Matthieu Dietrich
37+# Copyright 2014 Camptocamp SA
38+#
39+# This program is free software: you can redistribute it and/or modify
40+# it under the terms of the GNU Affero General Public License as
41+# published by the Free Software Foundation, either version 3 of the
42+# License, or (at your option) any later version.
43+#
44+# This program is distributed in the hope that it will be useful,
45+# but WITHOUT ANY WARRANTY; without even the implied warranty of
46+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47+# GNU Affero General Public License for more details.
48+#
49+# You should have received a copy of the GNU Affero General Public License
50+# along with this program. If not, see <http://www.gnu.org/licenses/>.
51+#
52+##############################################################################
53+
54+{'name': 'Advanced Reconcile Bank Statement',
55+ 'description': """
56+Advanced reconciliation method for the module account_advanced_reconcile
57+========================================================================
58+Reconcile rules with bank statement name.
59+
60+This will reconcile multiple credit move lines (bank statements) with
61+all the lines from a specific bank statement, debit or credit (to also
62+reconcile the commission with credit card imports).
63+
64+""",
65+ 'version': '1.0.0',
66+ 'author': 'Camptocamp',
67+ 'category': 'Finance',
68+ 'website': 'http://www.camptocamp.com',
69+ 'depends': ['account_advanced_reconcile'],
70+ 'data': ['easy_reconcile_view.xml'],
71+ 'demo': [],
72+ 'test': [], # To be ported or migrate to unit tests or scenarios
73+ 'auto_install': False,
74+ 'installable': True,
75+ 'images': []
76+}
77+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
78
79=== added file 'account_advanced_reconcile_bank_statement/advanced_reconciliation.py'
80--- account_advanced_reconcile_bank_statement/advanced_reconciliation.py 1970-01-01 00:00:00 +0000
81+++ account_advanced_reconcile_bank_statement/advanced_reconciliation.py 2014-07-08 09:51:55 +0000
82@@ -0,0 +1,82 @@
83+# -*- coding: utf-8 -*-
84+##############################################################################
85+#
86+# Author: Matthieu Dietrich. Copyright Camptocamp SA
87+#
88+# This program is free software: you can redistribute it and/or modify
89+# it under the terms of the GNU Affero General Public License as
90+# published by the Free Software Foundation, either version 3 of the
91+# License, or (at your option) any later version.
92+#
93+# This program is distributed in the hope that it will be useful,
94+# but WITHOUT ANY WARRANTY; without even the implied warranty of
95+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+# GNU Affero General Public License for more details.
97+#
98+# You should have received a copy of the GNU Affero General Public License
99+# along with this program. If not, see <http://www.gnu.org/licenses/>.
100+#
101+##############################################################################
102+
103+from openerp.osv import orm
104+
105+
106+class easy_reconcile_advanced_bank_statement(orm.TransientModel):
107+
108+ _name = 'easy.reconcile.advanced.bank_statement'
109+ _inherit = 'easy.reconcile.advanced'
110+
111+ def _base_columns(self, rec):
112+ """ Mandatory columns for move lines queries
113+ An extra column aliased as ``key`` should be defined
114+ in each query."""
115+ aml_cols = (
116+ 'id',
117+ 'debit',
118+ 'credit',
119+ 'date',
120+ 'period_id',
121+ 'ref',
122+ 'name',
123+ 'partner_id',
124+ 'account_id',
125+ 'move_id',
126+ 'statement_id')
127+ result = ["account_move_line.%s" % col for col in aml_cols]
128+ result += ["account_bank_statement.name as statement_name"]
129+ return result
130+
131+ def _from(self, rec, *args, **kwargs):
132+ # Overriden to use a inner join
133+ return """FROM account_move_line
134+ INNER JOIN account_bank_statement
135+ ON account_bank_statement.id =
136+ account_move_line.statement_id"""
137+
138+ def _skip_line(self, cr, uid, rec, move_line, context=None):
139+ """
140+ When True is returned on some conditions, the credit move line
141+ will be skipped for reconciliation. Can be inherited to
142+ skip on some conditions. ie: ref or partner_id is empty.
143+ """
144+ return not (move_line.get('ref') and
145+ move_line.get('partner_id'))
146+
147+ def _matchers(self, cr, uid, rec, move_line, context=None):
148+ return (('partner_id', move_line['partner_id']),
149+ ('ref', move_line['ref'].lower().strip()))
150+
151+ def _opposite_matchers(self, cr, uid, rec, move_line, context=None):
152+ yield ('partner_id', move_line['partner_id'])
153+ yield ('ref',
154+ (move_line['statement_name'] or '').lower().strip())
155+
156+ # Re-defined for this particular rule; since the commission line is a
157+ # credit line inside of the target statement, it should also be considered
158+ # as an opposite to be reconciled.
159+ def _action_rec(self, cr, uid, rec, context=None):
160+ credit_lines = self._query_credit(cr, uid, rec, context=context)
161+ debit_lines = self._query_debit(cr, uid, rec, context=context)
162+ return self._rec_auto_lines_advanced(
163+ cr, uid, rec, credit_lines, credit_lines + debit_lines,
164+ context=context)
165
166=== added file 'account_advanced_reconcile_bank_statement/easy_reconcile.py'
167--- account_advanced_reconcile_bank_statement/easy_reconcile.py 1970-01-01 00:00:00 +0000
168+++ account_advanced_reconcile_bank_statement/easy_reconcile.py 2014-07-08 09:51:55 +0000
169@@ -0,0 +1,37 @@
170+# -*- coding: utf-8 -*-
171+##############################################################################
172+#
173+# Author: Matthieu Dietrich
174+# Copyright 2014 Camptocamp SA
175+#
176+# This program is free software: you can redistribute it and/or modify
177+# it under the terms of the GNU Affero General Public License as
178+# published by the Free Software Foundation, either version 3 of the
179+# License, or (at your option) any later version.
180+#
181+# This program is distributed in the hope that it will be useful,
182+# but WITHOUT ANY WARRANTY; without even the implied warranty of
183+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
184+# GNU Affero General Public License for more details.
185+#
186+# You should have received a copy of the GNU Affero General Public License
187+# along with this program. If not, see <http://www.gnu.org/licenses/>.
188+#
189+##############################################################################
190+
191+from openerp.osv import orm
192+
193+
194+class account_easy_reconcile_method(orm.Model):
195+
196+ _inherit = 'account.easy.reconcile.method'
197+
198+ def _get_all_rec_method(self, cr, uid, context=None):
199+ methods = super(account_easy_reconcile_method, self).\
200+ _get_all_rec_method(cr, uid, context=context)
201+ methods += [
202+ ('easy.reconcile.advanced.bank_statement',
203+ 'Advanced. Partner and Bank Statement'),
204+ ]
205+ return methods
206+
207
208=== added file 'account_advanced_reconcile_bank_statement/easy_reconcile_view.xml'
209--- account_advanced_reconcile_bank_statement/easy_reconcile_view.xml 1970-01-01 00:00:00 +0000
210+++ account_advanced_reconcile_bank_statement/easy_reconcile_view.xml 2014-07-08 09:51:55 +0000
211@@ -0,0 +1,19 @@
212+<?xml version="1.0" encoding="utf-8"?>
213+<openerp>
214+ <data noupdate="0">
215+ <record id="view_easy_reconcile_form" model="ir.ui.view">
216+ <field name="name">account.easy.reconcile.form</field>
217+ <field name="model">account.easy.reconcile</field>
218+ <field name="inherit_id" ref="account_easy_reconcile.account_easy_reconcile_form"/>
219+ <field name="arch" type="xml">
220+ <page name="information" position="inside">
221+ <group colspan="2" col="2">
222+ <separator colspan="4" string="Advanced. Partner and Bank Statement"/>
223+ <label string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
224+The lines should have the partner, the credit entry reference is matched vs the debit entry bank statement name." colspan="4"/>
225+ </group>
226+ </page>
227+ </field>
228+ </record>
229+ </data>
230+</openerp>
231
232=== added directory 'account_advanced_reconcile_bank_statement/i18n'
233=== added file 'account_advanced_reconcile_bank_statement/i18n/account_advanced_reconcile_bank_statement.po'
234--- account_advanced_reconcile_bank_statement/i18n/account_advanced_reconcile_bank_statement.po 1970-01-01 00:00:00 +0000
235+++ account_advanced_reconcile_bank_statement/i18n/account_advanced_reconcile_bank_statement.po 2014-07-08 09:51:55 +0000
236@@ -0,0 +1,107 @@
237+# Translation of OpenERP Server.
238+# This file contains the translation of the following modules:
239+# * account_advanced_reconcile_bank_statement
240+#
241+msgid ""
242+msgstr ""
243+"Project-Id-Version: OpenERP Server 7.0\n"
244+"Report-Msgid-Bugs-To: \n"
245+"POT-Creation-Date: 2014-05-27 08:36+0000\n"
246+"PO-Revision-Date: 2014-05-27 08:36+0000\n"
247+"Last-Translator: <>\n"
248+"Language-Team: \n"
249+"MIME-Version: 1.0\n"
250+"Content-Type: text/plain; charset=UTF-8\n"
251+"Content-Transfer-Encoding: \n"
252+"Plural-Forms: \n"
253+
254+#. module: account_advanced_reconcile_bank_statement
255+#: field:easy.reconcile.advanced.bank_statement,filter:0
256+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_filter
257+msgid "Filter"
258+msgstr ""
259+
260+#. module: account_advanced_reconcile_bank_statement
261+#: field:easy.reconcile.advanced.bank_statement,account_id:0
262+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_id
263+msgid "Account"
264+msgstr ""
265+
266+#. module: account_advanced_reconcile_bank_statement
267+#: field:easy.reconcile.advanced.bank_statement,partner_ids:0
268+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_partner_ids
269+msgid "Restrict on partners"
270+msgstr ""
271+
272+#. module: account_advanced_reconcile_bank_statement
273+#: code:_description:0
274+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_easy_reconcile_advanced_bank_statement
275+#, python-format
276+msgid "easy.reconcile.advanced.bank_statement"
277+msgstr ""
278+
279+#. module: account_advanced_reconcile_bank_statement
280+#: view:account.easy.reconcile:0
281+msgid "Match multiple debit vs multiple credit entries. Allow partial reconciliation. The lines should have the partner, the credit entry reference is matched vs the debit entry bank statement name."
282+msgstr ""
283+
284+#. module: account_advanced_reconcile_bank_statement
285+#: field:easy.reconcile.advanced.bank_statement,journal_id:0
286+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_journal_id
287+msgid "Journal"
288+msgstr ""
289+
290+#. module: account_advanced_reconcile_bank_statement
291+#: field:easy.reconcile.advanced.bank_statement,account_profit_id:0
292+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_profit_id
293+msgid "Account Profit"
294+msgstr ""
295+
296+#. module: account_advanced_reconcile_bank_statement
297+#: field:easy.reconcile.advanced.bank_statement,analytic_account_id:0
298+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_analytic_account_id
299+msgid "Analytic Account"
300+msgstr ""
301+
302+#. module: account_advanced_reconcile_bank_statement
303+#: code:_description:0
304+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_account_easy_reconcile_method
305+#, python-format
306+msgid "reconcile method for account_easy_reconcile"
307+msgstr ""
308+
309+#. module: account_advanced_reconcile_bank_statement
310+#: field:easy.reconcile.advanced.bank_statement,date_base_on:0
311+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_date_base_on
312+msgid "Date of reconciliation"
313+msgstr ""
314+
315+#. module: account_advanced_reconcile_bank_statement
316+#: help:easy.reconcile.advanced.bank_statement,analytic_account_id:0
317+msgid "Analytic account for the write-off"
318+msgstr ""
319+
320+#. module: account_advanced_reconcile_bank_statement
321+#: view:account.easy.reconcile:0
322+msgid "Advanced. Partner and Bank Statement"
323+msgstr ""
324+
325+#. module: account_advanced_reconcile_bank_statement
326+#: code:_description:0
327+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_easy_reconcile_advanced
328+#, python-format
329+msgid "easy.reconcile.advanced"
330+msgstr ""
331+
332+#. module: account_advanced_reconcile_bank_statement
333+#: field:easy.reconcile.advanced.bank_statement,account_lost_id:0
334+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_lost_id
335+msgid "Account Lost"
336+msgstr ""
337+
338+#. module: account_advanced_reconcile_bank_statement
339+#: field:easy.reconcile.advanced.bank_statement,write_off:0
340+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_write_off
341+msgid "Write off allowed"
342+msgstr ""
343+
344
345=== added file 'account_advanced_reconcile_bank_statement/i18n/fr.po'
346--- account_advanced_reconcile_bank_statement/i18n/fr.po 1970-01-01 00:00:00 +0000
347+++ account_advanced_reconcile_bank_statement/i18n/fr.po 2014-07-08 09:51:55 +0000
348@@ -0,0 +1,103 @@
349+# Translation of OpenERP Server.
350+# This file contains the translation of the following modules:
351+# * account_advanced_reconcile_bank_statement
352+#
353+msgid ""
354+msgstr ""
355+"Project-Id-Version: OpenERP Server 7.0\n"
356+"Report-Msgid-Bugs-To: \n"
357+"POT-Creation-Date: 2014-05-27 08:36+0000\n"
358+"PO-Revision-Date: 2014-05-27 08:36+0000\n"
359+"Last-Translator: <>\n"
360+"Language-Team: \n"
361+"MIME-Version: 1.0\n"
362+"Content-Type: text/plain; charset=UTF-8\n"
363+"Content-Transfer-Encoding: \n"
364+"Plural-Forms: \n"
365+
366+#. module: account_advanced_reconcile_bank_statement
367+#: field:easy.reconcile.advanced.bank_statement,filter:0
368+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_filter
369+msgid "Filter"
370+msgstr "Filtre"
371+
372+#. module: account_advanced_reconcile_bank_statement
373+#: field:easy.reconcile.advanced.bank_statement,account_id:0
374+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_id
375+msgid "Account"
376+msgstr "Compte"
377+
378+#. module: account_advanced_reconcile_bank_statement
379+#: field:easy.reconcile.advanced.bank_statement,partner_ids:0
380+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_partner_ids
381+msgid "Restrict on partners"
382+msgstr "Restriction sur les partenaires"
383+
384+#. module: account_advanced_reconcile_bank_statement
385+#: code:_description:0
386+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_easy_reconcile_advanced_bank_statement
387+#, python-format
388+msgid "easy.reconcile.advanced.bank_statement"
389+msgstr "easy.reconcile.advanced.bank_statement"
390+
391+#. module: account_advanced_reconcile_bank_statement
392+#: view:account.easy.reconcile:0
393+msgid ""
394+"Match multiple debit vs multiple credit entries. Allow partial "
395+"reconciliation. The lines should have the partner, the credit entry "
396+"reference is matched vs the debit entry bank statement name."
397+msgstr ""
398+"Le lettrage peut s'effectuer sur plusieurs écritures de débit et crédit. Le "
399+"lettrage partiel est autorisé. Les écritures doivent avoir le même "
400+"partenaire et la référence sur les écritures de crédit doit se retrouver
401+"dans le nom du relevé bancaire des écritures de débit."
402+
403+#. module: account_advanced_reconcile_bank_statement
404+#: field:easy.reconcile.advanced.bank_statement,journal_id:0
405+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_journal_id
406+msgid "Journal"
407+msgstr "Journal"
408+
409+#. module: account_advanced_reconcile_bank_statement
410+#: field:easy.reconcile.advanced.bank_statement,account_profit_id:0
411+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_profit_id
412+msgid "Account Profit"
413+msgstr "Compte de produit"
414+
415+#. module: account_advanced_reconcile_bank_statement
416+#: code:_description:0
417+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_account_easy_reconcile_method
418+#, python-format
419+msgid "reconcile method for account_easy_reconcile"
420+msgstr "Méthode de lettrage pour le module account_easy_reconcile"
421+
422+#. module: account_advanced_reconcile_bank_statement
423+#: field:easy.reconcile.advanced.bank_statement,date_base_on:0
424+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_date_base_on
425+msgid "Date of reconciliation"
426+msgstr "Date de lettrage"
427+
428+#. module: account_advanced_reconcile_bank_statement
429+#: view:account.easy.reconcile:0
430+msgid "Advanced. Partner and Bank Statement"
431+msgstr "Avancé. Partenaire et Relevé Bancaire"
432+
433+#. module: account_advanced_reconcile_bank_statement
434+#: code:_description:0
435+#: model:ir.model,name:account_advanced_reconcile_bank_statement.model_easy_reconcile_advanced
436+#, python-format
437+msgid "easy.reconcile.advanced"
438+msgstr "easy.reconcile.advanced"
439+
440+#. module: account_advanced_reconcile_bank_statement
441+#: field:easy.reconcile.advanced.bank_statement,account_lost_id:0
442+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_account_lost_id
443+msgid "Account Lost"
444+msgstr "Compte de charge"
445+
446+#. module: account_advanced_reconcile_bank_statement
447+#: field:easy.reconcile.advanced.bank_statement,write_off:0
448+#: model:ir.model.fields,field_description:account_advanced_reconcile_bank_statement.field_easy_reconcile_advanced_bank_statement_write_off
449+msgid "Write off allowed"
450+msgstr "Ecart autorisé"
451+
452
453=== modified file 'account_easy_reconcile/easy_reconcile.py'
454--- account_easy_reconcile/easy_reconcile.py 2014-03-14 10:48:30 +0000
455+++ account_easy_reconcile/easy_reconcile.py 2014-07-08 09:51:55 +0000
456@@ -258,7 +258,7 @@
457 _('Error'),
458 _('There is no history of reconciled '
459 'items on the task: %s.') % rec.name)
460-
461+
462 def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None):
463 return {
464 'name': name,
465@@ -336,3 +336,27 @@
466 if not rec.last_history:
467 self._no_history(cr, uid, rec, context=context)
468 return rec.last_history.open_partial()
469+
470+ def run_scheduler(self, cr, uid, run_all=None, context=None):
471+ """ Launch the reconcile with the oldest run
472+ This function is mostly here to be used with cron task
473+
474+ :param run_all: if set it will ingore lookup and launch
475+ all reconciliation
476+ :returns: True in case of success or raises an exception
477+
478+ """
479+ def _get_date(reconcile):
480+ return datetime.strptime(reconcile.last_history.date,
481+ DEFAULT_SERVER_DATETIME_FORMAT)
482+
483+ ids = self.search(cr, uid, [], context=context)
484+ assert ids, "No easy reconcile available"
485+ if run_all:
486+ self.run_reconcile(cr, uid, ids, context=context)
487+ return True
488+ reconciles = self.browse(cr, uid, ids, context=context)
489+ reconciles.sort(key=_get_date)
490+ older = reconciles[0]
491+ self.run_reconcile(cr, uid, [older.id], context=context)
492+ return True
493
494=== modified file 'account_easy_reconcile/easy_reconcile.xml'
495--- account_easy_reconcile/easy_reconcile.xml 2014-04-14 13:09:19 +0000
496+++ account_easy_reconcile/easy_reconcile.xml 2014-07-08 09:51:55 +0000
497@@ -159,4 +159,22 @@
498 parent="account.periodical_processing_reconciliation"/>
499
500 </data>
501+
502+<data noupdate="1">
503+
504+ <record forcecreate="True" id="ir_cron_run_reconciliations" model="ir.cron">
505+ <field name="name">Do Automatic Reconciliations</field>
506+ <field eval="False" name="active"/>
507+ <field name="user_id" ref="base.user_root"/>
508+ <field name="interval_number">3</field>
509+ <field name="interval_type">hours</field>
510+ <field name="numbercall">-1</field>
511+ <field eval="False" name="doall"/>
512+ <field eval="'account.easy.reconcile'" name="model"/>
513+ <field eval="'run_scheduler'" name="function"/>
514+ <field eval="'()'" name="args"/>
515+ </record>
516+
517+</data>
518+
519 </openerp>
520
521=== modified file 'account_easy_reconcile/easy_reconcile_history.py'
522--- account_easy_reconcile/easy_reconcile_history.py 2013-02-13 15:54:48 +0000
523+++ account_easy_reconcile/easy_reconcile_history.py 2014-07-08 09:51:55 +0000
524@@ -56,7 +56,7 @@
525 _columns = {
526 'easy_reconcile_id': fields.many2one(
527 'account.easy.reconcile', 'Reconcile Profile', readonly=True),
528- 'date': fields.datetime('Run date', readonly=True),
529+ 'date': fields.datetime('Run date', readonly=True, required=True),
530 'reconcile_ids': fields.many2many(
531 'account.move.reconcile',
532 'account_move_reconcile_history_rel',

Subscribers

People subscribed via source and target branches