Round the quantity for storage product
Change-Id: I2ac1c9c8999c63085aa032e5d52c7ef99f679bf6
This commit is contained in:
parent
8219bdbe6c
commit
b10b6d5260
|
@ -50,3 +50,4 @@ states = {'active': 1,
|
|||
|
||||
RATE_DIGITS = 6
|
||||
PRICE_DIGITS = 2
|
||||
QUANTITY_DIGITS = 3
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)"
|
||||
|
|
Loading…
Reference in New Issue