From d7e360158f9565acd2d3a51f8abb76702de8919c Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 8 Oct 2010 11:43:09 +0530 Subject: [PATCH] [REF] bzr revid: mra@mra-laptop-20101008061309-k8yfv27lvhhrgoc7 --- addons/account_voucher/account_voucher.py | 4 ++-- addons/auction/auction.py | 4 ++-- addons/point_of_sale/pos.py | 12 ++++++------ addons/purchase/purchase.py | 6 +++--- addons/sale/sale.py | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6d3a70dd333..ed0d458337f 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -225,7 +225,7 @@ class account_voucher(osv.osv): if not tax[0].price_include: for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes',[]): - total_tax += tax_line.get('amount') + total_tax += tax_line.get('amount', 0.0) total += total_tax else: line_ids2 = [] @@ -234,7 +234,7 @@ class account_voucher(osv.osv): line_tax = 0.0 for tax_line in tax_pool.compute_all(cr, uid, tax, line.untax_amount or line.amount, 1).get('taxes',[]): - line_tax += tax_line.get('amount') + line_tax += tax_line.get('amount', 0.0) line_total += tax_line.get('price_unit') total_tax += line_tax untax_amount = line.untax_amount or line.amount diff --git a/addons/auction/auction.py b/addons/auction/auction.py index c5d1c0fa89f..870194fa125 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -291,7 +291,7 @@ class auction_lots(osv.osv): taxes += lot.auction_id.buyer_costs tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes'] for t in tax: - result += t['amount'] + result += t.get('amount', 0.0) result += amount elif name == "seller_price": if lot.bord_vnd_id.tax_id: @@ -300,7 +300,7 @@ class auction_lots(osv.osv): taxes += lot.auction_id.seller_costs tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes'] for t in tax: - result += t['amount'] + result += t.get('amount', 0.0) result += amount elif name == "gross_revenue": if lot.auction_id: diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 3132367d8bf..3b5f235251f 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -187,7 +187,7 @@ class pos_order(osv.osv): res[order.id]['amount_tax']) elif line.qty != 0.0: for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']: - val += c['amount'] + val += c.get('amount', 0.0) res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val) return res @@ -351,7 +351,7 @@ class pos_order(osv.osv): def test_order_lines(self, cr, uid, order, context=None): - """ Test order line is created or not for the order " + """ Test order line is created or not for the order " @param name: Names of fields. @return: True """ @@ -552,7 +552,7 @@ class pos_order(osv.osv): """Create a new payment for the order""" - statement_obj= self.pool.get('account.bank.statement') + statement_obj= self.pool.get('account.bank.statement') statementl_obj = self.pool.get('account.bank.statement.line') prod_obj = self.pool.get('product.product') property_obj=self.pool.get('ir.property') @@ -625,7 +625,7 @@ class pos_order(osv.osv): return order_line_id, price def refund(self, cr, uid, ids, context=None): - """Create a copy of order for refund order""" + """Create a copy of order for refund order""" clone_list = [] line_obj = self.pool.get('pos.order.line') diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 51e294200cb..eb1f2a1ace0 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -59,7 +59,7 @@ class purchase_order(osv.osv): for line in order.order_line: val1 += line.price_subtotal for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id.id, order.partner_id)['taxes']: - val += c['amount'] + val += c.get('amount', 0.0) res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val) res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1) res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax'] @@ -150,12 +150,12 @@ class purchase_order(osv.osv): ('wait', 'Waiting'), ('confirmed', 'Waiting Supplier Ack'), ('approved', 'Approved'), - ('except_picking', 'Shipping Exception'), + ('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') ] - + _columns = { 'name': fields.char('Order Reference', size=64, required=True, select=True, help="unique number of the purchase order,computed automatically when the purchase order is created"), 'origin': fields.char('Source Document', size=64, diff --git a/addons/sale/sale.py b/addons/sale/sale.py index ad418a567bc..32e97a14d3c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -75,7 +75,7 @@ class sale_order(osv.osv): context = {} val = 0.0 for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)['taxes']: - val += c['amount'] + val += c.get('amount', 0.0) return val def _amount_all(self, cr, uid, ids, field_name, arg, context=None): @@ -558,7 +558,7 @@ class sale_order(osv.osv): # if order.state == 'invoice_except': self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context) - + return True def action_cancel(self, cr, uid, ids, context=None): @@ -730,7 +730,7 @@ class sale_order(osv.osv): if picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr) - + if order.state == 'shipping_except': val['state'] = 'progress'