From d651fcb029c181a57181cc69028bf6fae4fbc222 Mon Sep 17 00:00:00 2001 From: Sebastien Marie Date: Sun, 19 Apr 2020 11:32:37 +0200 Subject: [PATCH] Use line date instead of post_date when creating an analytic line from rule issue9230 review305271002 --- CHANGELOG | 2 ++ line.py | 2 +- tests/scenario_analytic_account.rst | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index bbc0c8deb1..3345b665ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Use move line date by default when created by rule engine + Version 5.4.0 - 2019-11-04 * Bug fixes (see mercurial logs for details) diff --git a/line.py b/line.py index 37ace8fbc8..d3e1d18725 100644 --- a/line.py +++ b/line.py @@ -236,7 +236,7 @@ class MoveLine(ModelSQL, ModelView): analytic_lines = [] for entry in rule.analytic_accounts: analytic_lines.extend( - entry.get_analytic_lines(line, line.move.post_date)) + entry.get_analytic_lines(line, line.date)) line.analytic_lines = analytic_lines @classmethod diff --git a/tests/scenario_analytic_account.rst b/tests/scenario_analytic_account.rst index 6d1c84bef5..f162bece00 100644 --- a/tests/scenario_analytic_account.rst +++ b/tests/scenario_analytic_account.rst @@ -138,3 +138,5 @@ Check analytic lines are created on posting:: True >>> analytic_line.credit Decimal('73') + >>> analytic_line.date == analytic_line.move_line.date + True