[Erp5-report] r39149 fx.algrain - in /experimental/bt5/erp5_credential: SkinTemplateItem/po...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 14 15:22:07 CEST 2010


Author: fx.algrain
Date: Thu Oct 14 15:22:07 2010
New Revision: 39149

URL: http://svn.erp5.org?rev=39149&view=rev
Log:
Move set subordination on person from CredentialRequest_setRegisteredInformationToOrganisation to CredentialRequest_setRegisteredInformationToPerson
Why ?
We need to set person's organisation even if we don't set registered information to organisation.
Remove check on "organisation" when set registered information because it's already make.

Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml
    experimental/bt5/erp5_credential/bt/revision

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml?rev=39149&r1=39148&r2=39149&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml [utf8] Thu Oct 14 15:22:07 2010
@@ -50,13 +50,10 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>"""Copy subscription information to related person"""\n
+            <value> <string>"""Copy subscription information to the related organisation"""\n
 \n
 context.Credential_checkConsistency([\'Organisation\'])\n
 organisation = context.getDestinationDecisionValue(portal_type="Organisation")\n
-if not organisation:\n
-  return\n
-person = context.getDestinationDecisionValue(portal_type="Person")\n
 \n
 #Mapping\n
 organisation_mapping = (\n
@@ -71,10 +68,6 @@ organisation_mapping = (\n
 \n
 context.Credential_copyRegistredInformation(organisation, organisation_mapping)\n
 \n
-#Attach the organisation to the person if we have a person\n
-if person:\n
-  person.setDefaultCareerSubordination(organisation.getRelativeUrl())\n
-\n
 #Try to validate\n
 try:\n
   organisation.validate()\n
@@ -125,7 +118,6 @@ except:\n
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>organisation</string>
-                            <string>person</string>
                             <string>organisation_mapping</string>
                           </tuple>
                         </value>

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml?rev=39149&r1=39148&r2=39149&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml [utf8] Thu Oct 14 15:22:07 2010
@@ -114,11 +114,19 @@ try:\n
 except UnsupportedWorkflowMethod:\n
   pass\n
 \n
+#Get the default career\n
+default_career = getattr(person,\'default_career\',None)\n
 \n
+#Set the person subordination if we have a relative organisation on the credential\n
+organisation = context.getDestinationDecisionValue(portal_type="Organisation")\n
+if organisation is not  None:\n
+  default_career.setSubordinationValue(organisation)\n
+\n
+#Try to validate the default career\n
 try:\n
-  default_career = getattr(person,\'default_career\',None)\n
   default_career.start()\n
-except UnsupportedWorkflowMethod, AttributeError:\n
+  default_career.setStartDate(DateTime())\n
+except UnsupportedWorkflowMethod:\n
   pass\n
 </string> </value>
         </item>
@@ -175,7 +183,7 @@ except UnsupportedWorkflowMethod, Attrib
                             <string>default_career</string>
                             <string>DateTime</string>
                             <string>person_mapping</string>
-                            <string>AttributeError</string>
+                            <string>organisation</string>
                           </tuple>
                         </value>
                     </item>

Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=39149&r1=39148&r2=39149&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Thu Oct 14 15:22:07 2010
@@ -1 +1 @@
-305
\ No newline at end of file
+306
\ No newline at end of file




More information about the Erp5-report mailing list