Merge lp:~openerp-dev/openobject-addons/trunk-bug-901554-mdi into lp:openobject-addons

Proposed by DJ Patel (OpenERP)
Status: Merged
Merged at revision: 6107
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-901554-mdi
Merge into: lp:openobject-addons
Diff against target: 27 lines (+6/-0)
1 file modified
account/wizard/account_period_close.py (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-901554-mdi
Reviewer Review Type Date Requested Status
Purnendu Singh (OpenERP) (community) Approve
DJ Patel (OpenERP) (community) Needs Resubmitting
Mustufa Rangwala (Open ERP) (community) Needs Fixing
qdp (OpenERP) Pending
Review via email: mp+85093@code.launchpad.net

Description of the change

Hello Sir,

I have fix the issue: https://bugs.launchpad.net/openobject-addons/+bug/901554 "Account: Can close period evenif there is unposted items on period".

Thanks and Regards,

Divyesh Makwana(MDI)

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Improve error message, here we are checking Journal entries state not journal items.

review: Needs Fixing
Revision history for this message
DJ Patel (OpenERP) (mdi-openerp) wrote :

Hello Sir,

I have improved error message as per your suggestion.

Thanks and Regards,

Divyesh Makwana(MDI)

review: Needs Resubmitting
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/wizard/account_period_close.py'
2--- account/wizard/account_period_close.py 2011-01-14 00:11:01 +0000
3+++ account/wizard/account_period_close.py 2011-12-13 04:45:32 +0000
4@@ -20,6 +20,7 @@
5 ##############################################################################
6
7 from osv import fields, osv
8+from tools.translate import _
9
10 class account_period_close(osv.osv_memory):
11 """
12@@ -39,11 +40,16 @@
13 @param ids: account period close’s ID or list of IDs
14 """
15 period_pool = self.pool.get('account.period')
16+ account_move_obj = self.pool.get('account.move')
17
18 mode = 'done'
19 for form in self.read(cr, uid, ids, context=context):
20 if form['sure']:
21 for id in context['active_ids']:
22+ account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id), ('state', '=', "draft")], context=context)
23+ if account_move_ids:
24+ raise osv.except_osv(_('Invalid action !'), _('In order to close a period, you must first post related journal entries.'))
25+
26 cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
27 cr.execute('update account_period set state=%s where id=%s', (mode, id))
28

Subscribers

People subscribed via source and target branches

to all changes: