[IMP] small improvments

bzr revid: psi@tinyerp.com-20120613065502-r1bez7o8e9rj7kyp
This commit is contained in:
Purnendu Singh (OpenERP)
2012-06-13 12:25:02 +05:30
parent 6850366591
commit 39c1d8241f
2 changed files with 10 additions and 9 deletions
+2 -1
View File
@@ -148,7 +148,8 @@
<field name="arch" type="xml">
<form version="7.0">
<header>
<button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_form_button_hi"/>
<button name="invoice_open" states="draft" string="Validate" class="oe_form_button_hi"/>
<button name="invoice_open" states="proforma2" string="Validate"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid'/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
+8 -8
View File
@@ -335,6 +335,12 @@ class account_voucher(osv.osv):
'payment_rate_currency_id': _get_payment_rate_currency,
}
def create(self, cr, uid, vals, context=None):
voucher = super(account_voucher, self).create(cr, uid, vals, context=context)
if voucher:
self.create_send_note(cr, uid, [voucher], context=context)
return voucher
def compute_tax(self, cr, uid, ids, context=None):
tax_pool = self.pool.get('account.tax')
partner_pool = self.pool.get('res.partner')
@@ -1264,12 +1270,6 @@ class account_voucher(osv.osv):
self.reconcile_send_note(cr, uid, [voucher.id], context=context)
return True
def create(self, cr, uid, vals, context=None):
voucher = super(account_voucher, self).create(cr, uid, vals, context=context)
if voucher:
self.create_send_note(cr, uid, [voucher], context=context)
return voucher
def copy(self, cr, uid, id, default={}, context=None):
default.update({
'state': 'draft',
@@ -1284,7 +1284,7 @@ class account_voucher(osv.osv):
return super(account_voucher, self).copy(cr, uid, id, default, context)
# --------------------------------------
# OpenChatter methods and notifications
# OpenChatter notifications and need_action
# --------------------------------------
def _get_document_type(self, type):
@@ -1294,7 +1294,7 @@ class account_voucher(osv.osv):
'sale': 'Sales Receipt',
'receipt': 'Customer Payment',
}
return type_dict.get(type, 'payment')
return type_dict.get(type, 'Payment')
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):