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