From 0e2c476e07eb6eecb98a62677e57dac753138324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Tue, 16 Dec 2014 14:48:14 +0100 Subject: [PATCH] Skip posted moved/invoices in post issue4283 review13661002 --- invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invoice.py b/invoice.py index b0253c3580..767f77869e 100644 --- a/invoice.py +++ b/invoice.py @@ -1334,10 +1334,10 @@ class Invoice(Workflow, ModelSQL, ModelView): for invoice in invoices: invoice.set_number() moves.append(invoice.create_move()) - cls.write(invoices, { + cls.write([i for i in invoices if i.state != 'posted'], { 'state': 'posted', }) - Move.post(moves) + Move.post([m for m in moves if m.state != 'posted']) for invoice in invoices: if invoice.type in ('out_invoice', 'out_credit_note'): invoice.print_invoice()