From 8fed138ccb43ec7e762632a7dd99ce9fdb6de5d4 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Thu, 27 May 2010 16:21:13 +0530 Subject: [PATCH] [IMP] account: Refund invoice wizard code improved bzr revid: mra@tinyerp.com-20100527105113-rag5fmw7g4wn2ru1 --- addons/account/wizard/account_invoice_refund.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 3c43a137fae..9396209ccc6 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -18,10 +18,11 @@ # along with this program. If not, see . # ############################################################################## +import time + from osv import fields, osv from tools.translate import _ import netsvc -import time class account_invoice_refund(osv.osv_memory): @@ -30,16 +31,15 @@ class account_invoice_refund(osv.osv_memory): _name = "account.invoice.refund" _description = "Invoice Refund" _columns = { - 'date': fields.date('Operation date', required=False, help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'), - 'period': fields.many2one('account.period', 'Force period', required=False), - 'description': fields.char('Description', size=150, required=True), + 'date': fields.date('Operation date', help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'), + 'period': fields.many2one('account.period', 'Force period'), + 'description': fields.char('Description', size=128, required=True), } - _defaults = { 'date': time.strftime('%Y-%m-%d'), - } + } - def compute_refund(self, cr, uid, ids, mode, context=None): + def compute_refund(self, cr, uid, ids, mode='refund', context=None): """ @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -128,7 +128,7 @@ class account_invoice_refund(osv.osv_memory): writeoff_journal_id=inv.journal_id.id, writeoff_acc_id=inv.account_id.id ) - if mode == 'modify' : + if mode == 'modify': invoice = inv_obj.read(cr, uid, [inv.id], ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id',