diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
index 481402ee3f909a48d44f3163c62c7939af47e43a..d958e4f52b5842e3862a4255979339e137446f06 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view.xml
@@ -109,6 +109,8 @@
                         <string>my_quantity</string>
                         <string>my_efficiency</string>
                         <string>my_target_level</string>
+                        <string>my_calculation_script_id</string>
+                        <string>my_create_line</string>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_calculation_script_id.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_calculation_script_id.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0c844b0d43d1ddabaf091020d92acf165417ab88
--- /dev/null
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_calculation_script_id.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>description</string>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_calculation_script_id</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string>This script is used for customization to handle complex requirements.</string> </value>
+                </item>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_string_field</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Custom Calculation Script</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_create_line.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_create_line.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b123b01ec5bdc80554ebc1a604e716840181261d
--- /dev/null
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_create_line.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list>
+                <string>default</string>
+                <string>description</string>
+                <string>title</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>my_create_line</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string>Useful for intermediated lines.</string> </value>
+                </item>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>my_checkbox</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Create Line</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>here/isCreateLine</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_quantity.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_quantity.xml
index 3be0984ad8c3a795673c990d5bbc6bac4ff3fbcb..229c1136cb4debbc38871279d9a20911de61b063 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_quantity.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_quantity.xml
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>default</string>
                 <string>description</string>
                 <string>title</string>
               </list>
@@ -56,6 +57,16 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -68,6 +79,10 @@
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -75,6 +90,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>default</string> </key>
+                    <value> <string></string> </value>
+                </item>
                 <item>
                     <key> <string>description</string> </key>
                     <value> <string>Trade Model Line with a Fixed Quantity. If this is set, Ratio is ignored.</string> </value>
@@ -101,4 +120,20 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python:test(here.getQuantity(None) is None, \'\', here.getQuantity())</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_resource_title.xml b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_resource_title.xml
index 75ba65ac71dd8aab5b150668ecd7b1114f016fd7..0d342e21840314e8bab458957110777c688aa85b 100644
--- a/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_resource_title.xml
+++ b/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/TradeModelLine_view/my_resource_title.xml
@@ -13,8 +13,8 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
-                <string>title</string>
                 <string>portal_type</string>
+                <string>title</string>
               </list>
             </value>
         </item>
@@ -91,6 +91,10 @@
                           <string>Service</string>
                           <string>Service</string>
                         </tuple>
+                        <tuple>
+                          <string>Product</string>
+                          <string>Product</string>
+                        </tuple>
                       </list>
                     </value>
                 </item>
diff --git a/bt5/erp5_trade/bt/change_log b/bt5/erp5_trade/bt/change_log
index d20a85aa9eea39055f548dbcf7e782b469f2eba2..46aca2f3001e1acc3156c2a63519a3d7b2ba4d6f 100644
--- a/bt5/erp5_trade/bt/change_log
+++ b/bt5/erp5_trade/bt/change_log
@@ -1,3 +1,8 @@
+2009-12-1 yusei
+* Add calculation script field and create line field to trade model line view.
+* Modify quantity field on trade model line view to display floating number only if quantity property has value and is not set to None.
+* Modify resource field on trade model line and allow users to choose Product document.
+
 2009-11-26 yusei
 * Add target level field to trade model line view.
 
diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision
index 35d29653bfef16166d335bd8f1ad49a4973e5fde..4d5b34789eb552e6c76f33313930efd032a52502 100644
--- a/bt5/erp5_trade/bt/revision
+++ b/bt5/erp5_trade/bt/revision
@@ -1 +1 @@
-791
\ No newline at end of file
+793
\ No newline at end of file