From eb19b34118f04328196c23ed6240b2da097559b0 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnaud.fontaine@nexedi.com>
Date: Tue, 21 May 2013 16:32:24 +0900
Subject: [PATCH] Add resource_reference to InventoryBrain (used by a customer
 but may be useful for others too).

---
 product/ERP5/Extensions/InventoryBrain.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/product/ERP5/Extensions/InventoryBrain.py b/product/ERP5/Extensions/InventoryBrain.py
index ad228dcb7a..fee51d5040 100644
--- a/product/ERP5/Extensions/InventoryBrain.py
+++ b/product/ERP5/Extensions/InventoryBrain.py
@@ -144,6 +144,12 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
       return resource.relative_url
   resource_relative_url = ComputedAttribute(getResourceRelativeUrl, 1)
 
+  def getResourceReference(self):
+    resource = self.getResourceValue()
+    if resource is not None:
+      return resource.getReference()
+  resource_reference = ComputedAttribute(getResourceReference, 1)
+
   def getListItemUrl(self, cname_id, selection_index, selection_name):
     """Returns the URL for column `cname_id`. Used by ListBox
     """
-- 
2.30.9