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')