From 8dec0808b3e806d2e8e9665b2ddb745e97b8e92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 28 Mar 2009 19:49:20 +0100 Subject: [PATCH] Reset open_date when copying for issue907 --- invoice.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invoice.py b/invoice.py index 0e498e8eb8..0e022623a7 100644 --- a/invoice.py +++ b/invoice.py @@ -38,4 +38,14 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): }, context=context) return res + def copy(self, cursor, user, ids, default=None, context=None): + if default is None: + default = {} + + default = default.copy() + default['open_date'] = False + + return super(Invoice, self).copy(cursor, user, ids, default=default, + context=context) + Invoice()