diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_creation_date.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_start_date.xml similarity index 99% rename from bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_creation_date.xml rename to bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_start_date.xml index 598b7eb13e70cf9529eb2f695389f9d9327ca3ac..56c17d385ba53beb2b3a71a65ccec50abd162fb7 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_creation_date.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_viewDetails/my_start_date.xml @@ -14,7 +14,7 @@ <dictionary> <item> <key> <string>id</string> </key> - <value> <string>my_creation_date</string> </value> + <value> <string>my_start_date</string> </value> </item> <item> <key> <string>message_values</string> </key> diff --git a/product/ERP5/Document/Organisation.py b/product/ERP5/Document/Organisation.py index 78fd2a1111c2dd619f9774a8d330c92fe4a735c8..3301e9a1a96f73f7eed400b54c82fd122ac9f927 100644 --- a/product/ERP5/Document/Organisation.py +++ b/product/ERP5/Document/Organisation.py @@ -66,6 +66,7 @@ class Organisation(MetaNode, XMLObject): , PropertySheet.DublinCore , PropertySheet.Organisation , PropertySheet.Mapping + , PropertySheet.Task ) diff --git a/product/ERP5/Document/Person.py b/product/ERP5/Document/Person.py index 2bcd6e1e0a550ef2ebc83a66250a0e7d07780138..8d393989e7cbc3b2fb8d17729a6d36bb8b628647 100644 --- a/product/ERP5/Document/Person.py +++ b/product/ERP5/Document/Person.py @@ -83,6 +83,7 @@ class Person(Node, XMLObject): , PropertySheet.Reference , PropertySheet.Person , PropertySheet.Mapping + , PropertySheet.Task ) def _setTitle(self, value): diff --git a/product/ERP5/PropertySheet/Organisation.py b/product/ERP5/PropertySheet/Organisation.py index 1f18276909ccae51f4cd43fe859773144a6ba113..6399a0fbcbf81f2321465f5537af787306d4deb2 100644 --- a/product/ERP5/PropertySheet/Organisation.py +++ b/product/ERP5/PropertySheet/Organisation.py @@ -88,10 +88,6 @@ class Organisation: 'description' : 'The social code of this organisation', 'type' : 'string', 'mode' : 'w' }, - { 'id' : 'creation_date', - 'description' : 'The date of the creation of this organisation', - 'type' : 'date', - 'mode' : 'w' }, # (Kev) This property is too banking-centric to appear here as a general organisation property. The following must be renamed to something more abstract like "business_code", "domain_uid", "business_domain_special_organisation_id" or something like that. { 'id' : 'bic_code', 'description' : 'The Bank Identifier Code is a unique code that identifies individual banking and financial institution offices around the world.', diff --git a/product/ERP5/PropertySheet/Person.py b/product/ERP5/PropertySheet/Person.py index 85c22e05e3d5929a696becc4f0a18ed8f5ffadd5..a45687a4a23c4d5756865d5543192c8dbc8a7f21 100644 --- a/product/ERP5/PropertySheet/Person.py +++ b/product/ERP5/PropertySheet/Person.py @@ -74,6 +74,7 @@ class Person: }, { 'id' : 'birthday' , 'description': 'Date of birth.' + , 'storage_id' : 'start_date' , 'type' : 'date' , 'mode' : 'w' }, diff --git a/product/ERP5/tests/testERP5HR.py b/product/ERP5/tests/testERP5HR.py index 7770bca19172bd583ad77f1163e1ccf10390e4bd..da8e603e0c0a7d15752cb7aebe131069daa555d5 100644 --- a/product/ERP5/tests/testERP5HR.py +++ b/product/ERP5/tests/testERP5HR.py @@ -778,6 +778,35 @@ class TestHR(ERP5TypeTestCase): sequence_list.addSequenceString(sequence_string) sequence_list.play(self, quiet=quiet) + def test_05_DatesOnPerson(self, quiet=QUIET, run=RUN_ALL_TEST): + """Tests dates on Person objects. + """ + pers = self.getPersonModule().newContent(portal_type='Person') + birthday = DateTime(1999, 01, 01) + now = DateTime() + pers.edit(birthday = birthday) + self.assertEquals(birthday, pers.getBirthday()) + self.assertEquals(birthday, pers.getStartDate()) + + for slot in ['year', 'month', 'day', 'hour', 'minute']: + self.assertEquals(getattr(now, slot)(), + getattr(pers.getCreationDate(), slot)(), + 'Wrong creation date %s' % pers.getCreationDate()) + + def test_06_DatesOnOrganisation(self, quiet=QUIET, run=RUN_ALL_TEST): + """Tests dates on Organisation objects. + """ + org = self.getOrganisationModule().newContent(portal_type='Organisation') + start_date = DateTime(1999, 01, 01) + now = DateTime() + org.edit(start_date = start_date) + self.assertEquals(start_date, org.getStartDate()) + + for slot in ['year', 'month', 'day', 'hour', 'minute']: + self.assertEquals(getattr(now, slot)(), + getattr(org.getCreationDate(), slot)(), + 'Wrong creation date %s' % org.getCreationDate()) + if __name__ == '__main__': framework() else: