[IMP]:improve for the -ve entry with the journal voucher

bzr revid: mga@tinyerp.com-20100914134607-9wexghheuzyoah1r
This commit is contained in:
Mantavya Gajjar 2010-09-14 19:16:07 +05:30
parent a33a9ba04d
commit 45e6a04014
2 changed files with 15 additions and 9 deletions

View File

@ -790,10 +790,10 @@ class account_voucher_line(osv.osv):
journal = journal_pool.browse(cr, user, journal_id)
account_id = False
ttype = 'cr'
if journal.type in ('sale', 'purchase_refund'):
if journal.type in ('sale', 'sale_refund'):
account_id = journal.default_credit_account_id and journal.default_credit_account_id.id or False
ttype = 'cr'
elif journal.type in ('purchase', 'expense', 'sale_refund'):
elif journal.type in ('purchase', 'expense', 'purchase_refund'):
account_id = journal.default_debit_account_id and journal.default_debit_account_id.id or False
ttype = 'dr'
elif partner_id:

View File

@ -41,7 +41,7 @@
<tree string="Sales and Receipt" editable="top">
<field name="account_id"/>
<field name="name"/>
<field name="amount"/>
<field name="amount" sum="Total Amount"/>
<field name="type"/>
<field name="account_analytic_id" domain="[('parent_id','!=',False)]"/>
</tree>
@ -51,7 +51,7 @@
<tree string="Purchase and Payments" editable="top">
<field name="account_id"/>
<field name="name"/>
<field name="amount"/>
<field name="amount" sum="Total Amount"/>
<field name="type"/>
<field name="account_analytic_id" domain="[('parent_id','!=',False)]"/>
</tree>
@ -61,11 +61,17 @@
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<separator string="Other Information" colspan="2"/>
<field name="amount" string="Total"/>
<field name="number"/>
<field name="date" select="1" on_change="onchange_date(date)"/>
<field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
<group col="2" colspan="1" >
<separator string="Other Information" colspan="2"/>
<field name="number"/>
<field name="date" select="1" on_change="onchange_date(date)"/>
<field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
</group>
<group col="4" colspan="1" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
<separator string="Total" colspan="4"/>
<field name="tax_id" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" widget="selection" domain="[('type_tax_use','in',('sale','all'))]"/><field name="tax_amount" nolabel="1"/><button type="object" icon="terp-stock_format-scientific" name="compute_tax" groups="base.group_extended" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
<label colspan="1" string=""/><field name="amount" string="Total"/>
</group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">