Add 5 PFWB content types #22019

- pfwb.copminutes
- pfwb.copnote
- pfwb.informationnote
- pfwb.memorandum
- pfwb.notice
This commit is contained in:
Nicolas Demonte 2019-12-09 14:05:31 +01:00
parent ec6af89840
commit f85614073d
4 changed files with 48 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<metadata>
<version>5</version>
<version>6</version>
<dependencies>
<dependency>profile-collective.dms.basecontent:default</dependency>
<dependency>profile-collective.dms.batchimport:default</dependency>

View File

@ -65,5 +65,20 @@
<type type_id="pfwb.invoice">
<bound-workflow workflow_id="incomingmail_workflow"/>
</type>
<type type_id="pfwb.memorandum">
<bound-workflow workflow_id="outgoingmail_workflow"/>
</type>
<type type_id="pfwb.notice">
<bound-workflow workflow_id="outgoingmail_workflow"/>
</type>
<type type_id="pfwb.informationnote">
<bound-workflow workflow_id="outgoingmail_workflow"/>
</type>
<type type_id="pfwb.copnote">
<bound-workflow workflow_id="outgoingmail_workflow"/>
</type>
<type type_id="pfwb.copminutes">
<bound-workflow workflow_id="outgoingmail_workflow"/>
</type>
</bindings>
</object>

View File

@ -54,4 +54,13 @@
</genericsetup:upgradeSteps>
<genericsetup:upgradeStep
title="Refresh addable types in Documents folder"
description=""
source="5"
destination="6"
profile="pfwbged.policy:default"
handler=".types.refresh_documents_addable_types"
/>
</configure>

View File

@ -0,0 +1,23 @@
from Products.CMFCore.utils import getToolByName
from pfwbged.policy.setuphandlers import setup_constrains
from plone import api
def refresh_documents_addable_types(context):
context.runImportStepFromProfile('profile-pfwbged.basecontent:default',
'typeinfo')
context.runImportStepFromProfile('profile-pfwbged.folder:default',
'typeinfo')
context.runImportStepFromProfile('profile-pfwbged.policy:default',
'workflow')
portal = api.portal.get()
types_tool = getToolByName(portal, 'portal_types')
fti = types_tool.getTypeInfo('pfwbgedfolder')
setup_constrains(
portal['documents'],
[
x for x in fti.allowed_content_types
if x not in ('pfwbgedfolder', 'pfwbgedlink',)
]
)