Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Ricateau
erp5
Commits
f743bcbf
Commit
f743bcbf
authored
Mar 07, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Here and there style change.
Those files should be merged in future.
parent
2689e6b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
+15
-20
product/ERP5Configurator/Document/PreferenceConfiguratorItem.py
...t/ERP5Configurator/Document/PreferenceConfiguratorItem.py
+5
-7
product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py
...Configurator/Document/SystemPreferenceConfiguratorItem.py
+10
-13
No files found.
product/ERP5Configurator/Document/PreferenceConfiguratorItem.py
View file @
f743bcbf
...
@@ -87,15 +87,11 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -87,15 +87,11 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def
_build
(
self
,
business_configuration
):
def
_build
(
self
,
business_configuration
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
organisation_id
=
business_configuration
.
\
getGlobalConfigurationAttr
(
'organisation_id'
)
organisation_path
=
'organisation_module/%s'
%
organisation_id
preference
=
portal
.
portal_preferences
.
_getOb
(
self
.
object_id
,
None
)
preference
=
portal
.
portal_preferences
.
_getOb
(
self
.
object_id
,
None
)
if
preference
is
None
:
if
preference
is
None
:
preference
=
portal
.
portal_preferences
.
newContent
(
preference
=
portal
.
portal_preferences
.
newContent
(
portal_type
=
'Preference'
,
portal_type
=
'Preference'
,
id
=
self
.
object_id
,
id
=
self
.
object_id
,
title
=
self
.
title
,
title
=
self
.
title
,
description
=
self
.
description
,
description
=
self
.
description
,
priority
=
1
)
priority
=
1
)
...
@@ -114,8 +110,10 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -114,8 +110,10 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
preference
.
enable
()
preference
.
enable
()
organisation_id
=
business_configuration
.
\
organisation_id
=
business_configuration
.
\
getGlobalConfigurationAttr
(
'organisation_id'
)
organisation_path
=
'organisation_module/%s'
%
organisation_id
preference_dict
[
'preferred_accounting_transaction_source_section'
]
=
\
preference_dict
[
'preferred_accounting_transaction_source_section'
]
=
\
organisation_path
organisation_path
preference_dict
[
'preferred_section'
]
=
organisation_path
preference_dict
[
'preferred_section'
]
=
organisation_path
preference
.
edit
(
**
preference_dict
)
preference
.
edit
(
**
preference_dict
)
bt5_obj
=
business_configuration
.
getSpecialiseValue
()
bt5_obj
=
business_configuration
.
getSpecialiseValue
()
...
...
product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py
View file @
f743bcbf
...
@@ -33,9 +33,7 @@ from Products.ERP5Type.XMLObject import XMLObject
...
@@ -33,9 +33,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from
Products.ERP5Configurator.mixin.configurator_item
import
ConfiguratorItemMixin
from
Products.ERP5Configurator.mixin.configurator_item
import
ConfiguratorItemMixin
class
SystemPreferenceConfiguratorItem
(
ConfiguratorItemMixin
,
XMLObject
):
class
SystemPreferenceConfiguratorItem
(
ConfiguratorItemMixin
,
XMLObject
):
"""
""" Setup System preference. """
Setup system preference.
"""
meta_type
=
'ERP5 System Preference Configurator Item'
meta_type
=
'ERP5 System Preference Configurator Item'
portal_type
=
'System Preference Configurator Item'
portal_type
=
'System Preference Configurator Item'
...
@@ -96,16 +94,14 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -96,16 +94,14 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def
_build
(
self
,
business_configuration
):
def
_build
(
self
,
business_configuration
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
portal_preferences
=
portal
.
portal_preferences
preference
=
portal
.
portal_preferences
.
_getOb
(
self
.
object_id
,
None
)
preference
=
portal_preferences
.
_getOb
(
self
.
object_id
,
None
)
activated_preference
=
portal_preferences
.
getActiveSystemPreference
()
if
preference
is
None
:
if
preference
is
None
:
preference
=
portal
.
portal_preferences
.
newContent
(
preference
=
portal
.
portal_preferences
.
newContent
(
portal_type
=
'System Preference'
,
portal_type
=
'System Preference'
,
id
=
self
.
object_id
,
id
=
self
.
object_id
,
title
=
self
.
title
,
title
=
self
.
title
,
description
=
self
.
description
,
description
=
self
.
description
,
priority
=
1
)
priority
=
1
)
# XXX this have to be translated in user language.
# XXX this have to be translated in user language.
preference_dict
=
{}
preference_dict
=
{}
...
@@ -114,10 +110,11 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
...
@@ -114,10 +110,11 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
activated_preference
=
portal
.
portal_preferences
.
getActiveSystemPreference
()
activated_preference
=
portal
.
portal_preferences
.
getActiveSystemPreference
()
for
preference_name
in
self
.
_getPreferenceNameList
():
for
preference_name
in
self
.
_getPreferenceNameList
():
preference_value
=
getattr
(
self
,
preference_name
,
preference_value
=
getattr
(
self
,
preference_name
,
preference
.
getProperty
(
preference_name
))
preference
.
getProperty
(
preference_name
,
marker
))
if
preference_value
is
None
and
activated_preference
is
not
None
:
if
preference_value
is
None
and
activated_preference
is
not
None
:
preference_value
=
activated_preference
.
getProperty
(
preference_name
)
preference_value
=
activated_preference
.
getProperty
(
preference_name
)
preference_dict
[
preference_name
]
=
preference_value
if
preference_value
is
not
marker
:
preference_dict
[
preference_name
]
=
preference_value
if
self
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
if
self
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
preference
.
enable
()
preference
.
enable
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment