fix: Se actualiza a 6.8

This commit is contained in:
2023-12-10 19:42:38 -05:00
parent 6c3052902d
commit 741d8f4ad3
2 changed files with 29 additions and 32 deletions

14
sale.py
View File

@@ -90,7 +90,7 @@ class Sale(metaclass=PoolMeta):
else:
untaxed_amount[sale.id] = round(sum(
(line.amount for line in sale.lines
if line.type == 'line'), Decimal(0)),2)
if line.type == 'line'), Decimal(0)), 2)
total_discount[sale.id] = round(sum(
(line.discount_amount for line in sale.lines
if line.type == 'line'), Decimal(0)), 2)
@@ -104,7 +104,7 @@ class Sale(metaclass=PoolMeta):
'tax_amount': tax_amount,
'total_amount': total_amount,
'total_discount': total_discount,
}
}
for key in list(result.keys()):
if key not in names:
del result[key]
@@ -166,11 +166,11 @@ class Sale(metaclass=PoolMeta):
"quantity": line.quantity if line.type != 'title' else None,
"uom": line.unit.symbol if line.type != 'title' else None,
"unit_price": str(line.amount_w_tax) if line.type != 'title' else None,
"taxes": str(round(line.taxes[0].rate * 100, 2))+'%'
"taxes": str(round(line.taxes[0].rate * 100, 2)) + '%'
if line.type != 'title' and line.taxes else None
} for line in record.lines]
} for line in record.lines]
data["total_discount"] = str(round(record.total_discount,2))
data["total_discount"] = str(round(record.total_discount, 2))
data["untaxed_amount"] = str(record.untaxed_amount)
data["tax_amount"] = str(record.tax_amount)
data["total"] = str(record.total_amount)
@@ -209,7 +209,7 @@ class Sale(metaclass=PoolMeta):
"description": line.description if line.type != 'title' else None,
"quantity": line.quantity if line.type != 'title' else None,
"uom": line.unit.name if line.type != 'title' else None}
for line in report.lines if not line.impreso]
for line in report.lines if not line.impreso]
return data
@@ -345,7 +345,7 @@ class Line(metaclass=PoolMeta):
else:
self.bought_pizza = False
def get_production(self, product_quantities ):
def get_production(self, product_quantities):
"Return production for the sale line"
Production = super(Line, self).get_production(product_quantities)