Merge lp:~unifield-team/unifield-wm/UF_2045 into lp:unifield-wm

Proposed by jftempo
Status: Merged
Merged at revision: 1681
Proposed branch: lp:~unifield-team/unifield-wm/UF_2045
Merge into: lp:unifield-wm
Diff against target: 26 lines (+9/-0)
1 file modified
msf_doc_import/account.py (+9/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/UF_2045
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+171583@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 'msf_doc_import/account.py'
2--- msf_doc_import/account.py 2013-05-24 14:19:07 +0000
3+++ msf_doc_import/account.py 2013-06-26 15:19:25 +0000
4@@ -125,6 +125,8 @@
5 'employee_id': l.employee_id and l.employee_id.id or False,
6 }
7 self.pool.get('account.move.line').create(cr, uid, move_line_vals, context, check=False)
8+ # UF-2045: Validate the move to check lines
9+ self.pool.get('account.move').validate(cr, uid, [move_id], context=context)
10 return res
11
12 def button_validate(self, cr, uid, ids, context=None):
13@@ -148,6 +150,13 @@
14
15 # Check wizard data
16 for wiz in self.browse(cr, uid, ids):
17+ # UF-2045: Check that the given date is in an open period
18+ wiz_period_ids = self.pool.get('account.period').get_period_from_date(cr, uid, wiz.date, context)
19+ if not wiz_period_ids:
20+ raise osv.except_osv(_('Warning'), _('No period found!'))
21+ period = self.pool.get('account.period').browse(cr, uid, wiz_period_ids[0], context)
22+ if not period or period.state in ['created', 'done']:
23+ raise osv.except_osv(_('Warning'), _('Period for migration is not open!'))
24 # Check that a file was given
25 if not wiz.file:
26 raise osv.except_osv(_('Error'), _('Nothing to import.'))

Subscribers

People subscribed via source and target branches