parent
78e8b8168e
commit
0de8216438
|
@ -189,7 +189,8 @@ class account_voucher(osv.osv):
|
|||
\n* The \'Pro-forma\' when voucher is in Pro-forma state,voucher does not have an voucher number. \
|
||||
\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),
|
||||
'amount':fields.float('Amount', readonly=True), # don't forget to put right digits, computed field ?
|
||||
'tax_amount':fields.float('Tax Amount'), # don't forget to put right digits
|
||||
'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Payment or Receipt transaction number, i.e. Bank cheque number or payorder number or Wire transfer number or Acknowledge number."),
|
||||
'reference_type': fields.selection(_get_reference_type, 'Reference Type', required=True),
|
||||
'number': fields.related('move_id', 'name', type="char", readonly=True, string='Number'),
|
||||
|
@ -198,12 +199,9 @@ class account_voucher(osv.osv):
|
|||
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'audit': fields.related('move_id','to_check', type='boolean', relation='account.move', string='Audit Complete ?'),
|
||||
'pay_now':fields.selection([
|
||||
('pay_now','Pay Now'),
|
||||
('pay_later','Pay Later'),
|
||||
('pay_now','Pay Directly'),
|
||||
('pay_later','Pay Later or Group Funds'),
|
||||
],'Payment', select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'pay_journal_id':fields.many2one('account.journal', 'Payment Journal', readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','in',['bank','cash'])]),
|
||||
'pay_account_id':fields.many2one('account.account', 'Payment Account', readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]),
|
||||
'pay_amount':fields.float('Payment Amount', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'tax_id':fields.many2one('account.tax', 'Tax', required=False),
|
||||
}
|
||||
|
||||
|
@ -213,7 +211,7 @@ class account_voucher(osv.osv):
|
|||
'journal_id':_get_journal,
|
||||
'currency_id': _get_currency,
|
||||
'state': lambda *a: 'draft',
|
||||
'pay_now':lambda *a: 'pay_now',
|
||||
'pay_now':lambda *a: 'pay_later',
|
||||
'name': lambda *a: '/',
|
||||
'date' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'reference_type': lambda *a: "none",
|
||||
|
@ -771,7 +769,7 @@ class account_voucher_line(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'voucher_id':fields.many2one('account.voucher', 'Voucher'),
|
||||
'name':fields.related('voucher_id', 'name', size=256, type='char', string='Memo'),
|
||||
'name':fields.related('voucher_id', 'name', size=256, type='char', string='Description'),
|
||||
'account_id':fields.many2one('account.account','Account', required=True, domain=[('type','<>','view')]),
|
||||
'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'),
|
||||
'amount':fields.float('Amount'),
|
||||
|
@ -780,6 +778,11 @@ class account_voucher_line(osv.osv):
|
|||
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
|
||||
'is_tax':fields.boolean('Tax ?', required=False),
|
||||
'stype':fields.selection([('service','Service'),('other','Other')], 'Product Type'),
|
||||
'move_line_id': fields.many2one('account.move.line', 'Journal Item'),
|
||||
'date_original': fields.date('Date', readonly="1"), #fields.related account.move.line
|
||||
'date_due': fields.date('Due Date', readonly="1"), #fields.related account.move.line
|
||||
'amount_original': fields.float('Originial Amount', readonly="1"), #fields.related account.move.line
|
||||
'amount_unreconciled': fields.float('Open Balance', readonly="1"), #fields.related account.move.line
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *a: 'cr'
|
||||
|
|
|
@ -77,36 +77,51 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Sales Payment">
|
||||
<group col="6" colspan="4">
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type)"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type)" string="Customer"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
widget="selection" select="1"
|
||||
on_change="onchange_journal(journal_id,type)"
|
||||
string="Payment Method"/>
|
||||
|
||||
<field name="amount" readonly="0"/>
|
||||
<field name="reference" select="1" string="Payment Ref"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="journal_id" domain="[('type','in',['bank', 'cash'])]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
|
||||
<field name="account_id" domain="[('type','=','other')]" widget="selection" on_change="onchange_account(account_id)" readonly="1"/>
|
||||
<field name="number"/>
|
||||
<field name="period_id" invisible="1"/>
|
||||
<field name="account_id"
|
||||
domain="[('type','=','other')]"
|
||||
widget="selection"
|
||||
on_change="onchange_account(account_id)"
|
||||
invisible="1"/>
|
||||
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Payment Information">
|
||||
<field name="payment_ids" colspan="4" nolabel="1" height="180">
|
||||
<tree string="Payment Lines" editable="top">
|
||||
<field name="ref" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
|
||||
<field name="amount"/>
|
||||
<field name="move_line_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="type" on_change="onchange_type(parent.partner_id,type,parent.type, parent.currency_id)"/>
|
||||
<field name="account_analytic_id"/>
|
||||
<field name="date_original"/>
|
||||
<field name="date_due"/>
|
||||
<field name="amount_original"/>
|
||||
<field name="amount_unreconciled" sum="Open Balance"/>
|
||||
<field name="amount" sum="Payment"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="3">
|
||||
<separator string="Narration" colspan="2"/>
|
||||
<separator string="Internal Notes" colspan="2"/>
|
||||
<field name="narration" colspan="2" nolabel="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<separator string="Other Information" colspan="2"/>
|
||||
<field name="reference" select="1"/>
|
||||
<field name="date" select="1" on_change="onchange_date(date)"/>
|
||||
<field name="currency_id" select="1" attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
|
||||
<field name="type" on_change="onchange_journal(journal_id,type)"/>
|
||||
<field name="currency_id" select="1"
|
||||
attrs="{'readonly':[('type','in',['sale', 'purchase'])]}"/>
|
||||
<field name="number"/>
|
||||
<field name="type" on_change="onchange_journal(journal_id,type)" invisible="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Journal Items">
|
||||
<page string="Journal Items" groups="base.group_extended">
|
||||
<group col="6" colspan="4">
|
||||
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="period_id"/>
|
||||
|
|
|
@ -8,22 +8,22 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Sales Receipt">
|
||||
<group col="6" colspan="4">
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type)"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id, type)" string="Customer"/>
|
||||
<field name="journal_id" domain="[('type','=','sale')]" widget="selection" select="1" on_change="onchange_journal(journal_id,type)"/>
|
||||
<field name="account_id" domain="[('type','=','other')]" widget="selection" on_change="onchange_account(account_id)"/>
|
||||
<field name="number"/>
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="date" select="1" on_change="onchange_date(date)"/>
|
||||
<field name="type" on_change="onchange_journal(journal_id,type)" invisible="True"/> <!-- Type is given by menu, not by journal ? -->
|
||||
<field name="period_id" invisible="True"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Sales Information">
|
||||
<field name="payment_ids" colspan="4" nolabel="1" height="180">
|
||||
<tree string="Sales Lines" editable="top">
|
||||
<field name="stype" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
|
||||
<field name="ref" on_change="onchange_partner(parent.partner_id,type,parent.type, parent.currency_id)"/>
|
||||
<field name="amount" />
|
||||
<field name="account_id"/>
|
||||
<field name="type" on_change="onchange_type(parent.partner_id,type,parent.type, parent.currency_id)"/>
|
||||
<field name="account_analytic_id"/>
|
||||
<field name="account_id" widget="selection"/>
|
||||
<field name="name"/>
|
||||
<field name="amount" sum="Total"/>
|
||||
<field name="account_analytic_id" groups="base.group_extended"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="2" colspan="3">
|
||||
|
@ -33,22 +33,24 @@
|
|||
<group col="2" colspan="1">
|
||||
<group col="2" colspan="1">
|
||||
<separator string="Payment Options" colspan="2"/>
|
||||
<field name="pay_now"/>
|
||||
<field name="pay_journal_id" on_change="onchange_pay_journal(pay_journal_id,type)" attrs="{'readonly': [('pay_now','=','pay_later')], 'required': [('pay_now','=','pay_now')]}"/>
|
||||
<field name="pay_account_id" attrs="{'readonly': [('pay_now','=','pay_later')], 'required': [('pay_now','=','pay_now')]}"/>
|
||||
<field name="pay_amount" attrs="{'readonly': [('pay_now','=','pay_later')], 'required': [('pay_now','=','pay_now')]}"/>
|
||||
<field name="pay_now" required="1"/>
|
||||
<field name="account_id"
|
||||
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
|
||||
domain="[('type','in',('other'))]"
|
||||
on_change="onchange_account(account_id)"/>
|
||||
<!-- should select income accounts only. Or use the journal for this ? -->
|
||||
<field name="reference"
|
||||
attrs="{'invisible':[('pay_now','!=','pay_now')]}"
|
||||
/>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<separator string="Other Information" colspan="2"/>
|
||||
<field name="reference" select="1"/>
|
||||
<field name="tax_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="date" select="1" on_change="onchange_date(date)"/>
|
||||
<field name="type" on_change="onchange_journal(journal_id,type)"/>
|
||||
<group col="3" colspan="1">
|
||||
<separator string="Total" colspan="3"/>
|
||||
<field name="tax_id" widget="selection" domain="[('type_tax_use','=','sale')]"/><field name="tax_amount" nolabel="1"/>
|
||||
<label string="" colspan="1"/><field name="amount" string="Total"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Journal Items">
|
||||
<page string="Journal Items" groups="base.group_extended">
|
||||
<group col="6" colspan="4">
|
||||
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="period_id"/>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
<record id="view_vendor_payment_form_inherit" model="ir.ui.view">
|
||||
<field name="name">account.voucher.form.inherit</field>
|
||||
<field name="model">account.voucher</field>
|
||||
|
@ -43,7 +44,7 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
-->
|
||||
<record model="ir.ui.view" id="view_vendor_payment_form_unreconcile">
|
||||
<field name="name">account.voucher.form.payment.unreconcile</field>
|
||||
<field name="model">account.voucher</field>
|
||||
|
|
Loading…
Reference in New Issue