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
Alexander Emmerich
erp5
Commits
8c66c72a
Commit
8c66c72a
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
38cc3c27
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1023 additions
and
51 deletions
+1023
-51
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
+29
-50
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
No files found.
product/ERP5/Document/
AmortisationRule.py
→
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.
AmortisationRule.py
View file @
8c66c72a
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.xml
0 → 100644
View file @
8c66c72a
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 @
8c66c72a
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.Immobilisation.xml
0 → 100644
View file @
8c66c72a
<?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 @
8c66c72a
File moved
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationLine.xml
0 → 100644
View file @
8c66c72a
<?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 @
8c66c72a
...
...
@@ -164,7 +164,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 +172,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 +188,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 +383,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'
],
...
...
@@ -676,7 +656,6 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
self
.
stepAggregateItems
(
sequence
=
sequence
)
self
.
stepDeliverPackingList
(
sequence
=
sequence
)
parameter_dict
.
update
(
{
'amortisation_method'
:
UNIMMOBILISING_METHOD
,
'amortisation_start_price'
:
12000
,
'amortisation_start_price'
:
0
,
'amortisation_duration'
:
48
,
'immobilisation_vat'
:
0
})
...
...
@@ -843,9 +822,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 +882,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 +1117,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
c_period
[
key
]
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
ValueError
:
pass
if
is_float
:
self
.
assertEqual
(
round
(
c_value
,
2
),
e_value
)
...
...
@@ -2108,10 +2087,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
getattr
(
c_movement
,
key
)()
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
ValueError
:
pass
if
is_float
:
wrong_movement
=
(
round
(
c_value
,
2
)
!=
round
(
e_value
,
2
))
...
...
@@ -2144,7 +2123,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
=
None
):
self
.
id_transaction
+=
1
r_dict
=
{
'id'
:
self
.
id_transaction
,
'start_date'
:
DateTime
(
date
),
'stop_date'
:
DateTime
(
date
),
'resource'
:
'currency_module/EUR'
,
'line_list'
:[],
...
...
@@ -2154,10 +2133,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
r_dict
[
name
]
=
None
else
:
r_dict
[
name
]
=
self
.
getOrganisationModule
()[
prop
]
causality_value_list
=
[]
for
causality
in
causality_list
:
causality_value_list
.
append
(
self
.
getItemModule
()[
causality
])
if
len
(
causality_value_list
)
!=
0
:
if
causality_list
is
not
None
:
causality_value_list
=
[]
for
causality
in
causality_list
:
causality_value_list
.
append
(
self
.
getItemModule
()[
causality
])
r_dict
[
'causality_value_list'
]
=
causality_value_list
return
r_dict
...
...
@@ -2952,14 +2931,14 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
#LOG('c_value : ',0,c_value)
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
ValueError
:
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 +2976,10 @@ class TestImmobilisationMixin(ERP5TypeTestCase):
c_value
=
getattr
(
c_line
,
key
)()
is_float
=
0
try
:
if
type
(
c_value
)
!=
type
(
DateTime
()
):
if
isinstance
(
c_value
,
DateTime
):
c_value
=
float
(
c_value
)
is_float
=
1
except
:
except
ValueError
:
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 @
8c66c72a
<?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 @
8c66c72a
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 @
8c66c72a
test.erp5.testImmobilisation
\ 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