Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_rec_cron_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_rec_cron_mdh
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 46 lines (+21/-1)
2 files modified
account_easy_reconcile/easy_reconcile.py (+8/-1)
account_easy_reconcile/easy_reconcile.xml (+13/-0)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0_rec_cron_mdh
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Fixing
Review via email: mp+220278@code.launchpad.net

Commit message

[IMP] new scheduler task to reconcile automatically entries

Description of the change

This patch adds a (by default, inactive) scheduler task to process all automatic reconcilations once per day. This is useful in cases lots of unreconciled entries are on a account, and the normal process would take too much time when called by the interface.

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

The idea behind it seems fine by me. But you need to put this data entry in a noupdate="1" data tag, otherwise the people who activate the job will find out some time after a module update that the job has been disabled again. You can remove the forcecreate tag, 'True' is the default value.

Optionally store the xml-entry in a new file (easy_reconcile_cron.xml, or easy_reconcile_data.xml).

review: Needs Fixing
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

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

Moved to github

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

Unmerged revisions

152. By Matthieu Dietrich @ camptocamp

[IMP] add cron job for reconciliation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_easy_reconcile/easy_reconcile.py'
2--- account_easy_reconcile/easy_reconcile.py 2014-03-14 10:48:30 +0000
3+++ account_easy_reconcile/easy_reconcile.py 2014-05-20 14:35:11 +0000
4@@ -258,7 +258,7 @@
5 _('Error'),
6 _('There is no history of reconciled '
7 'items on the task: %s.') % rec.name)
8-
9+
10 def _open_move_line_list(sefl, cr, uid, move_line_ids, name, context=None):
11 return {
12 'name': name,
13@@ -336,3 +336,10 @@
14 if not rec.last_history:
15 self._no_history(cr, uid, rec, context=context)
16 return rec.last_history.open_partial()
17+
18+ def run_scheduler(self, cr, uid, context=None):
19+ # Retrieve all easy reconcile ids
20+ ids = self.search(cr, uid, [], context=context)
21+ # launch run_reconcile action for every item
22+ self.run_reconcile(cr, uid, ids, context=context)
23+ return True
24
25=== modified file 'account_easy_reconcile/easy_reconcile.xml'
26--- account_easy_reconcile/easy_reconcile.xml 2014-04-14 13:09:19 +0000
27+++ account_easy_reconcile/easy_reconcile.xml 2014-05-20 14:35:11 +0000
28@@ -158,5 +158,18 @@
29 id="menu_easy_reconcile"
30 parent="account.periodical_processing_reconciliation"/>
31
32+ <record forcecreate="True" id="ir_cron_run_reconciliations" model="ir.cron">
33+ <field name="name">Do Automatic Reconciliations</field>
34+ <field eval="False" name="active"/>
35+ <field name="user_id" ref="base.user_root"/>
36+ <field name="interval_number">1</field>
37+ <field name="interval_type">days</field>
38+ <field name="numbercall">-1</field>
39+ <field eval="False" name="doall"/>
40+ <field eval="'account.easy.reconcile'" name="model"/>
41+ <field eval="'run_scheduler'" name="function"/>
42+ <field eval="'()'" name="args"/>
43+ </record>
44+
45 </data>
46 </openerp>

Subscribers

People subscribed via source and target branches