Commit 3f9fd0be authored by Jean-Paul Smets's avatar Jean-Paul Smets

Use of getParentValue instead of .aq_parent

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12069 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45ffe34c
...@@ -77,7 +77,7 @@ results = []\n ...@@ -77,7 +77,7 @@ results = []\n
countries = context.portal_categories.gap.objectValues()\n countries = context.portal_categories.gap.objectValues()\n
for country in countries : \n for country in countries : \n
for gap in country.objectValues() :\n for gap in country.objectValues() :\n
title = gap.aq_parent.getTitle() + \'/\'+ gap.getTitle()\n title = gap.getParentValue().getTitle() + \'/\'+ gap.getTitle()\n
path = gap.getRelativeUrl()\n path = gap.getRelativeUrl()\n
if not include_gap_in_path : \n if not include_gap_in_path : \n
path = path.replace(\'gap/\', \'\')\n path = path.replace(\'gap/\', \'\')\n
......
...@@ -74,7 +74,7 @@ error_message = \'\'\n ...@@ -74,7 +74,7 @@ error_message = \'\'\n
\n \n
# Balance Transaction.\n # Balance Transaction.\n
transaction = state_change.object\n transaction = state_change.object\n
module = transaction.aq_parent\n module = transaction.getParentValue()\n
\n \n
# Get sections and a currency.\n # Get sections and a currency.\n
source_section = transaction.getSourceSection()\n source_section = transaction.getSourceSection()\n
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return context.getDestinationPayment() or context.aq_parent.getBaobabDestinationPayment()\n <value> <string>return context.getDestinationPayment() or context.getParentValue().getBaobabDestinationPayment()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>return context.getSourcePayment() or context.aq_parent.getBaobabSourcePayment()\n <value> <string>return context.getSourcePayment() or context.getParentValue().getBaobabSourcePayment()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</tr>\n </tr>\n
<tr tal:repeat="item python:here.Base_sortObjectListLikeSQL(here.Person_zGetPersonCareerLog(),((\'start_date\',\'ASC\'),))">\n <tr tal:repeat="item python:here.Base_sortObjectListLikeSQL(here.Person_zGetPersonCareerLog(),((\'start_date\',\'ASC\'),))">\n
<span tal:define="my_assignment python:item.getObject();\n <span tal:define="my_assignment python:item.getObject();\n
my_person python:my_assignment.aq_parent"\n my_person python:my_assignment.getParentValue()"\n
>\n >\n
<td valign="top"><a tal:content="my_person/getTitle" \n <td valign="top"><a tal:content="my_person/getTitle" \n
tal:attributes="href python:\'%s/Person_viewProfile\' % my_person.getRelativeUrl()" /></td>\n tal:attributes="href python:\'%s/Person_viewProfile\' % my_person.getRelativeUrl()" /></td>\n
......
...@@ -79,7 +79,7 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n ...@@ -79,7 +79,7 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n \n
# Get the assignment object and its parent\n # Get the assignment object and its parent\n
assignment_object = state_change.object\n assignment_object = state_change.object\n
person_object = assignment_object.aq_parent\n person_object = assignment_object.getParentValue()\n
\n \n
# Add the current assignment site\n # Add the current assignment site\n
assignment_site_list = [assignment_object.getSite()]\n assignment_site_list = [assignment_object.getSite()]\n
......
...@@ -74,7 +74,7 @@ if state_change.object.acl_users.meta_type == \'Pluggable Auth Service\':\n ...@@ -74,7 +74,7 @@ if state_change.object.acl_users.meta_type == \'Pluggable Auth Service\':\n
\n \n
# Get the assignment object and its parent\n # Get the assignment object and its parent\n
assignment_object = state_change.object\n assignment_object = state_change.object\n
person_object = assignment_object.aq_parent\n person_object = assignment_object.getParentValue()\n
\n \n
# Call the script if available\n # Call the script if available\n
person_security_script = getattr(person_object, \'Person_updateUserSecurityGroup\', None)\n person_security_script = getattr(person_object, \'Person_updateUserSecurityGroup\', None)\n
......
...@@ -74,7 +74,7 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n ...@@ -74,7 +74,7 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n \n
# Get the career object and its parent\n # Get the career object and its parent\n
career_object = state_change.object\n career_object = state_change.object\n
person_object = career_object.aq_parent\n person_object = career_object.getParentValue()\n
\n \n
active_careers = []\n active_careers = []\n
\n \n
......
...@@ -135,7 +135,7 @@ for attachment_id, attachment_type, attachment_data in attachment_list:\n ...@@ -135,7 +135,7 @@ for attachment_id, attachment_type, attachment_data in attachment_list:\n
# result = context.portal_catalog.searchResults(**kw)\n # result = context.portal_catalog.searchResults(**kw)\n
# for object in result:\n # for object in result:\n
# object = object.getObject()\n # object = object.getObject()\n
# parent = object.aq_parent\n # parent = object.getParentValue()\n
# if parent.getPortalType() == \'Person\':\n # if parent.getPortalType() == \'Person\':\n
# organisation = parent.getSubordinationValue()\n # organisation = parent.getSubordinationValue()\n
# if organisation is None:\n # if organisation is None:\n
......
...@@ -98,7 +98,7 @@ for base_category in item_list:\n ...@@ -98,7 +98,7 @@ for base_category in item_list:\n
sub_field_property_dict[\'title\']=basecatobject.getTranslatedTitle()\n sub_field_property_dict[\'title\']=basecatobject.getTranslatedTitle()\n
# we cache this, so that we can apply expensive path processing techniques\n # we cache this, so that we can apply expensive path processing techniques\n
sub_field_property_dict[\'item_list\']=cached_DMSGetItemList(base_category)\n sub_field_property_dict[\'item_list\']=cached_DMSGetItemList(base_category)\n
sub_field_property_dict[\'value\']=context.aq_parent.aq_parent.getProperty(base_category)\n sub_field_property_dict[\'value\']=context.getParentValue().getParentValue().getProperty(base_category)\n
\n \n
sub_field_dict[base_category]=sub_field_property_dict\n sub_field_dict[base_category]=sub_field_property_dict\n
\n \n
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>state_change[\'object\'].aq_inner.aq_parent.assignRoleToSecurityGroup()\n <value> <string>state_change[\'object\'].getParentValue().assignRoleToSecurityGroup()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -409,7 +409,7 @@ if not ignore_yearly_sums:\n ...@@ -409,7 +409,7 @@ if not ignore_yearly_sums:\n
, \'delivery.start_date\' : {\'range\': "minngt", \'query\': (year_start_date, year_stop_date)}\n , \'delivery.start_date\' : {\'range\': "minngt", \'query\': (year_start_date, year_stop_date)}\n
, \'destination_section_uid\': context.getDestinationSectionUid() # Employee\'s UID\n , \'destination_section_uid\': context.getDestinationSectionUid() # Employee\'s UID\n
}\n }\n
accounting_folder = context.aq_parent\n accounting_folder = context.getParentValue()\n
paysheet_transactions = accounting_folder.searchFolder(**search_params)\n paysheet_transactions = accounting_folder.searchFolder(**search_params)\n
\n \n
\n \n
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
if listbox is not None:\n if listbox is not None:\n
cache = context.REQUEST.other.get(\n cache = context.REQUEST.other.get(\n
\'%s/%s/ListBox_getColumnWithDict\' % (\n \'%s/%s/ListBox_getColumnWithDict\' % (\n
listbox.aq_parent.getId(), listbox.getId()), None)\n listbox.getParentValue().getId(), listbox.getId()), None)\n
if cache is not None:\n if cache is not None:\n
return cache\n return cache\n
\n \n
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<tal:block tal:define="listboxline_list python:listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);\n <tal:block tal:define="listboxline_list python:listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);\n
selection_name python:listbox.get_value(\'selection_name\', REQUEST=request);\n selection_name python:listbox.get_value(\'selection_name\', REQUEST=request);\n
editable_columns python:listbox.get_value(\'editable_columns\', REQUEST=request);\n editable_columns python:listbox.get_value(\'editable_columns\', REQUEST=request);\n
editable_fields python:dict([(column[0], getattr(listbox.aq_parent, \'listbox_%s\' % column[0], None)) for column in editable_columns]);\n editable_fields python:dict([(column[0], getattr(listbox.getParentValue(), \'listbox_%s\' % column[0], None)) for column in editable_columns]);\n
selection python:here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n selection python:here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n
is_domain_tree_mode python:selection.domain_tree_mode;\n is_domain_tree_mode python:selection.domain_tree_mode;\n
is_report_tree_mode python:selection.report_tree_mode;" >\n is_report_tree_mode python:selection.report_tree_mode;" >\n
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: len(object.aq_parent.getVariationBaseCategoryList()) != 0</string> </value> <value> <string>python: len(object.getParentValue().getVariationBaseCategoryList()) != 0</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: len(object.aq_parent.getVariationBaseCategoryList()) != 0</string> </value> <value> <string>python: len(object.getParentValue().getVariationBaseCategoryList()) != 0</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python: len(object.aq_parent.getVariationBaseCategoryList()) != 0</string> </value> <value> <string>python: len(object.getParentValue().getVariationBaseCategoryList()) != 0</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -89,7 +89,7 @@ line = []\n ...@@ -89,7 +89,7 @@ line = []\n
column = []\n column = []\n
tab = []\n tab = []\n
\n \n
transformation = context.aq_parent\n transformation = context.getParentValue()\n
\n \n
\n \n
\n \n
...@@ -141,7 +141,7 @@ transformation = context.aq_parent\n ...@@ -141,7 +141,7 @@ transformation = context.aq_parent\n
# base=base,\n # base=base,\n
# current_category=current_category)\n # current_category=current_category)\n
# tab_category_item_list_list.append(tab_category_item_list)\n # tab_category_item_list_list.append(tab_category_item_list)\n
# transformation = self.aq_parent\n # transformation = self.getParentValue()\n
# transformation_category_item_list = transformation.getVariationCategoryItemList(\n # transformation_category_item_list = transformation.getVariationCategoryItemList(\n
# display_id=display_id,\n # display_id=display_id,\n
# base=base,\n # base=base,\n
...@@ -252,7 +252,7 @@ line = []\n ...@@ -252,7 +252,7 @@ line = []\n
column = []\n column = []\n
tab = []\n tab = []\n
\n \n
transformation = context.aq_parent\n transformation = context.getParentValue()\n
\n \n
# Those value are define on property sheet of portal type\n # Those value are define on property sheet of portal type\n
line_base_category = transformation.getVariationBaseCategoryLine()\n line_base_category = transformation.getVariationBaseCategoryLine()\n
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationBaseCategoryItemList()</string> </value> <value> <string>python: here.getParentValue().getVariationBaseCategoryItemList()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -78,7 +78,7 @@ get_variation_base_category_method_dict = {\n ...@@ -78,7 +78,7 @@ get_variation_base_category_method_dict = {\n
}\n }\n
\n \n
cell_range = []\n cell_range = []\n
transformation = context.aq_parent\n transformation = context.getParentValue()\n
\n \n
# Those value are define on property sheet of portal type\n # Those value are define on property sheet of portal type\n
line_base_category = transformation.getVariationBaseCategoryLine()\n line_base_category = transformation.getVariationBaseCategoryLine()\n
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.aq_parent.getVariationCategoryItemList(base_category_list = here.getQVariationBaseCategoryList() )</string> </value> <value> <string>python: here.getParentValue().getVariationCategoryItemList(base_category_list = here.getQVariationBaseCategoryList() )</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -133,7 +133,7 @@ while crumb is not None:\n ...@@ -133,7 +133,7 @@ while crumb is not None:\n
if crumb.getPortalType() == \'Web Site\':\n if crumb.getPortalType() == \'Web Site\':\n
crumb = None # Don\'t go higher than the first Web Site found\n crumb = None # Don\'t go higher than the first Web Site found\n
else:\n else:\n
crumb = crumb.aq_parent\n crumb = crumb.getParentValue()\n
\n \n
crumb_list.reverse()\n crumb_list.reverse()\n
return crumb_list\n return crumb_list\n
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
result = []\n result = []\n
portal_type = context.getPortalType()\n portal_type = context.getPortalType()\n
parent_object = context.aq_parent\n parent_object = context.getParentValue()\n
parent_pt = parent_object.getPortalType()\n parent_pt = parent_object.getPortalType()\n
request = context.REQUEST\n request = context.REQUEST\n
action_dict = request.get(\'actions\', {}) # actions needs to be renamed to action_dict\n action_dict = request.get(\'actions\', {}) # actions needs to be renamed to action_dict\n
......
...@@ -76,7 +76,7 @@ class AmountFilter(MappedValue, Amount): ...@@ -76,7 +76,7 @@ class AmountFilter(MappedValue, Amount):
security.declareProtected(Permissions.AccessContentsInformation, 'update') security.declareProtected(Permissions.AccessContentsInformation, 'update')
def update(self, amount_line): def update(self, amount_line):
context = self.aq_parent.asContext(**amount_line) context = self.getParentValue().asContext(**amount_line)
# Test predicate # Test predicate
if self.test(context): if self.test(context):
# Update amount_line # Update amount_line
......
...@@ -81,7 +81,7 @@ class AppliedRule(XMLObject): ...@@ -81,7 +81,7 @@ class AppliedRule(XMLObject):
if self.isRootAppliedRule(): if self.isRootAppliedRule():
return 1 return 1
else: else:
parent_value = self.aq_parent parent_value = self.getParentValue()
rule = self.getSpecialiseValue() rule = self.getSpecialiseValue()
return rule.test(parent_value) return rule.test(parent_value)
......
...@@ -154,7 +154,7 @@ class AssortedResource(TransformedResource): ...@@ -154,7 +154,7 @@ class AssortedResource(TransformedResource):
""" """
Nice for A Nice for A
""" """
transformation = self.aq_parent transformation = self.getParentValue()
transformation_category_list = transformation.getVariationCategoryList() transformation_category_list = transformation.getVariationCategoryList()
variation_category_list = [] variation_category_list = []
for p in cell_index: for p in cell_index:
...@@ -176,7 +176,7 @@ class AssortedResource(TransformedResource): ...@@ -176,7 +176,7 @@ class AssortedResource(TransformedResource):
""" """
Nice for C Nice for C
""" """
transformation = self.aq_parent transformation = self.getParentValue()
transformation_category_list = transformation.getVariationCategoryList() transformation_category_list = transformation.getVariationCategoryList()
variation_category_list = [] variation_category_list = []
for p in cell_index: for p in cell_index:
...@@ -192,7 +192,7 @@ class AssortedResource(TransformedResource): ...@@ -192,7 +192,7 @@ class AssortedResource(TransformedResource):
Nice for C Nice for C
""" """
#LOG('getAssortmentVariationBaseCategoryList', 0, repr(self)) #LOG('getAssortmentVariationBaseCategoryList', 0, repr(self))
transformation = self.aq_parent transformation = self.getParentValue()
return transformation.getVariationBaseCategoryList() return transformation.getVariationBaseCategoryList()
# XXX Should be moved to somewhere more global, as this is general. # XXX Should be moved to somewhere more global, as this is general.
...@@ -228,7 +228,7 @@ class AssortedResource(TransformedResource): ...@@ -228,7 +228,7 @@ class AssortedResource(TransformedResource):
# Update the range of cells according to the currently selected base categories. # Update the range of cells according to the currently selected base categories.
def _updateCellRange(self, base=1, current_category=None): def _updateCellRange(self, base=1, current_category=None):
transformation = self.aq_parent transformation = self.getParentValue()
kwd = {'base_id': 'quantity'} kwd = {'base_id': 'quantity'}
kw = [] kw = []
base_category_list = self._getSortedBaseCategoryList(self.getQVariationBaseCategoryList()) base_category_list = self._getSortedBaseCategoryList(self.getQVariationBaseCategoryList())
...@@ -282,7 +282,7 @@ class AssortedResource(TransformedResource): ...@@ -282,7 +282,7 @@ class AssortedResource(TransformedResource):
kwd = {} kwd = {}
kwd['base_id'] = 'variation' kwd['base_id'] = 'variation'
kw = [] kw = []
transformation = self.aq_parent transformation = self.getParentValue()
line_id = transformation.getVariationBaseCategoryLine() line_id = transformation.getVariationBaseCategoryLine()
column_id = transformation.getVariationBaseCategoryColumn() column_id = transformation.getVariationBaseCategoryColumn()
line = [[None]] line = [[None]]
...@@ -358,7 +358,7 @@ class AssortedResource(TransformedResource): ...@@ -358,7 +358,7 @@ class AssortedResource(TransformedResource):
base=base, base=base,
current_category=current_category) current_category=current_category)
tab_category_item_list_list.append(tab_category_item_list) tab_category_item_list_list.append(tab_category_item_list)
transformation = self.aq_parent transformation = self.getParentValue()
transformation_category_item_list = transformation.getVariationCategoryItemList( transformation_category_item_list = transformation.getVariationCategoryItemList(
display_id=display_id, display_id=display_id,
base=base, base=base,
...@@ -380,9 +380,9 @@ class AssortedResource(TransformedResource): ...@@ -380,9 +380,9 @@ class AssortedResource(TransformedResource):
security.declareProtected(Permissions.AccessContentsInformation, 'getVLineItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getVLineItemList')
def getVLineItemList(self): def getVLineItemList(self):
base_category = self.aq_parent.getVariationBaseCategoryLine() base_category = self.getParentValue().getVariationBaseCategoryLine()
if base_category in self.getVVariationBaseCategoryList(): if base_category in self.getVVariationBaseCategoryList():
clist = self.aq_parent.getCategoryMembershipList(base_category, base=1) clist = self.getParentValue().getCategoryMembershipList(base_category, base=1)
else: else:
clist = [None] clist = [None]
result = [] result = []
...@@ -392,9 +392,9 @@ class AssortedResource(TransformedResource): ...@@ -392,9 +392,9 @@ class AssortedResource(TransformedResource):
security.declareProtected(Permissions.AccessContentsInformation, 'getVColumnItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getVColumnItemList')
def getVColumnItemList(self): def getVColumnItemList(self):
base_category = self.aq_parent.getVariationBaseCategoryColumn() base_category = self.getParentValue().getVariationBaseCategoryColumn()
if base_category in self.getVVariationBaseCategoryList(): if base_category in self.getVVariationBaseCategoryList():
clist = self.aq_parent.getCategoryMembershipList(base_category, base=1) clist = self.getParentValue().getCategoryMembershipList(base_category, base=1)
else: else:
clist = [None] clist = [None]
result = [] result = []
...@@ -407,7 +407,7 @@ class AssortedResource(TransformedResource): ...@@ -407,7 +407,7 @@ class AssortedResource(TransformedResource):
security.declareProtected(Permissions.AccessContentsInformation, 'getVTabItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getVTabItemList')
def getVTabItemList(self): def getVTabItemList(self):
transformation = self.aq_parent transformation = self.getParentValue()
line_id = transformation.getVariationBaseCategoryLine() line_id = transformation.getVariationBaseCategoryLine()
column_id = transformation.getVariationBaseCategoryColumn() column_id = transformation.getVariationBaseCategoryColumn()
base_category_list = transformation.getVariationBaseCategoryList() base_category_list = transformation.getVariationBaseCategoryList()
...@@ -458,7 +458,7 @@ class AssortedResource(TransformedResource): ...@@ -458,7 +458,7 @@ class AssortedResource(TransformedResource):
""" """
Check the constitency of transformation elements Check the constitency of transformation elements
""" """
transformation = self.aq_parent transformation = self.getParentValue()
transformation_category_list = transformation.getVariationCategoryList() transformation_category_list = transformation.getVariationCategoryList()
error_list = XMLMatrix._checkConsistency(self, fixit=fixit) error_list = XMLMatrix._checkConsistency(self, fixit=fixit)
...@@ -518,7 +518,7 @@ class AssortedResource(TransformedResource): ...@@ -518,7 +518,7 @@ class AssortedResource(TransformedResource):
# First, we set initial values for quantity and variation # First, we set initial values for quantity and variation
# Currently, we only consider discrete variations # Currently, we only consider discrete variations
# Continuous variations will be implemented in a future version of ERP5 # Continuous variations will be implemented in a future version of ERP5
transformation = self.aq_parent transformation = self.getParentValue()
error_list = [] error_list = []
variation = [] variation = []
line_item_list = [] line_item_list = []
......
...@@ -59,7 +59,7 @@ class Capacity(XMLObject): ...@@ -59,7 +59,7 @@ class Capacity(XMLObject):
Overload reindexing in order to forward any modifications of capacity Overload reindexing in order to forward any modifications of capacity
to simulation tool to simulation tool
""" """
self.aq_parent.updateCapacity() self.getParentValue().updateCapacity()
XMLObject.reindexObject(self) XMLObject.reindexObject(self)
...@@ -78,7 +78,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -78,7 +78,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
""" """
Explicitly acquire simulation_state from parent Explicitly acquire simulation_state from parent
""" """
return self.aq_parent.getSimulationState() return self.getParentValue().getSimulationState()
# MatrixBox methods # MatrixBox methods
...@@ -96,7 +96,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -96,7 +96,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
Only account movements which are not associated to a delivery Only account movements which are not associated to a delivery
Whenever delivery is there, delivery has priority Whenever delivery is there, delivery has priority
""" """
return self.aq_parent.aq_parent.isAccountable() return self.getParentValue().getParentValue().isAccountable()
security.declareProtected( Permissions.AccessContentsInformation, 'getProperty' ) security.declareProtected( Permissions.AccessContentsInformation, 'getProperty' )
def getProperty(self, key, d=None): def getProperty(self, key, d=None):
...@@ -114,7 +114,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement): ...@@ -114,7 +114,7 @@ class DeliveryCell(MappedValue, Movement, ImmobilisationMovement):
return getattr(self, key) return getattr(self, key)
else: else:
LOG("Not Found Property %s"%key, -100,"") LOG("Not Found Property %s"%key, -100,"")
return self.aq_parent.getProperty(key) return self.getParentValue().getProperty(key)
#except: #except:
# LOG("WARNING: ERP5", 0, 'Could not access mapped value property %s' % key) # LOG("WARNING: ERP5", 0, 'Could not access mapped value property %s' % key)
# return None # return None
......
...@@ -123,7 +123,7 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated, ...@@ -123,7 +123,7 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
Only account movements which are not associated to a delivery Only account movements which are not associated to a delivery
Whenever delivery is there, delivery has priority Whenever delivery is there, delivery has priority
""" """
return self.aq_parent.isAccountable() and (not self.hasCellContent()) return self.getParentValue().isAccountable() and (not self.hasCellContent())
def _getTotalPrice(self, context, fast=1): def _getTotalPrice(self, context, fast=1):
""" Returns the total price for this line or the cells it contains. """ """ Returns the total price for this line or the cells it contains. """
......
...@@ -128,7 +128,7 @@ class ExternalWebPage(ExternalDocument): ...@@ -128,7 +128,7 @@ class ExternalWebPage(ExternalDocument):
return self return self
else: else:
while 1: while 1:
ob=ob.aq_parent ob=ob.getParentValue()
if ob==self.getPortalObject(): if ob==self.getPortalObject():
return self return self
if hasattr(ob,'urldict') and len(ob.urldict)>0: if hasattr(ob,'urldict') and len(ob.urldict)>0:
......
...@@ -990,7 +990,7 @@ class ImmobilisableItem(XMLObject, Amount): ...@@ -990,7 +990,7 @@ class ImmobilisableItem(XMLObject, Amount):
else: else:
# Delete first rules and re expand if possible # Delete first rules and re expand if possible
for my_applied_rule in my_applied_rule_list[:-1]: for my_applied_rule in my_applied_rule_list[:-1]:
my_applied_rule.aq_parent._delObject(my_applied_rule.getId()) my_applied_rule.getParentValue()._delObject(my_applied_rule.getId())
my_applied_rule = my_applied_rule_list[-1] my_applied_rule = my_applied_rule_list[-1]
# We are now certain we have a single applied rule # We are now certain we have a single applied rule
# It is time to expand it # It is time to expand it
......
...@@ -132,7 +132,7 @@ class Order(Delivery): ...@@ -132,7 +132,7 @@ class Order(Delivery):
Delete related Applied Rule Delete related Applied Rule
""" """
for o in self.getCausalityRelatedValueList(portal_type='Applied Rule'): for o in self.getCausalityRelatedValueList(portal_type='Applied Rule'):
o.aq_parent.activate().deleteContent(o.getId()) o.getParentValue().activate().deleteContent(o.getId())
Delivery.manage_beforeDelete(self, item, container) Delivery.manage_beforeDelete(self, item, container)
########################################################################## ##########################################################################
......
...@@ -159,7 +159,7 @@ class SimulationMovement(Movement): ...@@ -159,7 +159,7 @@ class SimulationMovement(Movement):
if order is not None: if order is not None:
return order.getSimulationState() return order.getSimulationState()
try: try:
parent_state = self.aq_parent.getSimulationState() parent_state = self.getParentValue().getSimulationState()
return parent_to_movement_simulation_state[parent_state] return parent_to_movement_simulation_state[parent_state]
except (KeyError, AttributeError): except (KeyError, AttributeError):
LOG('ERP5 WARNING:',100, 'Could not acquire getSimulationState on %s' LOG('ERP5 WARNING:',100, 'Could not acquire getSimulationState on %s'
...@@ -295,7 +295,7 @@ class SimulationMovement(Movement): ...@@ -295,7 +295,7 @@ class SimulationMovement(Movement):
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'isOrderable') 'isOrderable')
def isOrderable(self): def isOrderable(self):
applied_rule = self.aq_parent applied_rule = self.getParentValue()
rule = applied_rule.getSpecialiseValue() rule = applied_rule.getSpecialiseValue()
if rule is not None: if rule is not None:
return rule.isOrderable(self) return rule.isOrderable(self)
...@@ -306,7 +306,7 @@ class SimulationMovement(Movement): ...@@ -306,7 +306,7 @@ class SimulationMovement(Movement):
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'isDeliverable') 'isDeliverable')
def isDeliverable(self): def isDeliverable(self):
applied_rule = self.aq_parent applied_rule = self.getParentValue()
rule = applied_rule.getSpecialiseValue() rule = applied_rule.getSpecialiseValue()
if rule is not None: if rule is not None:
return rule.isDeliverable(self) return rule.isDeliverable(self)
......
...@@ -100,9 +100,9 @@ class Wiki( Document ): ...@@ -100,9 +100,9 @@ class Wiki( Document ):
} }
def _getTopLevelUrl(self): def _getTopLevelUrl(self):
o = self.aq_parent o = self.getParentValue()
while o.meta_type == 'ERP5 Wiki': while o.meta_type == 'ERP5 Wiki':
o = o.aq_parent o = o.getParentValue()
return o.absolute_url() return o.absolute_url()
def _render_text(self, text): def _render_text(self, text):
......
...@@ -58,4 +58,3 @@ class Predicate(Interface): ...@@ -58,4 +58,3 @@ class Predicate(Interface):
ZSQLCatalog ZSQLCatalog
""" """
pass pass
...@@ -53,11 +53,11 @@ class SplitAndDefer(CopyToTarget): ...@@ -53,11 +53,11 @@ class SplitAndDefer(CopyToTarget):
if movement_quantity > new_movement_quantity: if movement_quantity > new_movement_quantity:
split_index = 0 split_index = 0
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index) new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
while getattr(simulation_movement.aq_parent, new_id, None) is not None: while getattr(simulation_movement.getParentValue(), new_id, None) is not None:
split_index += 1 split_index += 1
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index) new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
# Adopt different dates for defferred movements # Adopt different dates for defferred movements
new_movement = simulation_movement.aq_parent.newContent( new_movement = simulation_movement.getParentValue().newContent(
portal_type="Simulation Movement", portal_type="Simulation Movement",
id=new_id, id=new_id,
efficiency=simulation_movement.getEfficiency(), efficiency=simulation_movement.getEfficiency(),
......
...@@ -46,11 +46,11 @@ class SplitQuantity(CopyToTarget): ...@@ -46,11 +46,11 @@ class SplitQuantity(CopyToTarget):
""" """
split_index = 0 split_index = 0
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index) new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
while getattr(simulation_movement.aq_parent, new_id, None) is not None: while getattr(simulation_movement.getParentValue(), new_id, None) is not None:
split_index += 1 split_index += 1
new_id = "%s_split_%s" % (simulation_movement.getId(), split_index) new_id = "%s_split_%s" % (simulation_movement.getId(), split_index)
# Adopt different dates for defferred movements # Adopt different dates for defferred movements
new_movement = simulation_movement.aq_parent.newContent( new_movement = simulation_movement.getParentValue().newContent(
portal_type = "Simulation Movement", portal_type = "Simulation Movement",
id = new_id, id = new_id,
efficiency = simulation_movement.getEfficiency(), efficiency = simulation_movement.getEfficiency(),
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<value> <string>REQUEST=context.REQUEST\n <value> <string>REQUEST=context.REQUEST\n
\n \n
# Add an object of the same type as self\n # Add an object of the same type as self\n
parent = context.aq_parent\n parent = context.getParentValue()\n
# XXX May be this need to be changed in order to get something else than\n # XXX May be this need to be changed in order to get something else than\n
# the permission "Add portal content"\n # the permission "Add portal content"\n
new_id = parent.generateNewId()\n new_id = parent.generateNewId()\n
......
...@@ -73,7 +73,7 @@ this type cannot be added in the container.\n ...@@ -73,7 +73,7 @@ this type cannot be added in the container.\n
"""\n """\n
N_ = context.getPortalObject().Base_translateString\n N_ = context.getPortalObject().Base_translateString\n
REQUEST=context.REQUEST\n REQUEST=context.REQUEST\n
parent = context.aq_parent\n parent = context.getParentValue()\n
allowed_type_list = parent.getVisibleAllowedContentTypeList()\n allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
\n \n
if not allowed_type_list:\n if not allowed_type_list:\n
......
...@@ -214,7 +214,7 @@ XXX: Folder_filter accesses selection directly\n ...@@ -214,7 +214,7 @@ XXX: Folder_filter accesses selection directly\n
<span class="description" i18n:translate="" i18n:domain="ui">Print</span>\n <span class="description" i18n:translate="" i18n:domain="ui">Print</span>\n
</button>\n </button>\n
<button class="new" type="submit" title="New"\n <button class="new" type="submit" title="New"\n
tal:attributes="name python: hasattr(here.aq_parent, \'getLastId\') and \'Base_createNewDocument:method\' or \'Folder_create:method\'"\n tal:attributes="name python: hasattr(here.getParentValue(), \'getLastId\') and \'Base_createNewDocument:method\' or \'Folder_create:method\'"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">New</span>\n <span class="description" i18n:translate="" i18n:domain="ui">New</span>\n
......
...@@ -1050,8 +1050,8 @@ class TestPropertySheet: ...@@ -1050,8 +1050,8 @@ class TestPropertySheet:
self.assertEquals('copy title', copy.getTitle()) self.assertEquals('copy title', copy.getTitle())
# acquisition context is the same # acquisition context is the same
self.assertEquals(self.getPersonModule(), obj.aq_parent) self.assertEquals(self.getPersonModule(), obj.getParentValue())
self.assertEquals(self.getPersonModule(), copy.aq_parent) self.assertEquals(self.getPersonModule(), copy.getParentValue())
def test_21_ActionCondition(self, quiet=quiet, run=run_all_test): def test_21_ActionCondition(self, quiet=quiet, run=run_all_test):
"""Tests action conditions """Tests action conditions
......
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