From 019f88014cc06bbac8fd7efb43b9cf4d5aa344aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 17 Sep 2018 17:44:37 +0200 Subject: [PATCH] Skip line with debit and credit equals to zero in FEC issue7425 review72311002 --- account.py | 1 + tests/scenario_fec.rst | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/account.py b/account.py index acbe4b74b6..783cc532d4 100644 --- a/account.py +++ b/account.py @@ -261,6 +261,7 @@ class AccountFrFEC(Wizard): domain = [ ('move.period.fiscalyear', '=', self.start.fiscalyear.id), ('move.state', '=', 'posted'), + ['OR', ('debit', '!=', 0), ('credit', '!=', 0)], ] if self.start.deferral_period: domain.append(('move.period', '!=', self.start.deferral_period.id)) diff --git a/tests/scenario_fec.rst b/tests/scenario_fec.rst index b19da4cccc..d381595b88 100644 --- a/tests/scenario_fec.rst +++ b/tests/scenario_fec.rst @@ -84,6 +84,8 @@ Create some moves:: >>> move.post_number = '1' >>> move.click('post') +With an empty line:: + >>> move = Move() >>> move.period = period >>> move.journal = journal_revenue @@ -95,6 +97,9 @@ Create some moves:: >>> line.account = receivable >>> line.debit = Decimal(10) >>> line.party = party + >>> line = move.lines.new() + >>> line.account = cash + >>> line.debit = line.credit = Decimal(0) >>> move.post_date = period.start_date >>> move.post_number = '1' >>> move.click('post')