Merge lp:~openbig/bigconsulting/endbalance_changes into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 65
Proposed branch: lp:~openbig/bigconsulting/endbalance_changes
Merge into: lp:bigconsulting
Diff against target: 59 lines (+11/-9)
1 file modified
account_invoice_cash_discount/account_invoice_cash_discount.py (+11/-9)
To merge this branch: bzr merge lp:~openbig/bigconsulting/endbalance_changes
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+32079@code.launchpad.net

This proposal supersedes a proposal from 2010-08-09.

Description of the change

Changes in the end balance value

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 'account_invoice_cash_discount/account_invoice_cash_discount.py'
2--- account_invoice_cash_discount/account_invoice_cash_discount.py 2010-08-06 12:28:07 +0000
3+++ account_invoice_cash_discount/account_invoice_cash_discount.py 2010-08-09 10:17:40 +0000
4@@ -565,6 +565,7 @@
5 # for bank.statement.lines
6 # In line we get reconcile_id on bank.ste.rec.
7 # in bank stat.rec we get line_new_ids on bank.stat.rec.line
8+ new_end_value = 0.0
9 for move in st.line_ids:
10 context.update({'date':move.date})
11 move_id = account_move_obj.create(cr, uid, {
12@@ -773,6 +774,9 @@
13 'amount_currency': amount_currency,
14 'currency_id': currency_id,
15 }, context=context)
16+
17+ new_end_value += amount+st_tax_amount-newline_sum
18+
19 account_move_line_obj.create(cr, uid, {
20 'name': move.name,
21 'date': move.date,
22@@ -820,7 +824,12 @@
23 if st.journal_id.entry_posted:
24 account_move_obj.write(cr, uid, [move_id], {'state':'posted'})
25 done.append(st.id)
26- self.write(cr, uid, done, {'state':'confirm'}, context=context)
27+
28+ #### to write the balace value in the ending balance
29+ balance_end_value = 0.0
30+ balance_start_value = self.browse(cr, uid, st.id, context=context).balance_start
31+ balance_end_value = balance_start_value + new_end_value
32+ self.write(cr, uid, done, {'state':'confirm','balance_end_real':balance_end_value}, context=context)
33
34 return True
35
36@@ -829,13 +838,6 @@
37 class account_bank_statement_line(osv.osv):
38 _inherit="account.bank.statement.line"
39
40- def _get_account(self, cr, uid, context={}):
41- account_id = self.pool.get('account.account').search(cr, uid, [('type','!=','view')])[0]
42- if account_id:
43- return account_id
44- else:
45- return False
46-
47 def _get_tax(self, cr, uid, context={}):
48 tax_id = self.pool.get('account.tax').search(cr, uid, [])
49 if tax_id:
50@@ -862,8 +864,8 @@
51 result['tax_id'] = False
52
53 return {'value': result}
54+
55 _defaults = {
56- 'account_id': _get_account,
57 'tax_id': _get_tax,
58 'tax_type':lambda *a :'tax_included',
59 }

Subscribers

People subscribed via source and target branches