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