[IMP]: account.move: improvement in to the view and move some fields

bzr revid: mga@tinyerp.com-20100724075808-lmavqf5tu461j73s
This commit is contained in:
Mantavya Gajjar 2010-07-24 13:28:08 +05:30
parent e5f8ce00c3
commit 9c61b83007
2 changed files with 11 additions and 27 deletions

View File

@ -1078,24 +1078,13 @@ class account_move(osv.osv):
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
'type': fields.selection([
('pay_voucher','Cash Payment'),
('bank_pay_voucher','Bank Payment'),
('rec_voucher','Cash Receipt'),
('bank_rec_voucher','Bank Receipt'),
('cont_voucher','Contra'),
('journal_sale_vou','Journal Sale'),
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Entry Type', select=True , size=128, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Narration', readonly=True, select=True),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
}
_defaults = {
'name': lambda *a: '/',
'state': lambda *a: 'draft',
'period_id': _get_period,
'type' : lambda *a : 'journal_voucher',
'date': lambda *a:time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}

View File

@ -1102,7 +1102,6 @@
<field name="ref"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="type" invisible=" not context.get('set_visible',True)"/>
<field name="partner_id"/>
<field name="line_id"/>
<field name="to_check" groups="base.group_extended"/>
@ -1120,15 +1119,19 @@
<form string="Journal Entries">
<group colspan="4" col="6">
<field name="name" select="1" readonly="True"/>
<field name="ref" select="1"/>
<field name="to_check" groups="base.group_extended"/>
<field name="journal_id" select="1"/>
<field name="period_id"/>
<field name="type"/>
<field name="ref" select="1"/>
<field name="date" select="1"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
<field name="partner_id" invisible="1" select="1"/>
<field name="amount" invisible="1" select="1"/>
</group>
<notebook colspan="4">
<page string="Journal Entries Lines">
<field colspan="4" height="200" name="line_id" nolabel="1" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
<field colspan="4" name="line_id" nolabel="1" height="250" widget="one2many_list" default_get="{'lines':line_id ,'journal':journal_id }">
<form string="Account Entry Line">
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
@ -1173,20 +1176,13 @@
</tree>
</field>
<separator colspan="4" string="Narration"/>
<field name="narration" colspan="4" nolabel="1"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
<field name="narration" colspan="4" nolabel="1" height="50"/>
<group col="4" colspan="4">
<field name="state" select="1"/>
<button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="posted" string="Cancel" type="object" icon="terp-gtk-stop"/>
</group>
</page>
<page string="Other Information">
<field name="company_id" required="1" groups="base.group_multi_company"/>
<field name="date" select="1" groups="base.group_extended"/>
<field name="to_check" groups="base.group_extended"/>
<field name="partner_id" invisible="1" select="1"/>
<field name="amount" invisible="1" select="1"/>
</page>
</notebook>
</form>
</field>
@ -1212,7 +1208,6 @@
<group expand="0" string="Group By..." colspan="12" col="10">
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type', 'set_visible':True}"/>
<filter string="States" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>