From 8b3872a7b387309b1a322f38e5dfa76083edda96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Jun 2013 20:33:15 +0200 Subject: [PATCH] Test Autoreconciliation of posted move with just one line of zero issue3208 review867002 --- invoice.py | 2 +- tests/scenario_invoice.rst | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index 9564a2ad59..bdfa717904 100644 --- a/invoice.py +++ b/invoice.py @@ -1335,10 +1335,10 @@ class Invoice(Workflow, ModelSQL, ModelView): for invoice in invoices: invoice.set_number() moves.append(invoice.create_move()) - Move.post(moves) cls.write(invoices, { 'state': 'posted', }) + Move.post(moves) for invoice in invoices: if invoice.type in ('out_invoice', 'out_credit_note'): invoice.print_invoice() diff --git a/tests/scenario_invoice.rst b/tests/scenario_invoice.rst index 92a22616b8..1efe0c8eb0 100644 --- a/tests/scenario_invoice.rst +++ b/tests/scenario_invoice.rst @@ -266,3 +266,14 @@ Credit invoice with refund:: >>> credit_note_tax_code.reload() >>> credit_note_tax_code.sum == Decimal(20) True + +Create empty invoice:: + + >>> invoice = Invoice() + >>> invoice.party = party + >>> invoice.payment_term = payment_term + >>> invoice.save() + >>> Invoice.post([invoice.id], config.context) + >>> invoice.reload() + >>> invoice.state + u'paid'