Commit 5d7906f0 authored by Fabien Morin's avatar Fabien Morin

update getCell method to be able to get Cells on effective models

use effective models in PaySheetTransaction.py


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26069 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c406c34
...@@ -80,13 +80,18 @@ class PaySheetModel(TradeCondition, XMLMatrix, Delivery): ...@@ -80,13 +80,18 @@ class PaySheetModel(TradeCondition, XMLMatrix, Delivery):
cell = XMLMatrix.getCell(self, *kw, **kwd) cell = XMLMatrix.getCell(self, *kw, **kwd)
# if cell not found, look on the inherited models # if cell not found, look on the inherited models
if cell is None: if cell is None:
for specialised_model in self.getSpecialiseValueList(): if kwd.has_key('paysheet'):
cell = specialised_model.getCell(*kw, **kwd) model_list = self.getInheritanceEffectiveModelTreeAsList(kwd['paysheet'])
else:
model_list = self.getInheritanceModelTreeAsList()
if self in model_list:
model_list.remove(self)
for specialised_model in model_list:
cell = XMLMatrix.getCell(specialised_model, *kw, **kwd)
if cell is not None: if cell is not None:
return cell return cell
return cell return cell
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getReferenceDict') 'getReferenceDict')
def getReferenceDict(self, portal_type_list, property_list=()): def getReferenceDict(self, portal_type_list, property_list=()):
......
...@@ -246,7 +246,7 @@ class PaySheetTransaction(Invoice): ...@@ -246,7 +246,7 @@ class PaySheetTransaction(Invoice):
''' '''
return the not editable lines as dict return the not editable lines as dict
''' '''
model = paysheet.getSpecialiseValue() model = paysheet.getSpecialiseValue().getEffectiveModel(paysheet)
def sortByIntIndex(a, b): def sortByIntIndex(a, b):
return cmp(a.getIntIndex(), b.getIntIndex()) return cmp(a.getIntIndex(), b.getIntIndex())
...@@ -314,7 +314,7 @@ class PaySheetTransaction(Invoice): ...@@ -314,7 +314,7 @@ class PaySheetTransaction(Invoice):
# current_amount = base_amount_dict[base_amount][share] # current_amount = base_amount_dict[base_amount][share]
base_amount_dict = {} base_amount_dict = {}
model = paysheet.getSpecialiseValue() model = paysheet.getSpecialiseValue().getEffectiveModel(paysheet)
def sortByIntIndex(a, b): def sortByIntIndex(a, b):
return cmp(a.getIntIndex(), b.getIntIndex()) return cmp(a.getIntIndex(), b.getIntIndex())
...@@ -503,7 +503,7 @@ class PaySheetTransaction(Invoice): ...@@ -503,7 +503,7 @@ class PaySheetTransaction(Invoice):
If property_list is provided, only subobjects with at least one of those If property_list is provided, only subobjects with at least one of those
properties is defined will be taken into account properties is defined will be taken into account
''' '''
model = self.getSpecialiseValue() model = self.getSpecialiseValue().getEffectiveModel(self)
model_reference_dict = model.getInheritanceModelReferenceDict( model_reference_dict = model.getInheritanceModelReferenceDict(
portal_type_list=portal_type_list, portal_type_list=portal_type_list,
property_list=property_list) property_list=property_list)
......
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