changeset 938e3a6615d2 in modules/sale_point:default
details:
https://hg.tryton.org/modules/sale_point?cmd=changeset&node=938e3a6615d2
description:
Add marketing_campaign module
issue11587
review425381003
diffstat:
sale_reporting.py | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diffs (41 lines):
diff -r 5f61b96fd459 -r 938e3a6615d2 sale_reporting.py
--- a/sale_reporting.py Wed Sep 14 19:27:28 2022 +0200
+++ b/sale_reporting.py Sat Oct 01 15:12:38 2022 +0200
@@ -30,21 +30,27 @@
.join(point, condition=sale.point == point.id)
.select(
(line.id * length + index).as_('id'),
- line.product.as_('product'),
- line.quantity.as_('quantity'),
- line.unit_gross_price.as_('unit_price'),
- Concat('sale.point.sale,', line.sale).as_('order'),
- sale.date.as_('date'),
- sale.company.as_('company'),
- Literal(currency_id).as_('currency'),
- Literal(None).as_('customer'),
- point.storage_location.as_('location'),
- point.address.as_('shipment_address'),
+ *cls._pos_sale_line_columns(line, point, sale, currency_id),
where=sale.state.in_(cls._pos_sale_states())
& (sale.company == company_id),
))
@classmethod
+ def _pos_sale_line_columns(cls, line, point, sale, currency):
+ return [
+ line.product.as_('product'),
+ line.quantity.as_('quantity'),
+ line.unit_gross_price.as_('unit_price'),
+ Concat('sale.point.sale,', line.sale).as_('order'),
+ sale.date.as_('date'),
+ sale.company.as_('company'),
+ Literal(currency).as_('currency'),
+ Literal(None).as_('customer'),
+ point.storage_location.as_('location'),
+ point.address.as_('shipment_address'),
+ ]
+
+ @classmethod
def _lines(cls):
return super()._lines() + [cls._pos_sale_line]