Merge lp:~julie-w/unifield-server/US-4691 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4970
Proposed branch: lp:~julie-w/unifield-server/US-4691
Merge into: lp:unifield-server
Diff against target: 80 lines (+8/-11)
4 files modified
bin/addons/account/account_cash_statement.py (+2/-2)
bin/addons/msf_instance/add_instance.py (+1/-1)
bin/addons/register_accounting/account_bank_statement.py (+0/-2)
bin/addons/register_accounting/account_cash_statement.py (+5/-6)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-4691
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+349128@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/account_cash_statement.py'
2--- bin/addons/account/account_cash_statement.py 2018-02-02 13:41:57 +0000
3+++ bin/addons/account/account_cash_statement.py 2018-07-09 08:35:56 +0000
4@@ -223,9 +223,9 @@
5 [('draft', 'Draft'),
6 ('confirm', 'Closed'),
7 ('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
8- 'total_entry_encoding': fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
9+ 'total_entry_encoding': fields.function(_get_sum_entry_encoding, method=True, store=False, string="Cash Transaction", help="Total cash transactions"),
10 'closing_date': fields.datetime("Closed On"),
11- 'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
12+ 'balance_end': fields.function(_end_balance, method=True, store=False, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
13 'balance_end_cash': fields.function(_balance_end_cash, method=True, store=False, string='Balance', help="Closing balance based on cashBox"),
14 'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
15 'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
16
17=== modified file 'bin/addons/msf_instance/add_instance.py'
18--- bin/addons/msf_instance/add_instance.py 2018-02-02 13:49:26 +0000
19+++ bin/addons/msf_instance/add_instance.py 2018-07-09 08:35:56 +0000
20@@ -440,7 +440,7 @@
21 # Note: at Cashbox closing the balance_end_real is set to the reg.balance_end value: keep this change
22 if 'balance_end_real' in newvals and not context.get('from_cash_statement_equal_balance', False):
23 del newvals['balance_end_real']
24- if 'balance_start' in newvals:
25+ if 'balance_start' in newvals and not context.get('update_next_reg_balance_start', False):
26 del newvals['balance_start']
27 if 'ending_details_ids' in newvals:
28 del newvals['ending_details_ids']
29
30=== modified file 'bin/addons/register_accounting/account_bank_statement.py'
31--- bin/addons/register_accounting/account_bank_statement.py 2018-06-11 13:34:07 +0000
32+++ bin/addons/register_accounting/account_bank_statement.py 2018-07-09 08:35:56 +0000
33@@ -771,9 +771,7 @@
34 else:
35 computed_balance = 0.0
36 if reg.journal_id.type == 'cash':
37- context['from_open'] = True
38 computed_balance = self._get_starting_balance(cr, uid, [ids[0]], context=context)[ids[0]].get('balance_start', 0.0)
39- del context['from_open']
40 return self.open_register(cr, uid, ids[0], cash_opening_balance=computed_balance, context=context)
41 return res
42
43
44=== modified file 'bin/addons/register_accounting/account_cash_statement.py'
45--- bin/addons/register_accounting/account_cash_statement.py 2018-05-28 08:58:14 +0000
46+++ bin/addons/register_accounting/account_cash_statement.py 2018-07-09 08:35:56 +0000
47@@ -52,11 +52,7 @@
48 for line in statement.starting_details_ids:
49 amount_total+= line.pieces * line.number
50 else:
51- if context and context.get('from_open'):
52- # US-948 carry other cashbox balance at open register
53- amount_total = statement.prev_reg_id.balance_end_cash
54- else:
55- amount_total = statement.prev_reg_id.msf_calculated_balance
56+ amount_total = statement.prev_reg_id.msf_calculated_balance
57
58 res[statement.id] = {
59 'balance_start': amount_total
60@@ -260,6 +256,8 @@
61 """
62 Sum of opening balance (balance_start) and sum of cash transaction (total_entry_encoding)
63 """
64+ if context is None:
65+ context = {}
66 # Prepare some values
67 res = {}
68 for st in self.browse(cr, uid, ids):
69@@ -268,9 +266,10 @@
70 # Update next register opening balance
71 if st.journal_id and st.journal_id.type == 'cash':
72 next_st_ids = self.search(cr, uid, [('prev_reg_id', '=', st.id)])
73+ context.update({'update_next_reg_balance_start': True})
74 for next_st in self.browse(cr, uid, next_st_ids):
75 if next_st.state != 'confirm':
76- self.write(cr, 1, [next_st.id], {'balance_start': amount})
77+ self.write(cr, 1, [next_st.id], {'balance_start': amount}, context=context)
78 return res
79
80 def _get_sum_entry_encoding(self, cr, uid, ids, field_name=None, arg=None, context=None):

Subscribers

People subscribed via source and target branches