-
Notifications
You must be signed in to change notification settings - Fork 0
Urb-3342 #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: urban2.7.x
Are you sure you want to change the base?
Urb-3342 #380
Changes from 4 commits
7e3556b
ee4a287
d9aee8c
9be8031
91be053
369692c
17860f4
ce9806e
f89f2f7
52a017b
ba5586f
eaf7af5
03c0ae9
4dcd518
c56d272
0b95d02
523ee97
351f304
8f85967
ce909cd
2f4d85f
1af1d99
0b9726f
c19c946
5f6a94a
7ed753c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add vocabulary for municipal directives and include a field for location in the schema. | ||
[WBoudabous] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5430,3 +5430,30 @@ msgstr "ans" | |
|
||
msgid "zip_folder_title" | ||
msgstr "Zone d'initiative privilégiée" | ||
|
||
msgid "chapter_1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please run the script to generate po files, which avoids duplicates and indicates the file and line number. |
||
msgstr "Chapitre 1" | ||
|
||
msgid "chapter_2" | ||
msgstr "Chapitre 2" | ||
|
||
msgid "chapter_3" | ||
msgstr "Chapitre 3" | ||
|
||
msgid "chapter_4" | ||
msgstr "Chapitre 4" | ||
|
||
msgid "chapter_5" | ||
msgstr "Chapitre 5" | ||
|
||
msgid "chapter_6" | ||
msgstr "Chapitre 6" | ||
|
||
msgid "chapter_7" | ||
msgstr "Chapitre 7" | ||
|
||
msgid "municipal_directive_folder_title" | ||
msgstr "Directive communale" | ||
|
||
msgid "urban_label_municipalDirective" | ||
msgstr "Directive communale" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
from Products.urban.interfaces import IGenericLicence | ||
from Products.urban.migration.utils import refresh_workflow_permissions | ||
from Products.urban.setuphandlers import createFolderDefaultValues | ||
from Products.urban.setuphandlers import createVocabularyFolder | ||
from imio.schedule.content.object_factories import MacroCreationConditionObject | ||
from imio.schedule.content.object_factories import MacroEndConditionObject | ||
from imio.schedule.content.object_factories import MacroFreezeConditionObject | ||
|
@@ -38,6 +39,7 @@ | |
from zope.component import getUtility | ||
|
||
import logging | ||
from zope.i18n import translate | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please run |
||
|
||
|
||
def rename_patrimony_certificate(context): | ||
|
@@ -481,4 +483,53 @@ def add_new_registry_for_missing_capakey(context): | |
registry.records[key] = registry_record | ||
|
||
logger.info("migration done!") | ||
|
||
|
||
def add_municipal_directive_vocabulary(context): | ||
logger = logging.getLogger("urban: Add municipal directive vocabulary") | ||
logger.info("starting migration steps") | ||
|
||
container = api.portal.get_tool("portal_urban") | ||
vocabulary_name = "municipal_directive" | ||
|
||
municipal_directive_vocabulary_config = [ | ||
|
||
{ | ||
|
||
"id": "chapter_1", | ||
"title": translate(_("chapter_1"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_2", | ||
"title": translate(_("chapter_2"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_3", | ||
"title": translate(_("chapter_3"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_4", | ||
"title": translate(_("chapter_4"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_5", | ||
"title": translate(_("chapter_5"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_6", | ||
"title": translate(_("chapter_6"), context=context.REQUEST) | ||
}, | ||
{ | ||
"id": "chapter_7", | ||
"title": translate(_("chapter_7"), context=context.REQUEST) | ||
} | ||
] | ||
municipal_directive_config = createVocabularyFolder( | ||
container, vocabulary_name, context, "UrbanVocabularyTerm" | ||
) | ||
|
||
createFolderDefaultValues( | ||
municipal_directive_config, | ||
municipal_directive_vocabulary_config, | ||
"UrbanVocabularyTerm" | ||
) | ||
|
||
logger.info("upgrade done!") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -782,5 +782,13 @@ | |
handler=".update_270.add_new_registry_for_missing_capakey" | ||
profile="Products.urban:default" | ||
/> | ||
<gs:upgradeStep | ||
title="Add new vocabulary Municaipal Directive" | ||
|
||
description="" | ||
source="1165" | ||
destination="1166" | ||
handler=".update_270.add_municipal_directive_vocabulary" | ||
profile="Products.urban:default" | ||
/> | ||
|
||
</configure> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<metadata> | ||
<version>1165</version> | ||
<version>1166</version> | ||
<dependencies> | ||
<dependency>profile-Products.urban:preinstall</dependency> | ||
</dependencies> | ||
</metadata> | ||
</metadata> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run black, multiple issues in this