Merge lp:~openerp-dev/openobject-addons/trunk-bug-1073248-dhr into lp:openobject-addons

Proposed by Dharti Ratani(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1073248-dhr
Merge into: lp:openobject-addons
Diff against target: 19 lines (+7/-0)
1 file modified
account/wizard/account_fiscalyear_close_state.py (+7/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1073248-dhr
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+140630@code.launchpad.net

Description of the change

Hello,

      Raised a warning to Post journal entries related to a fiscal year while closing that fiscal year.

Thanks

To post a comment you must log in.

Unmerged revisions

8405. By Dharti Ratani(OpenERP)

[FIX]Raised a warning to validate the journal entries while closing a fiscal year.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/wizard/account_fiscalyear_close_state.py'
2--- account/wizard/account_fiscalyear_close_state.py 2012-12-06 14:56:32 +0000
3+++ account/wizard/account_fiscalyear_close_state.py 2012-12-19 11:25:41 +0000
4@@ -41,8 +41,15 @@
5 @param ids: List of Account fiscalyear close state’s IDs
6
7 """
8+ period_pool = self.pool.get('account.period')
9+ account_move_obj = self.pool.get('account.move')
10 for data in self.read(cr, uid, ids, context=context):
11 fy_id = data['fy_id'][0]
12+ period_ids = period_pool.search(cr, uid, [('fiscalyear_id', '=', fy_id)], context=context)
13+ for period_id in period_ids:
14+ account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', period_id),('state', '=', 'draft')], context=context)
15+ if account_move_ids:
16+ raise osv.except_osv(_('Invalid Action!'), _('In order to close a fiscal year, you must first post related journal entries.'))
17
18 cr.execute('UPDATE account_journal_period ' \
19 'SET state = %s ' \

Subscribers

People subscribed via source and target branches

to all changes: