From e9e5eef42882638b666c5d17b29d36e73a44d9d6 Mon Sep 17 00:00:00 2001
From: Kevin Deldycke <kevin@nexedi.com>
Date: Mon, 27 Mar 2006 13:49:03 +0000
Subject: [PATCH] Reset reference property on paste to let the workflow set the
 right reference value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6317 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Invoice.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Document/Invoice.py b/product/ERP5/Document/Invoice.py
index 0b9774e2fd..d4dce9bbf0 100644
--- a/product/ERP5/Document/Invoice.py
+++ b/product/ERP5/Document/Invoice.py
@@ -70,7 +70,7 @@ class Invoice(AccountingTransaction):
         'portal_type': self.getPortalObject()\
                           .getPortalInvoiceMovementTypeList() })
       return Delivery.getTotalPrice(self, **kw)
-    
+
     security.declareProtected(
         Permissions.AccessContentsInformation, 'getTotalQuantity')
     def getTotalQuantity(self, **kw):
@@ -87,3 +87,8 @@ class Invoice(AccountingTransaction):
       raise NotImplemented
       return self.Invoice_zGetTotalNetPrice()
 
+    def manage_afterClone(self, item):
+      # Reset reference on paste
+      if self.getReference != None:
+        self.setReference(None)
+      AccountingTransaction.manage_afterClone(self, item)
-- 
2.30.9