account_voucher : Respective Invoice only displayed when paying via voucher from invoice payment
bzr revid: jvo@tinyerp.com-20110506143706-ivfrvvspxwbke402
This commit is contained in:
@@ -460,7 +460,10 @@ class account_voucher(osv.osv):
|
||||
account_type = 'receivable'
|
||||
|
||||
if not context.get('move_line_ids', False):
|
||||
ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
|
||||
domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)]
|
||||
if context.get('invoice_id', False):
|
||||
domain.append(('invoice', '=', context['invoice_id']))
|
||||
ids = move_line_pool.search(cr, uid, domain, context=context)
|
||||
else:
|
||||
ids = context['move_line_ids']
|
||||
ids.reverse()
|
||||
@@ -495,7 +498,6 @@ class account_voucher(osv.osv):
|
||||
'date_original':line.date,
|
||||
'date_due':line.date_maturity,
|
||||
'amount_unreconciled': amount_unreconciled,
|
||||
|
||||
}
|
||||
|
||||
if line.credit:
|
||||
|
||||
@@ -88,12 +88,12 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bill Payment">
|
||||
<group col="6" colspan="4">
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
|
||||
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id}" string="Supplier"/>
|
||||
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
widget="selection" select="1"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"
|
||||
string="Payment Method"/>
|
||||
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
<field name="reference" select="1" string="Payment Ref"/>
|
||||
@@ -151,12 +151,12 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bill Payment">
|
||||
<group col="6" colspan="4">
|
||||
<field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
|
||||
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
<field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" context="{'invoice_currency':currency_id}" string="Supplier"/>
|
||||
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
widget="selection" select="1"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"
|
||||
string="Payment Method"/>
|
||||
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
<field name="reference" select="1" string="Payment Ref"/>
|
||||
@@ -288,14 +288,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Customer Payment">
|
||||
<group col="6" colspan="4">
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/>
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer"/>
|
||||
<field name="amount"
|
||||
string="Paid Amount"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
widget="selection" select="1"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
|
||||
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"
|
||||
string="Payment Method"/>
|
||||
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
|
||||
<field name="reference" select="1" string="Payment Ref"/>
|
||||
|
||||
Reference in New Issue
Block a user