[FIX]point_of_sale:domain is applied properly on pos sale report

Steps to reproduce:
-install point_of_sale
-open a session and make a few sales -> closes the session
-go to point of sale > reporting > sales detail
-select a specific start date and end date
=> the start and end date are ignored by the report

Previous behavior:
the start and end date option have no effect on the report

Current behavior:
the domain is taken into account when generating a report

opw-2149216

closes odoo/odoo#41834

X-original-commit: 157e3fe4d4fb47b33211d1e52116284090b3e01a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
jerome hanke (jhk)
2019-12-12 10:38:37 +00:00
parent 3f43ea79c9
commit 7a3316daa6
+3 -3
View File
@@ -739,7 +739,7 @@ class ReportSaleDetails(models.AbstractModel):
domain = [('state', 'in', ['paid','invoiced','done'])]
if (session_ids):
AND([domain, [('session_id', 'in', session_ids)]])
domain = AND([domain, [('session_id', 'in', session_ids.ids)]])
else:
if date_start:
date_start = fields.Datetime.from_string(date_start)
@@ -758,13 +758,13 @@ class ReportSaleDetails(models.AbstractModel):
# stop by default today 23:59:59
date_stop = date_start + timedelta(days=1, seconds=-1)
AND([domain,
domain = AND([domain,
[('date_order', '>=', fields.Datetime.to_string(date_start)),
('date_order', '<=', fields.Datetime.to_string(date_stop))]
])
if config_ids:
AND([domain, [('config_id', 'in', config_ids)]])
domain = AND([domain, [('config_id', 'in', config_ids.ids)]])
orders = self.env['pos.order'].search(domain)