Merge lp:~unifield-team/unifield-wm/us-879 into lp:unifield-wm

Proposed by jftempo
Status: Merged
Merged at revision: 2751
Proposed branch: lp:~unifield-team/unifield-wm/us-879
Merge into: lp:unifield-wm
Diff against target: 40 lines (+20/-2)
1 file modified
account_period_closing_level/account_year_end_closing.py (+20/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-879
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+284467@code.launchpad.net
To post a comment you must log in.
lp:~unifield-team/unifield-wm/us-879 updated
2743. By Vincent GREINER

US-879 [FIX] year en closing: update periods state only if founds (no special period for FY14)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_period_closing_level/account_year_end_closing.py'
--- account_period_closing_level/account_year_end_closing.py 2016-01-29 10:42:26 +0000
+++ account_period_closing_level/account_year_end_closing.py 2016-01-29 16:27:33 +0000
@@ -765,8 +765,11 @@
765 state = 'done'765 state = 'done'
766766
767 if state:767 if state:
768 vals = { 'state': state, }
769 # period 0 (FY+1)/16 state768 # period 0 (FY+1)/16 state
769
770 # US-879: for periods update, set 'state_sync_flag' field first,
771 # for adhoc sync state flow, like in account_period.action_set_state
772 vals = { 'state_sync_flag': state, }
770 period_ids = self._get_periods_ids(cr, uid,773 period_ids = self._get_periods_ids(cr, uid,
771 self._browse_fy(cr, uid, fy_id, context=context),774 self._browse_fy(cr, uid, fy_id, context=context),
772 context=context)775 context=context)
@@ -774,7 +777,22 @@
774 self.pool.get('account.period').write(cr, uid, period_ids, vals,777 self.pool.get('account.period').write(cr, uid, period_ids, vals,
775 context=context)778 context=context)
776779
777 # fy state780 # then after 'state_sync_flag' set, set account_journal_period state
781 # and period true state
782 # (DO NOT CHANGE 'state' in same write than 'state_sync_flag'
783 if state == 'done':
784 journal_state = 'done'
785 else:
786 journal_state = 'draft'
787 cr.execute('UPDATE account_journal_period' \
788 ' SET state=%s WHERE period_id IN %s', (
789 journal_state, tuple(period_ids), ))
790 vals = {'state': state, 'field_process': False}
791 self.pool.get('account.period').write(cr, uid, period_ids, vals,
792 context=context)
793
794 # then set FY state
795 vals = { 'state': state, }
778 fy_obj.write(cr, uid, [fy_id], vals, context=context)796 fy_obj.write(cr, uid, [fy_id], vals, context=context)
779797
780 def _search_record(self, cr, uid, model, domain, context=None):798 def _search_record(self, cr, uid, model, domain, context=None):

Subscribers

People subscribed via source and target branches