[IMP] Account_voucher: When we pay a bill on a Supplier Voucher, the Total must be proposed automatically, according to the voucher total
From supplier voucher, click on pay bill. When you cancel or validate the payment, the window (popup) should close automatically. Do the same for customers invoices. This is very important for useability. bzr revid: mra@mra-laptop-20101206115027-rdrf2cdjemkvrwvx
This commit is contained in:
parent
17070c5387
commit
8b9b7727e8
|
@ -109,6 +109,11 @@ class account_voucher(osv.osv):
|
|||
def _get_narration(self, cr, uid, context={}):
|
||||
return context.get('narration', False)
|
||||
|
||||
def _get_amount(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context= {}
|
||||
return context.get('amount', 0.0)
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
if not ids:
|
||||
return []
|
||||
|
@ -221,6 +226,7 @@ class account_voucher(osv.osv):
|
|||
'currency_id': _get_currency,
|
||||
'reference': _get_reference,
|
||||
'narration':_get_narration,
|
||||
'amount': _get_amount,
|
||||
'type':_get_type,
|
||||
'state': 'draft',
|
||||
'pay_now': 'pay_later',
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
|
||||
<field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="view_id" ref="view_vendor_receipt_form"/>
|
||||
<field name="target">new</field>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_sale_receipt_form">
|
||||
|
@ -154,7 +154,7 @@
|
|||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
|
||||
<group attrs="{'invisible':[('state','!=','posted')]}">
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
</group>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
|
@ -200,7 +200,7 @@
|
|||
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','payment'), ('partner_id','=',partner_id)]</field>
|
||||
<field name="context">{'type':'payment', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="view_id" ref="view_vendor_payment_form"/>
|
||||
<field name="target">new</field>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_purchase_receipt_form">
|
||||
<field name="name">account.voucher.purchase.form</field>
|
||||
|
@ -259,7 +259,7 @@
|
|||
<field name="state"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
|
||||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','!=','pay_now'), ('state','!=','posted')]}"/>
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','!=','pay_now'), ('state','!=','posted')]}"/>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue