[FIX/IMP]: fix and improve the accounting entries through voucher

bzr revid: mga@tinyerp.com-20100714055150-6134qxfy7jwg1zza
This commit is contained in:
Mantavya Gajjar 2010-07-14 11:21:50 +05:30
parent c3bf1349b2
commit cc9cc1b923
4 changed files with 22 additions and 14 deletions

View File

@ -147,7 +147,7 @@
<field name="number" readonly="1"/>
<field name="type" invisible="1"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)" width="50"/>
<button name="%(action_account_change_currency)d" type="action" icon="gtk-apply" string="Change"/>
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change"/>
<newline/>
<field name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" context="{'default_customer': 0}"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>

View File

@ -116,10 +116,10 @@ class account_voucher(osv.osv):
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Entry Type', select=True , size=128, readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]),
'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}),
'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'draft':[('readonly',True)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'posted':[('readonly',True)]}),
'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=False),
'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
@ -137,9 +137,8 @@ class account_voucher(osv.osv):
\n* The \'Posted\' state is used when user create voucher,a voucher number is generated and voucher entries are created in account \
\n* The \'Cancelled\' state is used when user cancel voucher.'),
'amount':fields.float('Amount', readonly=True),
'reference': fields.char('Voucher Reference', size=64),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True),
'reference': fields.char('Reference', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Bank cheque number or payorder number"),
'reference_type': fields.selection(_get_reference_type, 'Reference Type', required=True),
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
'move_id':fields.many2one('account.move', 'Account Entry'),
'move_ids':fields.many2many('account.move.line', 'voucher_id', 'account_id', 'rel_account_move', 'Real Entry'),
@ -280,7 +279,8 @@ class account_voucher(osv.osv):
'journal_id': journal.id,
'type' : inv.type,
'narration' : inv.narration and inv.narration or inv.name,
'date':inv.date
'date':inv.date,
'ref':inv.reference
}
if inv.period_id:

View File

@ -35,7 +35,7 @@
</group>
<notebook colspan="4">
<page string="Journal Entries">
<field name="payment_ids" colspan="4" nolabel="1" height="250">
<field name="payment_ids" colspan="4" nolabel="1" height="200">
<tree string="Voucher Lines" editable="top">
<field name="partner_id" on_change="onchange_partner(partner_id,type,parent.type, parent.currency_id)"/>
<field name="account_id"/>
@ -46,14 +46,21 @@
<field name="ref"/>
</tree>
</field>
<separator string="Narration" colspan="4"/>
<field name="narration" colspan="4" nolabel="1" height="50"/>
<group col="2" colspan="3">
<separator string="Narration" colspan="2"/>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
<separator string="Other Informtion" colspan="2"/>
<field name="reference" select="1"/>
<field name="date" select="1"/>
<field name="currency_id" select="1"/>
</group>
</page>
<page string="Other Info">
<page string="Accounting Entries">
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
<field name="currency_id" select="1" />
<field name="period_id"/>
<field name="date" select="1"/>
<separator string="General Entries" colspan="4"/>
<field name="move_ids" colspan="4" nolabel="1" readonly="1"/>
</page>

View File

@ -63,7 +63,8 @@ class account_voucher(osv.osv):
'journal_id': journal.id,
'type' : inv.type,
'narration' : inv.narration and inv.narration or inv.name,
'date':inv.date
'date':inv.date,
'ref':inv.reference
}
if inv.period_id: