Merge lp:~unifield-team/unifield-addons/UF_1003 into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merged at revision: 4541
Proposed branch: lp:~unifield-team/unifield-addons/UF_1003
Merge into: lp:unifield-addons
Diff against target: 30 lines (+11/-3)
1 file modified
account/account_move_line.py (+11/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/UF_1003
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+110739@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2011-06-22 20:05:58 +0000
3+++ account/account_move_line.py 2012-06-18 07:17:13 +0000
4@@ -1174,15 +1174,23 @@
5 move_obj.write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context)
6 return result
7
8+ def _hook_check_period_state(self, cr, uid, result=False, context=None, *args, **kargs):
9+ """
10+ Check period state
11+ """
12+ if not result:
13+ return False
14+ for (state,) in result:
15+ if state == 'done':
16+ raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed journal.'))
17+
18 def _update_journal_check(self, cr, uid, journal_id, period_id, context=None):
19 journal_obj = self.pool.get('account.journal')
20 period_obj = self.pool.get('account.period')
21 jour_period_obj = self.pool.get('account.journal.period')
22 cr.execute('SELECT state FROM account_journal_period WHERE journal_id = %s AND period_id = %s', (journal_id, period_id))
23 result = cr.fetchall()
24- for (state,) in result:
25- if state == 'done':
26- raise osv.except_osv(_('Error !'), _('You can not add/modify entries in a closed journal.'))
27+ self._hook_check_period_state(cr, uid, result, context=context)
28 if not result:
29 journal = journal_obj.browse(cr, uid, journal_id, context=context)
30 period = period_obj.browse(cr, uid, period_id, context=context)

Subscribers

People subscribed via source and target branches

to all changes: