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

Proposed by jftempo
Status: Merged
Merged at revision: 2746
Proposed branch: lp:~unifield-team/unifield-wm/us-873
Merge into: lp:unifield-wm
Diff against target: 82 lines (+21/-4)
4 files modified
account_journal/account_journal.py (+8/-0)
account_override/account.py (+7/-2)
account_period_closing_level/account_year_end_closing.py (+5/-1)
finance/account_view.xml (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-873
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+284418@code.launchpad.net
To post a comment you must log in.
lp:~unifield-team/unifield-wm/us-873 updated
2743. By Vincent GREINER

US-873 [FIX] forbid of journal system create was impacting auto create in yearly closure

2744. By Vincent GREINER

US-873 [FIX] do not allow to book manually entries on a system journal

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_journal/account_journal.py'
2--- account_journal/account_journal.py 2016-01-13 09:02:46 +0000
3+++ account_journal/account_journal.py 2016-01-29 11:16:03 +0000
4@@ -236,6 +236,14 @@
5 # Checks
6 if context is None:
7 context = {}
8+
9+ if not context.get('sync_update_execution', False):
10+ if not context.get('allow_journal_system_create', False):
11+ if vals.get('type', '') == 'system':
12+ # user not allowed to create 'system' journal
13+ raise osv.except_osv(_('Warning'),
14+ _('You can not create a System journal'))
15+
16 # Prepare some values
17 seq_pool = self.pool.get('ir.sequence')
18 seq_typ_pool = self.pool.get('ir.sequence.type')
19
20=== modified file 'account_override/account.py'
21--- account_override/account.py 2016-01-05 13:52:50 +0000
22+++ account_override/account.py 2016-01-29 11:16:03 +0000
23@@ -637,6 +637,8 @@
24 # UTFTP-262: Make manual_name mandatory
25 if 'manual_name' not in vals or not vals.get('manual_name', False) or vals.get('manual_name') == '':
26 raise osv.except_osv(_('Error'), _('Description is mandatory!'))
27+ if journal.type == 'system':
28+ raise osv.except_osv(_('Warning'), _('You can not record a Journal Entry on a system journal'))
29
30 if context.get('seqnums',False):
31 # utp913 - reuse sequence numbers if in the context
32@@ -684,8 +686,11 @@
33 if context.get('from_web_menu', False):
34 fields += ['document_date', 'date']
35 for m in self.browse(cr, uid, ids):
36- if context.get('from_web_menu', False) and m.status == 'sys':
37- raise osv.except_osv(_('Warning'), _('You cannot edit a Journal Entry created by the system.'))
38+ if context.get('from_web_menu', False):
39+ if m.status == 'sys':
40+ raise osv.except_osv(_('Warning'), _('You cannot edit a Journal Entry created by the system.'))
41+ if m.journal_id.type == 'system':
42+ raise osv.except_osv(_('Warning'), _('You can not edit a Journal Entry on a system journal'))
43 # Update context in order journal item could retrieve this @creation
44 # Also update some other fields
45 ml_vals = {}
46
47=== modified file 'account_period_closing_level/account_year_end_closing.py'
48--- account_period_closing_level/account_year_end_closing.py 2016-01-25 16:24:57 +0000
49+++ account_period_closing_level/account_year_end_closing.py 2016-01-29 11:16:03 +0000
50@@ -248,6 +248,10 @@
51 context=context)[0].company_id.instance_id
52 if instance_rec.level != 'coordo':
53 return
54+ if context is None:
55+ context = {}
56+ local_context = context.copy()
57+ local_context['allow_journal_system_create'] = True
58
59 for code in self._journals:
60 id = self._get_journal(cr, uid, code, context=context)
61@@ -261,7 +265,7 @@
62 'analytic_journal_id': False, # no AJI year end entries
63 }
64 self.pool.get('account.journal').create(cr, uid, vals,
65- context=context)
66+ context=local_context)
67
68 def delete_year_end_entries(self, cr, uid, fy_id, context=None):
69 """
70
71=== modified file 'finance/account_view.xml'
72--- finance/account_view.xml 2016-01-22 13:35:15 +0000
73+++ finance/account_view.xml 2016-01-29 11:16:03 +0000
74@@ -69,7 +69,7 @@
75 <form string="Journal Entries" position="replace">
76 <form string="Journal Entries" hide_delete_button="1">
77 <group colspan="4" col="6">
78- <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" context="{'from_manual_entry': True}" domain="[('type', '!=', 'system')]"/>
79+ <field name="journal_id" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" context="{'from_manual_entry': True}"/>
80 <field name="name" readonly="1"/>
81 <field name="period_id" on_change="onchange_period_id(period_id, date)" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}" domain="[('number', '!=', 16)]"/>
82 <field name="document_date" attrs="{'readonly': ['|', '|', ('status', '=', 'sys'), ('state', '=', 'posted'), ('imported', '=', True)]}"/>

Subscribers

People subscribed via source and target branches