Commit d4a9d1c3 authored by Jérome Perrin's avatar Jérome Perrin

configurator: fix some BusinessConfiguration methods

BusinessConfiguration have a resource category, but it's the workflow,
it's not really a resource, so some APIs from the base Amount class are
not available. Because they have no meaning on BusinessConfiguration
anyway, define the broken APIs to return nothing.

This fixes errors trying to use check_consistency alarm on Business
Configurations.
parent ecee13f0
......@@ -574,3 +574,24 @@ class BusinessConfiguration(Item):
if self.portal_workflow.isTransitionPossible(self, 'install'):
self.activate(after_tag=kw["tag"]).install()
# Business Configuration are Item, which inherits from Amount and expect the
# resource category document to be an actual resource, but in the case of
# Business Configuration it is a Workflow.
security.declareProtected(Permissions.AccessContentsInformation, 'getPrice')
def getPrice(self, *args, **kw):
"""Business Configuration have no price
"""
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseUnitPrice')
def getBaseUnitPrice(self, *args, **kw):
"""Business Configuration have no base unit price
"""
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getVariationBaseCategoryList')
def getVariationBaseCategoryList(self, *args, **kw):
"""Business Configuration have no variation base category list
"""
return []
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