Add 5 PFWB content types #22019
- pfwb.copminutes - pfwb.copnote - pfwb.informationnote - pfwb.memorandum - pfwb.notice
This commit is contained in:
parent
ec6af89840
commit
f85614073d
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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',)
|
||||
]
|
||||
)
|
Reference in New Issue