Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7e3556b
add municipal directive vocabulary
WBoudabous Jun 16, 2025
ee4a287
add municipalDirective field for location shemata
WBoudabous Jun 17, 2025
d9aee8c
add changelog
WBoudabous Jun 17, 2025
9be8031
rename vocanulary
WBoudabous Jun 17, 2025
91be053
URBBDC-3142: Fix changelog
mpeeters Jun 18, 2025
369692c
Preparing release 2.7.41
mpeeters Jun 18, 2025
17860f4
Back to development: 2.7.42
mpeeters Jun 18, 2025
ce9806e
SUP-36370 Fix registry encoding
jimbiscuit Jun 20, 2025
f89f2f7
Revert "URBBDC-3142 (#379)"
mpeeters Jun 26, 2025
52a017b
URB-3337 Add option to add complementary delay to task and add value …
jimbiscuit Jul 7, 2025
ba5586f
Preparing release 2.7.42
jimbiscuit Jul 8, 2025
eaf7af5
Back to development: 2.7.43
jimbiscuit Jul 8, 2025
03c0ae9
URBBDC-3142: Fix changelog to reflect revert
mpeeters Jul 8, 2025
4dcd518
Fix changelog
mpeeters Jul 23, 2025
c56d272
SUP-46330: Fix patrimony certificates interface (#411)
jimbiscuit Aug 12, 2025
0b95d02
Preparing release 2.7.43
jimbiscuit Aug 12, 2025
523ee97
Back to development: 2.7.44
jimbiscuit Aug 12, 2025
351f304
fix conflit
WBoudabous Aug 22, 2025
8f85967
update translation
WBoudabous Aug 22, 2025
ce909cd
add municipalDirective field for location shemata
WBoudabous Jun 17, 2025
2f4d85f
add changelog
WBoudabous Jun 17, 2025
1af1d99
rename vocanulary
WBoudabous Jun 17, 2025
0b9726f
run black
WBoudabous Aug 22, 2025
c19c946
fix conflit
WBoudabous Aug 22, 2025
5f6a94a
run isort
WBoudabous Aug 22, 2025
7ed753c
run flake8
WBoudabous Aug 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/URB-3342.feature
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]
12 changes: 12 additions & 0 deletions src/Products/urban/content/licence/GenericLicence.py
Copy link
Member

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

Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,17 @@
schemata="urban_location",
default_output_type="text/x-html-safe",
),
LinesField(
name="municipalDirective",
widget=MultiSelect2Widget(
size=10,
label=_("urban_label_municipalDirective", default="municipalDirective"),
),
schemata="urban_location",
multiValued=True,
vocabulary=UrbanVocabulary("municipal_directive",vocType='UrbanVocabularyTerm', inUrbanConfig=False),
default_method="getDefaultValue",
),
LinesField(
name="PRenU",
widget=MultiSelect2Widget(
Expand Down Expand Up @@ -1464,6 +1475,7 @@
schemata="urban_environment",
default_output_type="text/x-html-safe",
),

),
)

Expand Down
27 changes: 27 additions & 0 deletions src/Products/urban/locales/fr/LC_MESSAGES/urban.po
Original file line number Diff line number Diff line change
Expand Up @@ -5430,3 +5430,30 @@ msgstr "ans"

msgid "zip_folder_title"
msgstr "Zone d'initiative privilégiée"

msgid "chapter_1"
Copy link
Member

Choose a reason for hiding this comment

The 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"
53 changes: 52 additions & 1 deletion src/Products/urban/migration/update_270.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,6 +39,7 @@
from zope.component import getUtility

import logging
from zope.i18n import translate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please run isort to ensure that imports are ordered correctly



def rename_patrimony_certificate(context):
Expand Down Expand Up @@ -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 = [

{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indent, please run black.

"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!")
8 changes: 8 additions & 0 deletions src/Products/urban/migration/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo ici

description=""
source="1165"
destination="1166"
handler=".update_270.add_municipal_directive_vocabulary"
profile="Products.urban:default"
/>

</configure>
4 changes: 2 additions & 2 deletions src/Products/urban/profiles/default/metadata.xml
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>