[IMP] point_of_sale: sort report by product name
Instead of undeterministic order on a dictionnary
This commit is contained in:
@@ -817,7 +817,7 @@ class ReportSaleDetails(models.AbstractModel):
|
||||
'payments': payments,
|
||||
'company_name': self.env.user.company_id.name,
|
||||
'taxes': taxes.values(),
|
||||
'products': [{
|
||||
'products': sorted([{
|
||||
'product_id': product.id,
|
||||
'product_name': product.name[:20],
|
||||
'code': product.default_code,
|
||||
@@ -825,7 +825,7 @@ class ReportSaleDetails(models.AbstractModel):
|
||||
'price_unit': price_unit,
|
||||
'discount': discount,
|
||||
'uom': product.uom_id.name
|
||||
} for (product, price_unit, discount), qty in products_sold.items()]
|
||||
} for (product, price_unit, discount), qty in products_sold.items()], key=lambda l: l['product_name'])
|
||||
}
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user