From b4462b79d7c11bc16fbd8618695691e6256d78a7 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Wed, 28 Sep 2011 15:19:10 +0900
Subject: [PATCH] Improve Base_getBySiteCurrentStockList and support group
 category.

---
 .../erp5_trade/Base_getBySiteCurrentStockList.xml        | 9 ++++++++-
 bt5/erp5_trade/bt/change_log                             | 3 +++
 bt5/erp5_trade/bt/revision                               | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getBySiteCurrentStockList.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getBySiteCurrentStockList.xml
index d0e9057136..3af1b9905f 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getBySiteCurrentStockList.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Base_getBySiteCurrentStockList.xml
@@ -53,6 +53,13 @@
             <value> <string encoding="cdata"><![CDATA[
 
 site = context.portal_categories.site.restrictedTraverse(site)\n
+if group:\n
+  group = context.portal_categories.group.restrictedTraverse(group)\n
+else:\n
+  group = None\n
+\n
+if group is not None:\n
+  kw[\'stock_section_category_uid\'] = group.getUid()\n
 \n
 def mycmp(line_a, line_b):\n
   """\n
@@ -100,7 +107,7 @@ return result_list\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>at_date=None, site=None, positive_stock=None, negative_stock=None, zero_stock=None, **kw</string> </value>
+            <value> <string>at_date=None, site=None, group=None, positive_stock=None, negative_stock=None, zero_stock=None, **kw</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>
diff --git a/bt5/erp5_trade/bt/change_log b/bt5/erp5_trade/bt/change_log
index 4a20df1d2a..3fcc7e4c60 100644
--- a/bt5/erp5_trade/bt/change_log
+++ b/bt5/erp5_trade/bt/change_log
@@ -1,3 +1,6 @@
+2011-09-28 yusei
+* Improve Base_getBySiteCurrentStockList and support group category.
+
 2011-09-20 tatuya
 * Modify Order_zSelectMovement  to make Packing List enable to represent Transfer of rights(ownership). To do this, remove WHERE expression to exclude simulation movements that have same source and destination.
 
diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision
index 41edc2353d..7c1c0cac5d 100644
--- a/bt5/erp5_trade/bt/revision
+++ b/bt5/erp5_trade/bt/revision
@@ -1 +1 @@
-1141
\ No newline at end of file
+1142
\ No newline at end of file
-- 
2.30.9