From d14f68fdbda5da14f003ffe0709360ffc51f171f Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Thu, 26 Feb 2009 15:48:20 +0000
Subject: [PATCH] 2009-02-26 fabien * update PaySheetTransaction_view and
 PaySheetModel_view to display payment_condition_payment_date only if cutom
 payment_condition_trade_date is selected. * fix typo

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25731 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../my_payment_condition_payment_date.xml     | 30 ++++++++++++++++++-
 ...eetTransaction_getSocialServiceAddress.xml |  8 ++---
 .../my_payment_condition_payment_date.xml     | 30 ++++++++++++++++++-
 bt5/erp5_payroll/bt/change_log                |  3 ++
 bt5/erp5_payroll/bt/revision                  |  2 +-
 5 files changed, 66 insertions(+), 7 deletions(-)

diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModel_view/my_payment_condition_payment_date.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModel_view/my_payment_condition_payment_date.xml
index 587a9ff966..23dc6da06c 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModel_view/my_payment_condition_payment_date.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModel_view/my_payment_condition_payment_date.xml
@@ -12,7 +12,9 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list/>
+              <list>
+                <string>enabled</string>
+              </list>
             </value>
         </item>
         <item>
@@ -53,6 +55,12 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -72,6 +80,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>my_payment_date</string> </value>
@@ -90,4 +102,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: here.getPaymentConditionTradeDate() == \'custom\'</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getSocialServiceAddress.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getSocialServiceAddress.xml
index 0e222761b8..cb4fcd5c1b 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getSocialServiceAddress.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getSocialServiceAddress.xml
@@ -60,10 +60,10 @@
   if the line_number is None, return all the address lines\n
 \'\'\'\n
 \n
-social_insurance_annotationi_line_value = \\\n
+social_insurance_annotation_line_value = \\\n
     context.getSocialInsuranceAnnotationLineValue()\n
-if social_insurance_annotationi_line_value is not None:\n
-  organisation = social_insurance_annotationi_line_value.getSourceValue()\n
+if social_insurance_annotation_line_value is not None:\n
+  organisation = social_insurance_annotation_line_value.getSourceValue()\n
 else:\n
   return \'\'\n
 \n
@@ -121,7 +121,7 @@ else:\n
                             <string>line_number</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>social_insurance_annotationi_line_value</string>
+                            <string>social_insurance_annotation_line_value</string>
                             <string>None</string>
                             <string>organisation</string>
                             <string>street_address</string>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_view/my_payment_condition_payment_date.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_view/my_payment_condition_payment_date.xml
index 587a9ff966..23dc6da06c 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_view/my_payment_condition_payment_date.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_view/my_payment_condition_payment_date.xml
@@ -12,7 +12,9 @@
         <item>
             <key> <string>delegated_list</string> </key>
             <value>
-              <list/>
+              <list>
+                <string>enabled</string>
+              </list>
             </value>
         </item>
         <item>
@@ -53,6 +55,12 @@
             <key> <string>tales</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string></string> </value>
@@ -72,6 +80,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>1</int> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>my_payment_date</string> </value>
@@ -90,4 +102,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: here.getPaymentConditionTradeDate() == \'custom\'</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/bt5/erp5_payroll/bt/change_log b/bt5/erp5_payroll/bt/change_log
index 69950d7914..505e2cd745 100644
--- a/bt5/erp5_payroll/bt/change_log
+++ b/bt5/erp5_payroll/bt/change_log
@@ -1,3 +1,6 @@
+2009-02-26 fabien
+* update PaySheetTransaction_view and PaySheetModel_view to display payment_condition_payment_date only if cutom payment_condition_trade_date is selected.
+
 2009-02-04 fabien
 * when a specialise model is defined on a paysheet, apply it automatically
 * rewrite the apply model script
diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision
index 0a1b63de8b..ac471d3ba0 100644
--- a/bt5/erp5_payroll/bt/revision
+++ b/bt5/erp5_payroll/bt/revision
@@ -1 +1 @@
-353
\ No newline at end of file
+355
\ No newline at end of file
-- 
2.30.9