[IMP]: improvement in accounting module

bzr revid: mga@tinyerp.com-20100713090130-nprwe7f05iv9w5q6
This commit is contained in:
Mantavya Gajjar 2010-07-13 14:31:30 +05:30
parent c8e3e6b5bd
commit ba8f090d18
6 changed files with 16 additions and 11 deletions

View File

@ -183,7 +183,7 @@ class account_cash_statement(osv.osv):
('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"),
'closing_date':fields.datetime("Closed On"),
'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Opening Balance and Transactions"),
'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"),
'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"),
'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'),
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),

View File

@ -674,6 +674,7 @@ class account_move_line(osv.osv):
account_id = line['account_id']['id']
partner_id = (line['partner_id'] and line['partner_id']['id']) or False
writeoff = debit - credit
# Ifdate_p in context => take this date
if context.has_key('date_p') and context['date_p']:
date=context['date_p']

View File

@ -2300,7 +2300,6 @@
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" />
<field name="user_id" select="1" readonly="1"/>
<field name="period_id" select="1"/>
<!-- <field name="balance_end_real"/>-->
</group>
<notebook colspan="4">

View File

@ -428,15 +428,17 @@ class account_voucher_line(osv.osv):
'type': lambda *a: 'cr'
}
def onchange_partner(self, cr, uid, ids, partner_id, ttype ,type1):
vals = {}
def onchange_partner(self, cr, uid, ids, partner_id, ttype ,type1, currency):
currency_pool = self.pool.get('res.currency')
company = self.pool.get('res.users').browse(cr, uid, uid).company_id
vals = {
'account_id': False,
'type': False ,
'amount': False
}
if not partner_id:
vals.update({
'account_id': False,
'type': False ,
'amount': False
})
return {
'value' : vals
}
@ -466,6 +468,9 @@ class account_voucher_line(osv.osv):
balance = partner.debit
ttype = 'cr'
if company.currency_id != currency:
balance = currency_pool.compute(cr, uid, company.currency_id.id, currency, balance)
vals.update({
'account_id': account_id,
'type': ttype,

View File

@ -37,7 +37,7 @@
<page string="Journal Entries">
<field name="payment_ids" colspan="4" nolabel="1" height="250">
<tree string="Voucher Lines" editable="top">
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type)"/>
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type, parent.currency_id)"/>
<field name="account_id"/>
<field name="name"/>
<field name="type"/>

View File

@ -10,7 +10,7 @@
<field name="payment_ids" position="replace">
<field name="voucher_line_ids" default_get="{'lines': voucher_line_ids}" colspan="4" nolabel="1" height="275">
<tree string="Voucher Lines" editable="top">
<field name="partner_id" on_change="onchange_partner(partner_id, type, parent.type)"/>
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type, parent.currency_id)"/>
<field name="account_id" on_change="onchange_line_account(account_id, type, parent.type)"/>
<field name="name"/>
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id, parent.currency_id)" domain="[('partner_id','=',partner_id),('state','=','open'),('residual','&gt;',0.0)]"/>