summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2010-05-17 18:47:13 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2010-05-17 18:47:13 +0530
commit3fa1e69ffd6284d0fa32ba68d3d1911cc36d1153 (patch)
tree6e6b4974babbcee8d03922aa23364b0d76570375
parent61373596200257b527bb923ba34cfca82a1d2189 (diff)
[REF]
bzr revid: jvo@tinyerp.com-20100517131713-kh7s2n85elr52xjf
-rw-r--r--addons/account_voucher/voucher.py13
-rw-r--r--addons/analytic_user_function/analytic_user_function.py4
2 files changed, 8 insertions, 9 deletions
diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py
index 7e1f7f35cdb..140442aa02e 100644
--- a/addons/account_voucher/voucher.py
+++ b/addons/account_voucher/voucher.py
@@ -167,15 +167,14 @@ class account_voucher(osv.osv):
return {'value':{'account_id':account_id.id}}
def open_voucher(self, cr, uid, ids, context={}):
- obj=self.pool.get('account.voucher').browse(cr,uid,ids)
- total=0
+ obj = self.pool.get('account.voucher').browse(cr,uid,ids)
+ total = 0
for i in obj[0].payment_ids:
- total+=i.amount
- if total!=0:
- self.write(cr,uid,ids,{'amount':total})
- self.write(cr, uid, ids, {'state':'proforma'})
+ total += i.amount
+ if total != 0:
+ self.write(cr, uid, ids, {'amount':total, 'state':'proforma'})
else:
- raise osv.except_osv('Invalid action !', 'You can not post to Pro-Forma a voucher with Total amount = 0')
+ raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !')
return True
def proforma_voucher(self, cr, uid, ids, context={}):
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py
index c5c2af729a0..fe238d373be 100644
--- a/addons/analytic_user_function/analytic_user_function.py
+++ b/addons/analytic_user_function/analytic_user_function.py
@@ -100,7 +100,7 @@ class hr_analytic_timesheet(osv.osv):
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
- amount_unit=self.on_change_unit_amount(cr, uid, ids,
+ amount_unit = self.on_change_unit_amount(cr, uid, ids,
r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit
@@ -136,7 +136,7 @@ class hr_analytic_timesheet(osv.osv):
'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,))
# Compute based on pricetype
- amount_unit=self.on_change_unit_amount(cr, uid, ids,
+ amount_unit = self.on_change_unit_amount(cr, uid, ids,
r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount']
amount = unit_amount * amount_unit