Merge "Round the quantity for storage product"

This commit is contained in:
Jenkins 2017-08-10 01:04:47 +00:00 committed by Gerrit Code Review
commit cfdf8d0c19
3 changed files with 4 additions and 3 deletions

View File

@ -50,3 +50,4 @@ states = {'active': 1,
RATE_DIGITS = 6
PRICE_DIGITS = 2
QUANTITY_DIGITS = 3

View File

@ -210,7 +210,7 @@ class OdooDriver(driver.BaseDriver):
for line in invoice_lines:
line_info = {
'resource_name': line['name'],
'quantity': line['quantity'],
'quantity': round(line['quantity'], constants.QUANTITY_DIGITS),
'rate': round(line['price_unit'], constants.RATE_DIGITS),
'unit': line['uos_id'][1],
'cost': round(line['price_subtotal'], constants.PRICE_DIGITS)

View File

@ -136,7 +136,7 @@ class TestOdooDriver(base.DistilTestCase):
[
{
'name': 'resource3',
'quantity': 3,
'quantity': 653.2345,
'price_unit': 0.123,
'uos_id': [1, 'Gigabyte-hour(s)'],
'price_subtotal': 0.369,
@ -203,7 +203,7 @@ class TestOdooDriver(base.DistilTestCase):
'NZ-POR-1.c1.c2r8': [
{
"cost": 0.37,
"quantity": 3,
"quantity": 653.235,
"rate": 0.123,
"resource_name": "resource3",
"unit": "Gigabyte-hour(s)"