bzr revid: mra@mra-laptop-20101008061309-k8yfv27lvhhrgoc7
This commit is contained in:
Mustufa Rangwala 2010-10-08 11:43:09 +05:30
parent 0943553c4d
commit d7e360158f
5 changed files with 16 additions and 16 deletions

View File

@ -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

View File

@ -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:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -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')

View File

@ -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,

View File

@ -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'