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

Proposed by gpa(OpenERP)
Status: Superseded
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+32069@code.launchpad.net

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

This proposal has been superseded by a proposal from 2010-08-09.

Description of the change

Changes in the end balance value

To post a comment you must log in.
68. By gpa(OpenERP)

remove default for the account

69. By gpa(OpenERP)

remove default for the account

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_invoice_cash_discount/account_invoice_cash_discount.py'
--- account_invoice_cash_discount/account_invoice_cash_discount.py 2010-08-06 12:28:07 +0000
+++ account_invoice_cash_discount/account_invoice_cash_discount.py 2010-08-09 10:15:53 +0000
@@ -565,6 +565,7 @@
565 # for bank.statement.lines565 # for bank.statement.lines
566 # In line we get reconcile_id on bank.ste.rec.566 # In line we get reconcile_id on bank.ste.rec.
567 # in bank stat.rec we get line_new_ids on bank.stat.rec.line567 # in bank stat.rec we get line_new_ids on bank.stat.rec.line
568 new_end_value = 0.0
568 for move in st.line_ids:569 for move in st.line_ids:
569 context.update({'date':move.date})570 context.update({'date':move.date})
570 move_id = account_move_obj.create(cr, uid, {571 move_id = account_move_obj.create(cr, uid, {
@@ -773,6 +774,9 @@
773 'amount_currency': amount_currency,774 'amount_currency': amount_currency,
774 'currency_id': currency_id,775 'currency_id': currency_id,
775 }, context=context)776 }, context=context)
777
778 new_end_value += amount+st_tax_amount-newline_sum
779
776 account_move_line_obj.create(cr, uid, {780 account_move_line_obj.create(cr, uid, {
777 'name': move.name,781 'name': move.name,
778 'date': move.date,782 'date': move.date,
@@ -820,7 +824,12 @@
820 if st.journal_id.entry_posted:824 if st.journal_id.entry_posted:
821 account_move_obj.write(cr, uid, [move_id], {'state':'posted'})825 account_move_obj.write(cr, uid, [move_id], {'state':'posted'})
822 done.append(st.id)826 done.append(st.id)
823 self.write(cr, uid, done, {'state':'confirm'}, context=context)827
828 #### to write the balace value in the ending balance
829 balance_end_value = 0.0
830 balance_start_value = self.browse(cr, uid, st.id, context=context).balance_start
831 balance_end_value = balance_start_value + new_end_value
832 self.write(cr, uid, done, {'state':'confirm','balance_end_real':balance_end_value}, context=context)
824833
825 return True834 return True
826835
@@ -829,13 +838,6 @@
829class account_bank_statement_line(osv.osv):838class account_bank_statement_line(osv.osv):
830 _inherit="account.bank.statement.line"839 _inherit="account.bank.statement.line"
831 840
832 def _get_account(self, cr, uid, context={}):
833 account_id = self.pool.get('account.account').search(cr, uid, [('type','!=','view')])[0]
834 if account_id:
835 return account_id
836 else:
837 return False
838
839 def _get_tax(self, cr, uid, context={}):841 def _get_tax(self, cr, uid, context={}):
840 tax_id = self.pool.get('account.tax').search(cr, uid, [])842 tax_id = self.pool.get('account.tax').search(cr, uid, [])
841 if tax_id:843 if tax_id:
@@ -862,8 +864,8 @@
862 result['tax_id'] = False864 result['tax_id'] = False
863 865
864 return {'value': result}866 return {'value': result}
867
865 _defaults = {868 _defaults = {
866 'account_id': _get_account,
867 'tax_id': _get_tax,869 'tax_id': _get_tax,
868 'tax_type':lambda *a :'tax_included',870 'tax_type':lambda *a :'tax_included',
869 }871 }

Subscribers

People subscribed via source and target branches