[IMP]:sale_crm:improve code standard

bzr revid: sunilsharma.sharma07@gmail.com-20131017072300-vt3y65394wv5tl8q
This commit is contained in:
Sunil Sharma (OpenERP) 2013-10-17 12:53:00 +05:30
parent e52f18cc9a
commit 09789afc2b
1 changed files with 11 additions and 12 deletions

View File

@ -97,9 +97,9 @@ class TestSaleCrmCase(TestSaleCrm):
#I Write company .
company_id = res_users_obj._get_company(cr, uid, context=False, uid2=False)
in_ref = ir_model_obj.get_object_reference(cr, uid, 'base' , 'INR')
inr_ref = ir_model_obj.get_object_reference(cr, uid, 'base', 'INR')
res_company_obj.write(cr, uid, [company_id], {
'currency_id': in_ref and in_ref[1] or False
'currency_id': inr_ref and inr_ref[1] or False
})
# After Sale or Quotations
@ -111,11 +111,10 @@ class TestSaleCrmCase(TestSaleCrm):
new_rate = res_company_obj.browse(cr, uid, [company_id])[0].currency_id.rate_silent
#Assertion Error
for i in range(0,5):
for month in range(0,5):
# for Quotations
self.assertTrue(round(sale_order_before[1]['monthly_quoted'][i]['value'] * new_rate) == round(sale_order_after[1]['monthly_quoted'][i]['value']), "Currency Conversion For Quotations Is Wrong")
self.assertTrue(round(sale_order_before[1]['monthly_quoted'][month]['value'] * new_rate) == round(sale_order_after[1]['monthly_quoted'][month]['value']), "Currency Conversion For Quotations Is Wrong")
# for sale order
self.assertTrue(round(sale_order_before[1]['monthly_confirmed'][i]['value'] * new_rate) == round(sale_order_after[1]['monthly_confirmed'][i]['value']), "Currency Conversion For Sale Order Is Wrong")
self.assertTrue(round(sale_order_before[1]['monthly_confirmed'][month]['value'] * new_rate) == round(sale_order_after[1]['monthly_confirmed'][month]['value']), "Currency Conversion For Sale Order Is Wrong")
# for Invoice
self.assertTrue(round(invoice_before[1][i]['value'] * new_rate) == round(invoice_after[1][i]['value']), "Currency Conversion For Invoice Is Wrong")
self.assertTrue(round(invoice_before[1][month]['value'] * new_rate) == round(invoice_after[1][month]['value']), "Currency Conversion For Invoice Is Wrong")