Commit 2b03093b authored by Fabien Morin's avatar Fabien Morin

set the organisation created on the career_subordination of the representant of the company

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24554 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 626460bf
...@@ -58,22 +58,6 @@ ...@@ -58,22 +58,6 @@
portal = changed_object.getPortalObject()\n portal = changed_object.getPortalObject()\n
organisation_module = portal.getDefaultModule(portal_type=\'Organisation\')\n organisation_module = portal.getDefaultModule(portal_type=\'Organisation\')\n
\n \n
# create the person wich represent the company\n
person_module = portal.getDefaultModule(portal_type=\'Person\')\n
accountant = person_module.newContent(portal_type=\'Person\',\n
title=changed_object.getAccountantName(),\n
default_telephone_text=changed_object.getAccountantTelNumber(),\n
default_fax_text=changed_object.getAccountantFax(),\n
default_email_text=changed_object.getAccountantEmail(),\n
address_street_address=changed_object.getAccountantAddress(),\n
address_city=changed_object.getAccountantCity(),\n
default_address_region=changed_object.getAccountantCountry())\n
if changed_object.getOptionAdministrator():\n
accountant.setFunction(\'entreprise/directeur/pdg/administrateur\')\n
elif changed_object.getOptionManager():\n
accountant.setFunction(\'entreprise/directeur/pdg/gerant\')\n
elif changed_object.getOptionDirector():\n
accountant.setFunction(\'entreprise/directeur/pdg/pdg\')\n
\n \n
result = changed_object.portal_catalog(portal_type=\'Organisation\',\n result = changed_object.portal_catalog(portal_type=\'Organisation\',\n
vat_code=changed_object.getNineaNumber())\n vat_code=changed_object.getNineaNumber())\n
...@@ -94,6 +78,24 @@ if not len(result):\n ...@@ -94,6 +78,24 @@ if not len(result):\n
else:\n else:\n
organisation = result[0].getObject()\n organisation = result[0].getObject()\n
\n \n
# create the person wich represent the company\n
person_module = portal.getDefaultModule(portal_type=\'Person\')\n
accountant = person_module.newContent(portal_type=\'Person\',\n
title=changed_object.getAccountantName(),\n
default_telephone_text=changed_object.getAccountantTelNumber(),\n
default_fax_text=changed_object.getAccountantFax(),\n
default_email_text=changed_object.getAccountantEmail(),\n
address_street_address=changed_object.getAccountantAddress(),\n
address_city=changed_object.getAccountantCity(),\n
default_address_region=changed_object.getAccountantCountry(),\n
career_subordination_value=organisation)\n
if changed_object.getOptionAdministrator():\n
accountant.setFunction(\'entreprise/directeur/pdg/administrateur\')\n
elif changed_object.getOptionManager():\n
accountant.setFunction(\'entreprise/directeur/pdg/gerant\')\n
elif changed_object.getOptionDirector():\n
accountant.setFunction(\'entreprise/directeur/pdg/pdg\')\n
\n
# set the login and password required a manager role, so a script with a \n # set the login and password required a manager role, so a script with a \n
# proxy role is used\n # proxy role is used\n
login = context.generateNewLogin(text=changed_object.getAccountantName())\n login = context.generateNewLogin(text=changed_object.getAccountantName())\n
...@@ -150,11 +152,11 @@ accountant.Person_sendCrendentialsByEMail()\n ...@@ -150,11 +152,11 @@ accountant.Person_sendCrendentialsByEMail()\n
<string>_getattr_</string> <string>_getattr_</string>
<string>portal</string> <string>portal</string>
<string>organisation_module</string> <string>organisation_module</string>
<string>person_module</string>
<string>accountant</string>
<string>result</string> <string>result</string>
<string>len</string> <string>len</string>
<string>organisation</string> <string>organisation</string>
<string>person_module</string>
<string>accountant</string>
<string>context</string> <string>context</string>
<string>login</string> <string>login</string>
<string>password</string> <string>password</string>
......
445 446
\ 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