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
Léo-Paul Géneau
erp5
Commits
2f5f53df
Commit
2f5f53df
authored
Apr 03, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_immobilisation: Migrate Documents and Unit Test from filesystem.
parent
7952ff8f
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1035 additions
and
68 deletions
+1035
-68
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.py
...eItem/portal_components/document.erp5.AmortisationRule.py
+0
-0
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.xml
...Item/portal_components/document.erp5.AmortisationRule.xml
+665
-0
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.Immobilisation.py
...ateItem/portal_components/document.erp5.Immobilisation.py
+0
-0
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.Immobilisation.xml
...teItem/portal_components/document.erp5.Immobilisation.xml
+104
-0
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationLine.py
...tem/portal_components/document.erp5.ImmobilisationLine.py
+0
-0
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationLine.xml
...em/portal_components/document.erp5.ImmobilisationLine.xml
+110
-0
bt5/erp5_immobilisation/TestTemplateItem/portal_components/test.erp5.testImmobilisation.py
...ateItem/portal_components/test.erp5.testImmobilisation.py
+25
-67
bt5/erp5_immobilisation/TestTemplateItem/portal_components/test.erp5.testImmobilisation.xml
...teItem/portal_components/test.erp5.testImmobilisation.xml
+110
-0
bt5/erp5_immobilisation/bt/template_document_id_list
bt5/erp5_immobilisation/bt/template_document_id_list
+4
-1
bt5/erp5_immobilisation/bt/template_test_id_list
bt5/erp5_immobilisation/bt/template_test_id_list
+1
-0
bt5/erp5_immobilisation/bt/test_dependency_list
bt5/erp5_immobilisation/bt/test_dependency_list
+16
-0
No files found.
product/ERP5/Document/
AmortisationRule.py
→
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.
AmortisationRule.py
View file @
2f5f53df
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.xml
0 → 100644
View file @
2f5f53df
This diff is collapsed.
Click to expand it.
product/ERP5/Document/
Immobilisation.py
→
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.
Immobilisation.py
View file @
2f5f53df
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.Immobilisation.xml
0 → 100644
View file @
2f5f53df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Document Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Immobilisation
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.Immobilisation
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.Immobilisation
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/Document/
ImmobilisationLine.py
→
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.
ImmobilisationLine.py
View file @
2f5f53df
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationLine.xml
0 → 100644
View file @
2f5f53df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Document Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ImmobilisationLine
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.ImmobilisationLine
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.ImmobilisationLine
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Document Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/
testImmobilisation.py
→
bt5/erp5_immobilisation/TestTemplateItem/portal_components/test.erp5.
testImmobilisation.py
View file @
2f5f53df
...
...
@@ -72,28 +72,6 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
"""
self
.
commit
()
def
getBusinessTemplateList
(
self
):
"""
Return the list of business templates.
"""
return
(
"erp5_core_proxy_field_legacy"
,
"erp5_base"
,
"erp5_pdm"
,
# Needed by accounting
"erp5_simulation"
,
"erp5_trade"
,
"erp5_accounting"
,
"erp5_invoicing"
,
"erp5_simplified_invoicing"
,
"erp5_immobilisation"
,
"erp5_computer_immobilisation"
,
# In order to use items
'erp5_configurator_standard_trade_template'
,
'erp5_configurator_standard_accounting_template'
,
'erp5_configurator_standard_invoicing_template'
,
"erp5_simulation_test"
,
"erp5_movement_table_catalog"
# ImmobilisationItem.py uses movement table
)
def
getRuleTool
(
self
):
return
getattr
(
self
.
getPortal
(),
'portal_rules'
,
None
)
def
getAccountingModule
(
self
):
...
...
@@ -164,7 +142,7 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
assignment
.
open
()
person
.
validate
()
def
updateRoleMappings
(
self
,
portal_type_list
=
[]
):
def
updateRoleMappings
(
self
,
portal_type_list
=
()
):
"""
Update the local roles in existing objects.
"""
...
...
@@ -172,7 +150,7 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
for
portal_type
in
portal_type_list
:
for
brain
in
portal_catalog
(
portal_type
=
portal_type
):
obj
=
brain
.
getObject
()
userdb_path
,
user_id
=
obj
.
getOwnerTuple
()
_
,
user_id
=
obj
.
getOwnerTuple
()
obj
.
updateLocalRolesOnSecurityGroups
(
user_name
=
user_id
)
#obj.assignRoleToSecurityGroup(user_name = user_id)
...
...
@@ -188,26 +166,6 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
self
.
createCategories
()
#Assert default security Value
list_module
=
[
'Inventory Module'
,
'Purchase Packing List Module'
,
'Internal Packing List Module'
,
'Sale Packing List Module'
,
'Building Module'
,
'Incorporeal Item Module'
,
'Reevaluation Module'
,
'Restoration Module'
,
self
.
getAccountingModule
().
getPortalType
(),
self
.
getOrganisationModule
().
getPortalType
(),
self
.
getItemModule
().
getPortalType
(),
self
.
getPackingListModule
().
getPortalType
(),
self
.
getInventoryModule
().
getPortalType
(),
self
.
getAccountModule
().
getPortalType
(),
self
.
getCurrencyModule
().
getPortalType
(),
self
.
getPersonModule
().
getPortalType
()
]
# Then add new components
self
.
createCurrency
()
self
.
createOrganisationList
()
...
...
@@ -403,17 +361,17 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
def
stepCreatePackingList
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
property_dict
=
{}
for
property
in
(
'source_section'
,
'destination_section'
,
'datetime'
,
'destination'
):
value_list
=
sequence
.
get
(
property
)
for
property
_
in
(
'source_section'
,
'destination_section'
,
'datetime'
,
'destination'
):
value_list
=
sequence
.
get
(
property
_
)
if
value_list
is
not
None
:
if
type
(
value_list
)
==
type
([]
):
if
isinstance
(
value_list
,
list
):
value
=
value_list
[
0
]
value_list
.
remove
(
value
)
else
:
value
=
value_list
else
:
value
=
value_list
property_dict
[
property
]
=
value
property_dict
[
property
_
]
=
value
pl_module
=
self
.
getPackingListModule
()
pl
=
pl_module
.
newContent
(
portal_type
=
self
.
packing_list_portal_type
)
pl
.
edit
(
source_section_value
=
property_dict
[
'source_section'
],
...
...
@@ -843,9 +801,9 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
self
.
stepCreatePackingList
(
sequence
=
sequence
)
self
.
stepAggregateItems
(
sequence
=
sequence
)
self
.
stepDeliverPackingList
(
sequence
=
sequence
)
for
property
in
(
'amortisation_start_price'
,
'amortisation_duration'
,
'immobilisation_vat'
,
'extra_cost_price'
,
'disposal_price'
):
del
parameter_dict
[
property
]
for
property
_
in
(
'amortisation_start_price'
,
'amortisation_duration'
,
'immobilisation_vat'
,
'extra_cost_price'
,
'disposal_price'
):
del
parameter_dict
[
property
_
]
parameter_dict
[
'amortisation_method'
]
=
NO_CHANGE_METHOD
sequence
.
edit
(
datetime
=
DateTime
(
'2001/01/01'
),
parameter_dict
=
parameter_dict
,
...
...
@@ -903,11 +861,11 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
self
.
stepAggregateItems
(
sequence
=
sequence
)
self
.
stepDeliverPackingList
(
sequence
=
sequence
)
self
.
tic
()
for
property
in
(
'amortisation_start_price'
,
'amortisation_duration'
,
'immobilisation_vat'
,
'extra_cost_price'
,
'disposal_price'
):
del
parameter_dict
[
property
]
for
property
in
self
.
account_dict
.
keys
():
del
parameter_dict
[
property
]
for
property
_
in
(
'amortisation_start_price'
,
'amortisation_duration'
,
'immobilisation_vat'
,
'extra_cost_price'
,
'disposal_price'
):
del
parameter_dict
[
property
_
]
for
property
_
in
self
.
account_dict
.
keys
():
del
parameter_dict
[
property
_
]
parameter_dict
.
update
(
self
.
extra_monthly_dict
)
sequence
.
edit
(
datetime
=
DateTime
(
'2002/03/01'
),
parameter_dict
=
parameter_dict
,
...
...
@@ -1138,10 +1096,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
c_period
[
key
]
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
not
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
Exception
:
pass
if
is_float
:
self
.
assertEqual
(
round
(
c_value
,
2
),
e_value
)
...
...
@@ -2108,10 +2066,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
getattr
(
c_movement
,
key
)()
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
not
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
Exception
:
pass
if
is_float
:
wrong_movement
=
(
round
(
c_value
,
2
)
!=
round
(
e_value
,
2
))
...
...
@@ -2144,7 +2102,7 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
#LOG('More expected movements than calculated ! Remaining expected ones are', 0, e_simulation_movement_list)
self
.
assertEqual
(
len
(
e_simulation_movement_list
),
0
)
def
_buildExpectedTransaction
(
self
,
date
,
source_section
,
destination_section
,
causality_state
,
causality_list
=
[]
):
def
_buildExpectedTransaction
(
self
,
date
,
source_section
,
destination_section
,
causality_state
,
causality_list
):
self
.
id_transaction
+=
1
r_dict
=
{
'id'
:
self
.
id_transaction
,
'start_date'
:
DateTime
(
date
),
'stop_date'
:
DateTime
(
date
),
'resource'
:
'currency_module/EUR'
,
'line_list'
:[],
...
...
@@ -2952,14 +2910,14 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
#LOG('c_value : ',0,c_value)
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
not
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
Exception
:
pass
if
type
(
c_value
)
==
type
([]
):
if
isinstance
(
c_value
,
list
):
c_value
.
sort
(
key
=
lambda
x
:
x
.
getId
())
if
type
(
e_value
)
==
type
([]
):
if
isinstance
(
e_value
,
list
):
e_value
.
sort
(
key
=
lambda
x
:
x
.
getId
())
if
is_float
:
wrong_transaction
=
(
round
(
c_value
,
2
)
!=
round
(
e_value
,
2
))
...
...
@@ -2997,10 +2955,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
getattr
(
c_line
,
key
)()
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
not
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
Exception
:
pass
if
is_float
:
wrong_line
=
(
round
(
c_value
,
2
)
!=
round
(
e_value
,
2
))
...
...
bt5/erp5_immobilisation/TestTemplateItem/portal_components/test.erp5.testImmobilisation.xml
0 → 100644
View file @
2f5f53df
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testImmobilisation
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.tests.testImmobilisation
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testImmobilisation
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_immobilisation/bt/template_document_id_list
View file @
2f5f53df
document.erp5.ImmobilisableItem
\ No newline at end of file
document.erp5.AmortisationRule
document.erp5.ImmobilisableItem
document.erp5.Immobilisation
document.erp5.ImmobilisationLine
\ No newline at end of file
bt5/erp5_immobilisation/bt/template_test_id_list
0 → 100644
View file @
2f5f53df
test.erp5.testImmobilisation
\ No newline at end of file
bt5/erp5_immobilisation/bt/test_dependency_list
0 → 100644
View file @
2f5f53df
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_pdm
erp5_simulation
erp5_trade
erp5_accounting
erp5_invoicing
erp5_simplified_invoicing
erp5_immobilisation
erp5_computer_immobilisation
erp5_configurator_standard_trade_template
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_simulation_test
erp5_movement_table_catalog
\ No newline at end of file
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