Commit 6b4a88e4 authored by Thibaut Deheunynck's avatar Thibaut Deheunynck

thibaut

Modify Form M2_viewAssignmentFastInputDialog.
Change script M0_getFastInputDialogAssignmentList. ( typo issues ).
Modify scripts which retreive and update the assignment list when you modify person and this function on a M2 Form.
And finaly change script modifyOrganisationFromM2 in order to put assignment in the good state (ie: open ) and the good destination value

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22939 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45182763
...@@ -156,7 +156,7 @@ if len(m0_bis_result):\n ...@@ -156,7 +156,7 @@ if len(m0_bis_result):\n
last_name=associateLastName(),\n last_name=associateLastName(),\n
start_date=associateBirthday(),\n start_date=associateBirthday(),\n
default_birthplace_address_city=associateBirthPlace(),\n default_birthplace_address_city=associateBirthPlace(),\n
description=associateAnotherInfo,)\n description=associateAnotherInfo(),)\n
\n \n
\n \n
\n \n
...@@ -194,7 +194,7 @@ if len(m0_bis_result):\n ...@@ -194,7 +194,7 @@ if len(m0_bis_result):\n
last_name=administratorLastName(),\n last_name=administratorLastName(),\n
start_date=administratorBirthday(),\n start_date=administratorBirthday(),\n
default_birthplace_address_city=administratorBirthPlace(),\n default_birthplace_address_city=administratorBirthPlace(),\n
description=administratorAnotherInfo,)\n description=administratorAnotherInfo(),)\n
\n \n
\n \n
#Create Auditors\n #Create Auditors\n
......
...@@ -88,7 +88,7 @@ for line in listbox:\n ...@@ -88,7 +88,7 @@ for line in listbox:\n
item[\'first_name\'] = line[\'first_name\']\n item[\'first_name\'] = line[\'first_name\']\n
item[\'last_name\'] = line[\'last_name\']\n item[\'last_name\'] = line[\'last_name\']\n
item[\'start_date\'] = line[\'start_date\']\n item[\'start_date\'] = line[\'start_date\']\n
item[\'default_birthplace_address_city\']= line[\'default_birthplace_address_city\']\n item[\'default_birthplace_address_city\'] = line[\'default_birthplace_address_city\']\n
item[\'function\'] = line[\'function\']\n item[\'function\'] = line[\'function\']\n
item[\'choice\'] = line[\'choice\']\n item[\'choice\'] = line[\'choice\']\n
item[\'status\'] = line[\'status\']\n item[\'status\'] = line[\'status\']\n
...@@ -114,54 +114,49 @@ for item in items:\n ...@@ -114,54 +114,49 @@ for item in items:\n
first_name=item[\'first_name\'],\n first_name=item[\'first_name\'],\n
last_name =item[\'last_name\'],\n last_name =item[\'last_name\'],\n
start_date=item[\'start_date\'],\n start_date=item[\'start_date\'],\n
default_birthplace_address_city=item[\'default_birthplace_address_city\'])\n default_birthplace_address_city=item[\'default_birthplace_address_city\'],)\n
person_third_party_assgmnt =person_third_party.newContent(portal_type=\'Assignment\',\n person_third_party_assignment = \\\n
person_third_party.newContent(portal_type=\'Assignment\',\n
function=item[\'function\'],\n function=item[\'function\'],\n
destination_form_value=context_obj)\n destination_form_value=context_obj) \n
person_third_party_assgmnt.openSubmit()\n person_third_party_assignment.openSubmit()\n
else:\n else:\n
result_list = portal.portal_catalog(parent_uid=portal.person_module.getUid(),\n person = portal.restrictedTraverse(item[\'choice\'])\n
relative_url=item[\'choice\'])\n assignment = person.newContent(portal_type=\'Assignment\',\n
\n
for object in result_list:\n
assgment = object.newContent(portal_type=\'Assignment\',\n
function=item[\'function\'],\n function=item[\'function\'],\n
destination_form_value=context_obj)\n destination_form_value=context_obj)\n
assgment.openSubmit()\n assignment.openSubmit()\n
elif item[\'status\'] == \'_action_maintain\':\n elif item[\'status\'] == \'_action_maintain\':\n
pass\n pass\n
elif item[\'status\'] == \'_action_modify\':\n elif item[\'status\'] == \'_action_modify\':\n
result_list = [x.getObject() for x in portal.portal_catalog(parent_uid=portal.person_module.getUid(),\n person = portal.restrictedTraverse(item[\'choice\'])\n
relative_url=item[\'choice\'])]\n
corporate_registration_code = context_obj.getCorporateRegistrationCode()\n corporate_registration_code = context_obj.getCorporateRegistrationCode()\n
organisation_list = [x.getObject() for x in portal.portal_catalog(parent_uid=portal.organisation_module.getUid(), \n organisation_list = [organisation.getObject() for organisation in portal.portal_catalog(parent_uid=portal.organisation_module.getUid(), \n
corporate_registration_code=corporate_registration_code)]\n corporate_registration_code=corporate_registration_code)]\n
function_relative_url = \'/\'.join((\'function\', item[\'old_function\']))\n #function_relative_url = \'/\'.join((\'function\', item[\'old_function\']))\n
for org in organisation_list:\n for organisation in organisation_list:\n
for object in result_list:\n # XXX for assignment in assignment_list:\n
destination_uid = context.portal_categories.destination.getUid()\n for assignment in person.contentValues(portal_type=\'Assignment\',\n
asst_list = list(context.portal_catalog(parent_uid=object.getUid(),\n checked_permission=\'View\'):\n
portal_type=\'Assignment\',\n if assignment.getValidationState() ==\'open\' and \\\n
function_relative_url=function_relative_url,\n assignment.getFunction() == item[\'old_function\'] and \\\n
destination_uid=org.getUid()))\n organisation in assignment.getDestinationValueList():\n
for x in asst_list:\n assignment.edit(function=item[\'function\'],\n
x.edit(function=item[\'function\'],\n destination_value=organisation,)\n
destination_form_value=context_obj)\n
elif item[\'status\']==\'_go_action\':\n elif item[\'status\']==\'_go_action\':\n
result_list = portal.portal_catalog(parent_uid=portal.person_module.getUid(),\n person = portal.restrictedTraverse(item[\'choice\'])\n
relative_url=item[\'choice\'])\n
corporate_registration_code = context_obj.getCorporateRegistrationCode()\n corporate_registration_code = context_obj.getCorporateRegistrationCode()\n
organisation_list = [x.getObject() for x in portal.portal_catalog(parent_uid=portal.organisation_module.getUid(), \n organisation_list = [organisation.getObject() for organisation in portal.portal_catalog(parent_uid=portal.organisation_module.getUid(), \n
corporate_registration_code=corporate_registration_code)]\n corporate_registration_code=corporate_registration_code)]\n
for org in organisation_list:\n for organisation in organisation_list:\n
for object in result_list:\n for assignment in person.contentValues(portal_type=\'Assignment\',\n
destination_uid = context.portal_categories.destination.getUid()\n checked_permission=\'View\'):\n
asst_list = list(context.portal_catalog(parent_uid=object.getUid(),\n if assignment.getValidationState() ==\'open\' and \\\n
portal_type=\'Assignment\',\n assignment.getFunction() == item[\'old_function\'] and \\\n
destination_uid=org.getUid()))\n organisation in assignment.getDestinationValueList():\n
for x in asst_list:\n assignment.edit(destination_form_value=context_obj)\n
x.edit(destination_form_value=context_obj)\n assignment.cancel()\n
x.cancel()\n \n
role_type = \'Assignment\' \n role_type = \'Assignment\' \n
if context_obj.getPortalType()==\'M2\':\n if context_obj.getPortalType()==\'M2\':\n
form_id = \'M2_view\'\n form_id = \'M2_view\'\n
...@@ -252,20 +247,14 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n ...@@ -252,20 +247,14 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n
<string>new_items</string> <string>new_items</string>
<string>person_title</string> <string>person_title</string>
<string>person_third_party</string> <string>person_third_party</string>
<string>person_third_party_assgmnt</string> <string>person_third_party_assignment</string>
<string>result_list</string> <string>person</string>
<string>object</string> <string>assignment</string>
<string>assgment</string> <string>corporate_registration_code</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>x</string> <string>organisation</string>
<string>corporate_registration_code</string>
<string>organisation_list</string> <string>organisation_list</string>
<string>function_relative_url</string>
<string>org</string>
<string>destination_uid</string>
<string>list</string>
<string>asst_list</string>
<string>role_type</string> <string>role_type</string>
<string>ignore_layout</string> <string>ignore_layout</string>
<string>editable_mode</string> <string>editable_mode</string>
......
...@@ -96,20 +96,19 @@ ...@@ -96,20 +96,19 @@
<string>listbox_last_name</string> <string>listbox_last_name</string>
<string>listbox_id_card_number</string> <string>listbox_id_card_number</string>
<string>listbox_title</string> <string>listbox_title</string>
<string>listbox_default_birthplace_city</string>
<string>listbox_status</string> <string>listbox_status</string>
<string>listbox_choice</string> <string>listbox_choice</string>
<string>listbox_function</string> <string>listbox_function</string>
<string>listbox_old_function</string> <string>listbox_old_function</string>
<string>listbox_start_date</string>
<string>listbox_default_birthplace_address_city</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
<list> <list/>
<string>listbox_start_date</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -437,21 +437,13 @@ ...@@ -437,21 +437,13 @@
<string>Status</string> <string>Status</string>
</tuple> </tuple>
<tuple> <tuple>
<string>function</string> <string>last_name</string>
<string>New Function</string> <string>Last Name</string>
</tuple>
<tuple>
<string>old_function</string>
<string>Old Function</string>
</tuple> </tuple>
<tuple> <tuple>
<string>first_name</string> <string>first_name</string>
<string>First Name</string> <string>First Name</string>
</tuple> </tuple>
<tuple>
<string>last_name</string>
<string>Last Name</string>
</tuple>
<tuple> <tuple>
<string>start_date</string> <string>start_date</string>
<string>Birthday</string> <string>Birthday</string>
...@@ -460,6 +452,14 @@ ...@@ -460,6 +452,14 @@
<string>default_birthplace_address_city</string> <string>default_birthplace_address_city</string>
<string>Birthplace</string> <string>Birthplace</string>
</tuple> </tuple>
<tuple>
<string>function</string>
<string>New Function</string>
</tuple>
<tuple>
<string>old_function</string>
<string>Old Function</string>
</tuple>
<tuple> <tuple>
<string>id_card_number</string> <string>id_card_number</string>
<string>ID</string> <string>ID</string>
...@@ -550,7 +550,7 @@ ...@@ -550,7 +550,7 @@
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>M0_assignment_selection</string> </value> <value> <string>M2_assignment_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
...@@ -601,7 +601,7 @@ ...@@ -601,7 +601,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>M0_getFastInputDialogAssignmentList</string> </value> <value> <string>M2_getFastInputDialogAssignmentList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>listbox_default_birthplace_city</string> </value> <value> <string>listbox_default_birthplace_address_city</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>listbox_default_birthplace_city</string> </value> <value> <string>listbox_default_birthplace_address_city</string> </value>
</item> </item>
<item> <item>
<key> <string>truncate</string> </key> <key> <string>truncate</string> </key>
......
...@@ -157,7 +157,9 @@ ...@@ -157,7 +157,9 @@
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -303,4 +305,20 @@ ...@@ -303,4 +305,20 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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.Base_getPreferredCategoryChildItemList(here.portal_categories.function, filter_node=1)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -157,7 +157,9 @@ ...@@ -157,7 +157,9 @@
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>required</string> </key> <key> <string>required</string> </key>
...@@ -233,44 +235,7 @@ ...@@ -233,44 +235,7 @@
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<list> <list/>
<tuple>
<string encoding="base64">QWN0aW9ubmFpcmUgZGUgc29jacOpdMOp</string>
<string>corporation/shareholder</string>
</tuple>
<tuple>
<string>PDG</string>
<string>corporation/executive/ceo</string>
</tuple>
<tuple>
<string encoding="base64">R8OpcmFudA==</string>
<string>corporation/executive/manager</string>
</tuple>
<tuple>
<string>Administrateur</string>
<string>corporation/executive/trustee</string>
</tuple>
<tuple>
<string>Personne Morale/GIE/Pr\xc3\xa9sident</string>
<string>gie/president</string>
</tuple>
<tuple>
<string>Personne Morale/GIE/Vice Pr\xc3\xa9sident</string>
<string>gie/vice_president</string>
</tuple>
<tuple>
<string>Personne Morale/GIE/Secretaire G\xc3\xa9n\xc3\xa9ral</string>
<string>gie/secretary_general</string>
</tuple>
<tuple>
<string>Personne Morale/GIE/Tr\xc3\xa9sorier</string>
<string>gie/treasurer</string>
</tuple>
<tuple>
<string>Commissaire au Comptes</string>
<string>accounting/auditor</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -299,4 +264,20 @@ ...@@ -299,4 +264,20 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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.Base_getPreferredCategoryChildItemList(here.portal_categories.function, filter_node=1)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -126,15 +126,26 @@ new_registry_number = request_eform.portal_ids.generateNewId(method=attachLocati ...@@ -126,15 +126,26 @@ new_registry_number = request_eform.portal_ids.generateNewId(method=attachLocati
activity_list=[]\n activity_list=[]\n
organisation_list = [organisation.getObject() for organisation in \\\n organisation_list = [organisation.getObject() for organisation in \\\n
organisation_module.searchFolder(corporate_registration_code=corporate_registration_code)]\n organisation_module.searchFolder(corporate_registration_code=corporate_registration_code)]\n
context.log(organisation_list)\n
for organisation in organisation_list:\n for organisation in organisation_list:\n
if organisation.getActivityFreeText()!= None:\n if organisation.getActivityFreeText()!= None:\n
activity_list = organisation.getActivityFreeText().split(\',\')\n activity_list = organisation.getActivityFreeText().split(\',\')\n
person_module = request_eform.getPortalObject().person_module\n \n
#destination_form_uid = request_eform.portal_categories.destination_form.getUid()\n # Open all assignemnts that are in open_submitted state\n
#person_object_list = [person.getObject() for person in context.portal_catalog(portal_type = \'Assignment\',\n destination_form_uid = context.portal_categories.destination_form.getUid()\n
# destination_form_uid = request_eform.getUid())]\n #assignment_list = [assignment.getObject() for assignment in context.portal_catalog(portal_type=\'Assignment\',\n
#for person_object in person_object_list:\n #validation_state = \'open_submitted\',\n
# person_object.edit(destination_value = organisation)\n #destination_form_uid = request_eform.getUid())]\n
assignment_list = [assignment for assignment in \\\n
organisation.getDestinationRelatedValueList() if \\\n
assignment.getValidationState()==\'open_submitted\']\n
context.log(assignment_list)\n
for assignment in assignment_list:\n
context.log(assignment)\n
assignment.open()\n
assignment.edit(destination_value=organisation,\n
corporate_registration_code=new_registry_number)\n
\n
if request_eform.getMoralPersonCheck():\n if request_eform.getMoralPersonCheck():\n
if request_eform.getCharacteristicsCheck():\n if request_eform.getCharacteristicsCheck():\n
for property, value in caracteristic_property_dict.items():\n for property, value in caracteristic_property_dict.items():\n
...@@ -292,7 +303,11 @@ for m2_bis in m2_bis_list:\n ...@@ -292,7 +303,11 @@ for m2_bis in m2_bis_list:\n
<string>_getiter_</string> <string>_getiter_</string>
<string>organisation</string> <string>organisation</string>
<string>organisation_list</string> <string>organisation_list</string>
<string>context</string>
<string>None</string> <string>None</string>
<string>destination_form_uid</string>
<string>assignment</string>
<string>assignment_list</string>
<string>property</string> <string>property</string>
<string>value</string> <string>value</string>
<string>removed_activity_list</string> <string>removed_activity_list</string>
......
853 858
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment