Commit d7cfbcf9 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs_appstore_base: Update predicate of all web section of...

erp5_officejs_appstore_base: Update predicate of all web section of application during review process
parent 930045cf
......@@ -52,14 +52,20 @@ section.edit(
id=version_title,
)
section.setCriterionPropertyList([
'version',
'validation_state',
])
membership_criterion_category_list = ['follow_up/' + software_release.getRelativeUrl()]
def webSectionUpdatePredicate(current_section):
current_section.setCriterionPropertyList([
'version',
'validation_state',
])
current_section.setCriterion('version', version)
current_section.setCriterion('validation_state', 'submitted')
current_section.setMembershipCriterionCategoryList(membership_criterion_category_list)
for child_section in current_section.objectValues(portal_type="Web Section"):
webSectionUpdatePredicate(child_section)
section.setCriterion('version', version)
section.setCriterion('validation_state', 'submitted')
section.setMembershipCriterionCategoryList(['follow_up/' + software_release.getRelativeUrl()])
webSectionUpdatePredicate(section)
# Clone all curent Web Document and share them with the correct Version
web_document_list = portal.portal_catalog(
......
......@@ -20,4 +20,11 @@ web_site = software_product.SoftwareProduct_getRelatedWebSite()
version_web_section = web_site[software_release.getVersion()]
version_web_section.setCriterion('validation_state', 'cancel')
version_web_section.setTitle("Rejected " + version_web_section.getTitle())
def webSectionUpdatePredicate(current_section):
current_section.setCriterion('validation_state', 'cancelled')
for child_section in current_section.objectValues(portal_type="Web Section"):
webSectionUpdatePredicate(child_section)
webSectionUpdatePredicate(version_web_section)
#version_web_section.cancel()
......@@ -26,6 +26,14 @@ version_web_section = web_site[software_release.getVersion()]
version_web_section.setCriterion('validation_state', 'published')
version_web_section.publish()
def webSectionUpdatePredicate(current_section):
current_section.setCriterion('validation_state', 'published')
for child_section in current_section.objectValues(portal_type="Web Section"):
webSectionUpdatePredicate(child_section)
webSectionUpdatePredicate(version_web_section)
web_site.edit(
configuration_latest_version=software_release.getVersion(),
)
......
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