From d48b627ce96f714bc421f71656c3ef077c1b9fdc Mon Sep 17 00:00:00 2001 From: Sergio Morillo Date: Fri, 23 Jun 2017 10:01:47 +0200 Subject: [PATCH] Set SII records to None when copy an invoice --- invoice.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/invoice.py b/invoice.py index 1d5a1ba..8c57058 100644 --- a/invoice.py +++ b/invoice.py @@ -147,3 +147,11 @@ class Invoice: return for field in _SII_INVOICE_KEYS: setattr(self, field, getattr(tax.tax, field)) + + @classmethod + def copy(cls, records, default=None): + if default is None: + default = {} + default = default.copy() + default['sii_records'] = None + return super(Invoice, cls).copy(records, default=default)