[IMP]: improvement in accounting module
bzr revid: mga@tinyerp.com-20100713090130-nprwe7f05iv9w5q6
This commit is contained in:
parent
c8e3e6b5bd
commit
ba8f090d18
|
@ -183,7 +183,7 @@ class account_cash_statement(osv.osv):
|
||||||
('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"),
|
('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"),
|
'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"),
|
'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"),
|
'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'),
|
'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'),
|
'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'),
|
||||||
|
|
|
@ -674,6 +674,7 @@ class account_move_line(osv.osv):
|
||||||
account_id = line['account_id']['id']
|
account_id = line['account_id']['id']
|
||||||
partner_id = (line['partner_id'] and line['partner_id']['id']) or False
|
partner_id = (line['partner_id'] and line['partner_id']['id']) or False
|
||||||
writeoff = debit - credit
|
writeoff = debit - credit
|
||||||
|
|
||||||
# Ifdate_p in context => take this date
|
# Ifdate_p in context => take this date
|
||||||
if context.has_key('date_p') and context['date_p']:
|
if context.has_key('date_p') and context['date_p']:
|
||||||
date=context['date_p']
|
date=context['date_p']
|
||||||
|
|
|
@ -2300,7 +2300,6 @@
|
||||||
<field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" />
|
<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="user_id" select="1" readonly="1"/>
|
||||||
<field name="period_id" select="1"/>
|
<field name="period_id" select="1"/>
|
||||||
<!-- <field name="balance_end_real"/>-->
|
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
|
|
|
@ -428,15 +428,17 @@ class account_voucher_line(osv.osv):
|
||||||
'type': lambda *a: 'cr'
|
'type': lambda *a: 'cr'
|
||||||
}
|
}
|
||||||
|
|
||||||
def onchange_partner(self, cr, uid, ids, partner_id, ttype ,type1):
|
def onchange_partner(self, cr, uid, ids, partner_id, ttype ,type1, currency):
|
||||||
vals = {}
|
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:
|
if not partner_id:
|
||||||
vals.update({
|
|
||||||
'account_id': False,
|
|
||||||
'type': False ,
|
|
||||||
'amount': False
|
|
||||||
})
|
|
||||||
return {
|
return {
|
||||||
'value' : vals
|
'value' : vals
|
||||||
}
|
}
|
||||||
|
@ -466,6 +468,9 @@ class account_voucher_line(osv.osv):
|
||||||
balance = partner.debit
|
balance = partner.debit
|
||||||
ttype = 'cr'
|
ttype = 'cr'
|
||||||
|
|
||||||
|
if company.currency_id != currency:
|
||||||
|
balance = currency_pool.compute(cr, uid, company.currency_id.id, currency, balance)
|
||||||
|
|
||||||
vals.update({
|
vals.update({
|
||||||
'account_id': account_id,
|
'account_id': account_id,
|
||||||
'type': ttype,
|
'type': ttype,
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<page string="Journal Entries">
|
<page string="Journal Entries">
|
||||||
<field name="payment_ids" colspan="4" nolabel="1" height="250">
|
<field name="payment_ids" colspan="4" nolabel="1" height="250">
|
||||||
<tree string="Voucher Lines" editable="top">
|
<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="account_id"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<field name="payment_ids" position="replace">
|
<field name="payment_ids" position="replace">
|
||||||
<field name="voucher_line_ids" default_get="{'lines': voucher_line_ids}" colspan="4" nolabel="1" height="275">
|
<field name="voucher_line_ids" default_get="{'lines': voucher_line_ids}" colspan="4" nolabel="1" height="275">
|
||||||
<tree string="Voucher Lines" editable="top">
|
<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="account_id" on_change="onchange_line_account(account_id, type, parent.type)"/>
|
||||||
<field name="name"/>
|
<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','>',0.0)]"/>
|
<field name="invoice_id" on_change="onchange_invoice_id(invoice_id, parent.currency_id)" domain="[('partner_id','=',partner_id),('state','=','open'),('residual','>',0.0)]"/>
|
||||||
|
|
Loading…
Reference in New Issue