Merge lp:~akretion-team/openobject-addons/trunk-addons-post-journal-entries-enhanced into lp:openobject-addons

Proposed by Alexis de Lattre
Status: Merged
Merged at revision: 8995
Proposed branch: lp:~akretion-team/openobject-addons/trunk-addons-post-journal-entries-enhanced
Merge into: lp:openobject-addons
Diff against target: 62 lines (+14/-9)
3 files modified
account/test/account_validate_account_move.yml (+7/-2)
account/wizard/account_validate_account_move.py (+5/-5)
account/wizard/account_validate_move_view.xml (+2/-2)
To merge this branch: bzr merge lp:~akretion-team/openobject-addons/trunk-addons-post-journal-entries-enhanced
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp (community) code review, no test Approve
OpenERP Core Team Pending
Review via email: mp+146978@code.launchpad.net

Description of the change

This is a very small but very usefull enhancement : In the wizard "Accounting > Periodical processing > Draft entries > Post Journal Entries", we can now select multiple journals and multiple periods (instead of just one journal and one period). In some scenarios, it can save a lot of time !

P.S. : if you want to test this merge proposal on an existing database, you have to manually delete the field "journal_id" and "period_id" of the table "validate_account_move" (-u account is not enough).

To post a comment you must log in.
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

Runbot is now green on this branch (with revno 8537) !

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

I have re-merged with addons-trunk and re-tested : it still works fine.

The runbot is green.

Could someone review this and merge if it's OK ?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/test/account_validate_account_move.yml'
2--- account/test/account_validate_account_move.yml 2013-02-21 05:29:58 +0000
3+++ account/test/account_validate_account_move.yml 2013-10-29 04:17:24 +0000
4@@ -80,8 +80,13 @@
5 I validate this account move by using the 'Post Journal Entries' wizard
6 -
7 !record {model: validate.account.move, id: validate_account_move_0}:
8- journal_id: account.bank_journal
9- period_id: account.period_6
10+ journal_ids:
11+ - bank_journal
12+ - check_journal
13+ period_ids:
14+ - period_6
15+ - period_7
16+ - period_8
17 -
18 I click on validate Button
19 -
20
21=== modified file 'account/wizard/account_validate_account_move.py'
22--- account/wizard/account_validate_account_move.py 2013-06-14 09:19:24 +0000
23+++ account/wizard/account_validate_account_move.py 2013-10-29 04:17:24 +0000
24@@ -25,18 +25,18 @@
25 _name = "validate.account.move"
26 _description = "Validate Account Move"
27 _columns = {
28- 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
29- 'period_id': fields.many2one('account.period', 'Period', required=True, domain=[('state','<>','done')]),
30+ 'journal_ids': fields.many2many('account.journal', 'wizard_validate_account_move_journal', 'wizard_id', 'journal_id', 'Journal', required=True),
31+ 'period_ids': fields.many2many('account.period', 'wizard_validate_account_move_period', 'wizard_id', 'period_id', 'Period', required=True, domain=[('state','<>','done')]),
32 }
33
34 def validate_move(self, cr, uid, ids, context=None):
35 obj_move = self.pool.get('account.move')
36 if context is None:
37 context = {}
38- data = self.browse(cr, uid, ids, context=context)[0]
39- ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data.journal_id.id),('period_id','=',data.period_id.id)])
40+ data = self.read(cr, uid, ids[0], context=context)
41+ ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','in',tuple(data['journal_ids'])),('period_id','in',tuple(data['period_ids']))])
42 if not ids_move:
43- raise osv.except_osv(_('Warning!'), _('Specified journal does not have any account move entries in draft state for this period.'))
44+ raise osv.except_osv(_('Warning!'), _('Specified journals do not have any account move entries in draft state for the specified periods.'))
45 obj_move.button_validate(cr, uid, ids_move, context=context)
46 return {'type': 'ir.actions.act_window_close'}
47
48
49=== modified file 'account/wizard/account_validate_move_view.xml'
50--- account/wizard/account_validate_move_view.xml 2012-12-18 02:11:23 +0000
51+++ account/wizard/account_validate_move_view.xml 2013-10-29 04:17:24 +0000
52@@ -9,8 +9,8 @@
53 <field name="arch" type="xml">
54 <form string="Post Journal Entries" version="7.0">
55 <group>
56- <field name="journal_id"/>
57- <field name="period_id"/>
58+ <field name="journal_ids"/>
59+ <field name="period_ids"/>
60 </group>
61 <footer>
62 <button string="Approve" name="validate_move" type="object" class="oe_highlight"/>

Subscribers

People subscribed via source and target branches

to all changes: