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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
erp5
Commits
e6fb20ab
Commit
e6fb20ab
authored
Mar 07, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate document instead use after_script.
parent
c5c71bee
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
6 deletions
+56
-6
product/ERP5Configurator/Document/AccountConfiguratorItem.py
product/ERP5Configurator/Document/AccountConfiguratorItem.py
+3
-0
product/ERP5Configurator/Document/AccountingPeriodConfiguratorItem.py
...Configurator/Document/AccountingPeriodConfiguratorItem.py
+5
-1
product/ERP5Configurator/Document/OrganisationConfiguratorItem.py
...ERP5Configurator/Document/OrganisationConfiguratorItem.py
+3
-0
product/ERP5Configurator/Document/PersonConfiguratorItem.py
product/ERP5Configurator/Document/PersonConfiguratorItem.py
+7
-0
product/ERP5Configurator/Document/PreferenceConfiguratorItem.py
...t/ERP5Configurator/Document/PreferenceConfiguratorItem.py
+4
-0
product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py
...urator/Document/PurchaseTradeConditionConfiguratorItem.py
+2
-0
product/ERP5Configurator/Document/SaleTradeConditionConfiguratorItem.py
...nfigurator/Document/SaleTradeConditionConfiguratorItem.py
+2
-0
product/ERP5Configurator/Document/ServiceConfiguratorItem.py
product/ERP5Configurator/Document/ServiceConfiguratorItem.py
+3
-2
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
.../ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
+22
-3
product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py
...Configurator/Document/SystemPreferenceConfiguratorItem.py
+5
-0
No files found.
product/ERP5Configurator/Document/AccountConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -75,5 +75,8 @@ class AccountConfiguratorItem(ConfiguratorItemMixin, XMLObject):
description
=
self
.
getDescription
(),
**
extra_kw
)
if
self
.
portal_workflow
.
isTransitionPossible
(
account
,
'validate'
):
account
.
validate
(
comment
=
"Validated by Configurator"
)
## add to customer template
self
.
install
(
account
,
business_configuration
)
product/ERP5Configurator/Document/AccountingPeriodConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -60,11 +60,15 @@ class AccountingPeriodConfiguratorItem(ConfiguratorItemMixin, XMLObject):
organisation_id
=
business_configuration
.
\
getGlobalConfigurationAttr
(
'organisation_id'
)
organisation
=
portal
.
organisation_module
.
_getOb
(
organisation_id
)
organisation
.
newContent
(
portal_type
=
'Accounting Period'
,
period
=
organisation
.
newContent
(
portal_type
=
'Accounting Period'
,
start_date
=
self
.
getStartDate
(),
stop_date
=
self
.
getStopDate
(),
short_title
=
self
.
getShortTitle
(),
title
=
self
.
getTitle
())
if
self
.
portal_workflow
.
isTransitionPossible
(
period
,
'start'
):
period
.
start
(
comment
=
"Started by Configurator"
)
# no need to 'install' in the business template, because it's contain as
# subobject of an organisation we already added.
product/ERP5Configurator/Document/OrganisationConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -77,5 +77,8 @@ class OrganisationConfiguratorItem(ConfiguratorItemMixin, XMLObject):
# store globally organization_id
business_configuration
.
setGlobalConfigurationAttr
(
organisation_id
=
organisation
.
getId
())
if
self
.
portal_workflow
.
isTransitionPossible
(
organisation
,
'validate'
):
organisation
.
validate
(
comment
=
"Validated by Configurator"
)
## add to customer template
self
.
install
(
organisation
,
business_configuration
)
product/ERP5Configurator/Document/PersonConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -96,5 +96,12 @@ class PersonConfiguratorItem(XMLObject, ConfiguratorItemMixin):
# Define valid for 10 years.
assignment
.
setStopDate
(
now
+
(
365
*
10
))
# Validate the Person if possible
if
self
.
portal_workflow
.
isTransitionPossible
(
person
,
'validate'
):
person
.
validate
(
comment
=
"Validated by Configurator"
)
if
self
.
portal_workflow
.
isTransitionPossible
(
assignment
,
'open'
):
assignment
.
open
(
comment
=
"Open by Configuration"
)
## add to customer template
self
.
install
(
person
,
business_configuration
)
product/ERP5Configurator/Document/PreferenceConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -110,6 +110,10 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
if
preference_value
is
not
marker
:
preference_dict
[
preference_name
]
=
preference_value
if
self
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
preference
.
enable
()
organisation_id
=
business_configuration
.
\
preference_dict
[
'preferred_accounting_transaction_source_section'
]
=
\
organisation_path
preference_dict
[
'preferred_section'
]
=
organisation_path
...
...
product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -82,4 +82,6 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
purchase_trade_condition
.
setDestinationSection
(
"organisation_module/%s"
%
organisation_id
)
purchase_trade_condition
.
setPriceCurrency
(
"currency_module/%s"
%
currency_id
)
purchase_trade_condition
.
validate
(
comment
=
"Validated by Configurator"
)
self
.
install
(
purchase_trade_condition
,
business_configuration
)
product/ERP5Configurator/Document/SaleTradeConditionConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -82,4 +82,6 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
sale_trade_condition
.
setSourceSection
(
"organisation_module/%s"
%
organisation_id
)
sale_trade_condition
.
setPriceCurrency
(
"currency_module/%s"
%
currency_id
)
sale_trade_condition
.
validate
(
comment
=
"Validated by Configurator"
)
self
.
install
(
sale_trade_condition
,
business_configuration
)
product/ERP5Configurator/Document/ServiceConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -61,7 +61,8 @@ class ServiceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
document
=
getattr
(
portal
.
service_module
,
service_id
,
None
)
if
document
is
None
:
document
=
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
,
id
=
service_id
,
title
=
service_title
)
id
=
service_id
,
title
=
service_title
)
document
.
validate
(
"Validated by Configurator"
)
## add to customer template
self
.
install
(
document
,
business_configuration
)
product/ERP5Configurator/Document/StandardBT5ConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -66,6 +66,25 @@ class StandardBT5ConfiguratorItem(ConfiguratorItemMixin, XMLObject):
template_tool
.
installBusinessTemplateListFromRepository
([
bt5_id
],
update_catalog
=
self
.
getUpdateCatalog
(
0
))
if
bt5_id
in
template_tool
.
getInstalledBusinessTemplateTitleList
():
LOG
(
"StandardBT5ConfiguratorItem"
,
INFO
,
"Business Template already Installed: %s for %s"
%
(
bt5_id
,
self
.
getRelativeUrl
()))
return
def
_getRepositoryBusinessTemplateTitleList
():
return
[
bt
.
getTitle
()
for
bt
in
\
template_tool
.
getRepositoryBusinessTemplateList
()]
repository_bt_title_list
=
CachingMethod
(
_getRepositoryBusinessTemplateTitleList
,
id
=
'StandardBT5_getRepositoryBusinessTemplateTitleList'
,
cache_factory
=
'erp5_content_long'
)()
if
bt5_id
in
repository_bt_title_list
:
template_tool
.
installBusinessTemplateListFromRepository
([
bt5_id
],
update_catalog
=
self
.
getUpdateCatalog
(
0
),
install_dependency
=
self
.
getInstallDependency
(
1
),
activate
=
True
)
LOG
(
"StandardBT5ConfiguratorItem"
,
INFO
,
"Install %s for %s"
%
(
bt5_id
,
self
.
getRelativeUrl
()))
return
...
...
product/ERP5Configurator/Document/SystemPreferenceConfiguratorItem.py
View file @
e6fb20ab
...
...
@@ -110,6 +110,8 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
# XXX this have to be translated in user language.
preference_dict
=
{}
marker
=
[]
activated_preference
=
portal
.
portal_preferences
.
getActiveSystemPreference
()
for
preference_name
in
self
.
_getPreferenceNameList
():
preference_value
=
getattr
(
self
,
preference_name
,
preference
.
getProperty
(
preference_name
))
...
...
@@ -117,6 +119,9 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
preference_value
=
activated_preference
.
getProperty
(
preference_name
)
preference_dict
[
preference_name
]
=
preference_value
if
self
.
portal_workflow
.
isTransitionPossible
(
preference
,
'enable'
):
preference
.
enable
()
preference
.
edit
(
**
preference_dict
)
bt5_obj
=
business_configuration
.
getSpecialiseValue
()
current_template_preference_list
=
list
(
bt5_obj
.
getTemplatePreferenceList
())
...
...
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