Merge lp:~unifield-team/unifield-server/us-306 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3657
Proposed branch: lp:~unifield-team/unifield-server/us-306
Merge into: lp:unifield-server
Diff against target: 61 lines (+27/-4)
2 files modified
bin/addons/account_hq_entries/hq_entries.py (+21/-1)
bin/addons/account_hq_entries/wizard/hq_entries_validation.py (+6/-3)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-306
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+289258@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 'bin/addons/account_hq_entries/hq_entries.py'
2--- bin/addons/account_hq_entries/hq_entries.py 2016-03-11 14:16:29 +0000
3+++ bin/addons/account_hq_entries/hq_entries.py 2016-03-16 17:11:25 +0000
4@@ -480,11 +480,31 @@
5 raise osv.except_osv(_("Warning"),
6 _("No HQ Entry selected for transaction"))
7
8- domain = [('id', 'in', ids), ('user_validated', '=', True)]
9+ # BKLG-77
10+ domain = [
11+ ('id', 'in', ids),
12+ ('user_validated', '=', True),
13+ ]
14 if self.search(cr, uid, domain, context=context, count=True):
15 raise osv.except_osv(_("Warning"),
16 _("You can not perform this action on a validated HQ Entry" \
17 " (please use the 'To Validate' filter in the HQ Entries list)"))
18
19+ # US-306: forbid to validate mission closed or + entries
20+ # => at coordo level you can not validate entries since field closed
21+ # period; but they can come from HQ mission opened via SYNC)
22+ period_ids = list(set([ he.period_id.id \
23+ for he in self.browse(cr, uid, ids, context=context) ]))
24+ if period_ids:
25+ domain = [
26+ ('id', 'in', period_ids),
27+ ('state', 'in', ['mission-closed', 'done', ]),
28+ ]
29+ if self.pool.get('account.period').search(cr, uid, domain,
30+ context=context, count=True):
31+ raise osv.except_osv(_("Warning"),
32+ _("You can not validate HQ Entry in a mission-closed" \
33+ " period"))
34+
35 hq_entries()
36 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
37
38=== modified file 'bin/addons/account_hq_entries/wizard/hq_entries_validation.py'
39--- bin/addons/account_hq_entries/wizard/hq_entries_validation.py 2015-08-28 12:56:45 +0000
40+++ bin/addons/account_hq_entries/wizard/hq_entries_validation.py 2016-03-16 17:11:25 +0000
41@@ -40,14 +40,17 @@
42 _defaults = {
43 'running': False,
44 }
45- def create(self, cr, uid, vals, context=None):
46- # BKLG-77: check transation before showing wizard
47+
48+ def default_get(self, cr, uid, fields, context=None):
49+ # check transaction before showing wizard
50 line_ids = context and context.get('active_ids', []) or []
51 if isinstance(line_ids, (int, long)):
52 line_ids = [line_ids]
53+
54 self.pool.get('hq.entries').check_hq_entry_transaction(cr, uid,
55 line_ids, self._name, context=context)
56- return super(hq_entries_validation, self).create(cr, uid, vals,
57+
58+ return super(hq_entries_validation, self).default_get(cr, uid, fields,
59 context=context)
60
61 # UTP-1101: Extract the method to create AD for being called also for the REV move

Subscribers

People subscribed via source and target branches

to all changes: