From e92d187b4cc46353801d0a1e5d37e1649aca11d0 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Mon, 14 May 2012 16:56:14 +0530 Subject: [PATCH] [IMP] rename pay_type field to advance_payment_method bzr revid: tpa@tinyerp.com-20120514112614-xc6dk5irsbmvr9ml --- addons/sale/wizard/sale_make_invoice_advance.py | 12 ++++++------ addons/sale/wizard/sale_make_invoice_advance.xml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 46e8cdfeac4..c1f05a9e6f2 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -39,20 +39,20 @@ class sale_advance_payment_inv(osv.osv_memory): help="Select a product of type service which is called 'Advance Product'. You may have to create it and set it as a default value on this field."), 'amount': fields.float('Advance Amount', digits=(16, 2), required=True, help="The amount to be invoiced in advance."), 'qtty': fields.float('Quantity', digits=(16, 2), required=True), - 'pay_type':fields.selection([('percentage','Percentage'), ('fixed','Fixed Price')], 'Pay Type', required=True), + 'advance_payment_method':fields.selection([('percentage','Percentage'), ('fixed','Fixed Price')], 'Pay Type', required=True), 'advance': fields.boolean('Advance'), } _defaults = { 'qtty': 1.0, - 'pay_type': 'fixed', + 'advance_payment_method': 'fixed', 'product_id': _default_product_id, } - def onchange_pay_type(self, cr, uid, ids, pay_type,product_id, context=None): + def onchange_advance_payment_method(self, cr, uid, ids, advance_payment_method,product_id, context=None): if not product_id: return {'value': {'amount': 0}} - if pay_type == 'percentage': + if advance_payment_method == 'percentage': return {'value': {'amount':0,'product_id':False }} product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) return {'value': {'amount':product.list_price}} @@ -126,7 +126,7 @@ class sale_advance_payment_inv(osv.osv_memory): raise osv.except_osv(_('Data Insufficient !'), _('Please check the Advance Amount, it should not be 0 or less!')) else: - if sale_adv_obj.pay_type == 'percentage': + if sale_adv_obj.advance_payment_method == 'percentage': final_amount = sale.amount_total * sale_adv_obj.amount / 100 if not res.get('name'): res['name'] = "Advance of %s"%(final_amount) @@ -182,7 +182,7 @@ class sale_advance_payment_inv(osv.osv_memory): if sale.order_policy == 'picking': vals = { 'order_id': sale.id, - 'name': res.get('name') or ("%s %s %s "%(sale_adv_obj.amount,sale_adv_obj.pay_type,"Advance.")), + 'name': res.get('name') or ("%s %s %s "%(sale_adv_obj.amount,sale_adv_obj.advance_payment_method,"Advance.")), 'price_unit': -final_amount, 'product_uom_qty': sale_adv_obj.qtty or 1.0, 'product_uos_qty': sale_adv_obj.qtty or 1.0, diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml index 0c3bb031b3b..01742712668 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.xml +++ b/addons/sale/wizard/sale_make_invoice_advance.xml @@ -8,13 +8,13 @@
- + - +