From 8a262e7d151c4c279b428ae4b37ae84b35a1b5cd Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Wed, 1 Feb 2017 10:24:50 +0100 Subject: [PATCH] Add default invoice state on Invoice Lines This is required for creating invoice lines not linked to any invoice issue6226 review27071002 --- invoice.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/invoice.py b/invoice.py index ca7286c508..aeccc4bda9 100644 --- a/invoice.py +++ b/invoice.py @@ -1654,6 +1654,10 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): def default_type(): return 'line' + @classmethod + def default_invoice_state(cls): + return 'draft' + @fields.depends('invoice', '_parent_invoice.state') def on_change_with_invoice_state(self, name=None): if self.invoice: