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
Xiaowu Zhang
erp5
Commits
92424b19
Commit
92424b19
authored
Jan 14, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: erp5_immobilisation: Migrate ImmobilisationItem and its Interface from FS.
parent
8b2c9d5c
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
914 additions
and
9 deletions
+914
-9
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.py
...Item/portal_components/document.erp5.ImmobilisableItem.py
+3
-2
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.xml
...tem/portal_components/document.erp5.ImmobilisableItem.xml
+796
-0
bt5/erp5_immobilisation/InterfaceTemplateItem/portal_components/interface.erp5.IImmobilisationItem.py
...m/portal_components/interface.erp5.IImmobilisationItem.py
+0
-0
bt5/erp5_immobilisation/InterfaceTemplateItem/portal_components/interface.erp5.IImmobilisationItem.xml
.../portal_components/interface.erp5.IImmobilisationItem.xml
+104
-0
bt5/erp5_immobilisation/bt/template_document_id_list
bt5/erp5_immobilisation/bt/template_document_id_list
+1
-0
bt5/erp5_immobilisation/bt/template_interface_id_list
bt5/erp5_immobilisation/bt/template_interface_id_list
+1
-0
product/ERP5/Document/ImmobilisationDelivery.py
product/ERP5/Document/ImmobilisationDelivery.py
+4
-4
product/ERP5/Document/ImmobilisationMovement.py
product/ERP5/Document/ImmobilisationMovement.py
+5
-3
No files found.
product/ERP5/Document/
ImmobilisableItem.py
→
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.
ImmobilisableItem.py
View file @
92424b19
...
@@ -32,7 +32,8 @@ from AccessControl import ClassSecurityInfo
...
@@ -32,7 +32,8 @@ from AccessControl import ClassSecurityInfo
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
string
import
capitalize
from
string
import
capitalize
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.interface.IImmobilisationItem
import
IImmobilisationItem
from
Products.ERP5Type.DateUtils
import
addToDate
,
getClosestDate
,
roundDate
from
Products.ERP5Type.DateUtils
import
addToDate
,
getClosestDate
,
roundDate
from
Products.ERP5Type.DateUtils
import
getRoundedMonthBetween
,
millis
from
Products.ERP5Type.DateUtils
import
getRoundedMonthBetween
,
millis
from
Products.ERP5Type.DateUtils
import
getAccountableYearFraction
from
Products.ERP5Type.DateUtils
import
getAccountableYearFraction
...
@@ -78,7 +79,7 @@ class ImmobilisableItem(Item, Amount):
...
@@ -78,7 +79,7 @@ class ImmobilisableItem(Item, Amount):
,
PropertySheet
.
Amortisation
,
PropertySheet
.
Amortisation
)
)
zope
.
interface
.
implements
(
interfaces
.
IImmobilisationItem
)
zope
.
interface
.
implements
(
IImmobilisationItem
)
# IExpandableItem interface implementation
# IExpandableItem interface implementation
def
getSimulationMovementSimulationState
(
self
,
simulation_movement
):
def
getSimulationMovementSimulationState
(
self
,
simulation_movement
):
...
...
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.xml
0 → 100644
View file @
92424b19
This diff is collapsed.
Click to expand it.
product/ERP5/interfaces/immobilisation_i
tem.py
→
bt5/erp5_immobilisation/InterfaceTemplateItem/portal_components/interface.erp5.IImmobilisationI
tem.py
View file @
92424b19
File moved
bt5/erp5_immobilisation/InterfaceTemplateItem/portal_components/interface.erp5.IImmobilisationItem.xml
0 → 100644
View file @
92424b19
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interface Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IImmobilisationItem
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.immobilisation_item
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IImmobilisationItem
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Interface 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
0 → 100644
View file @
92424b19
document.erp5.ImmobilisableItem
\ No newline at end of file
bt5/erp5_immobilisation/bt/template_interface_id_list
0 → 100644
View file @
92424b19
interface.erp5.IImmobilisationItem
\ No newline at end of file
product/ERP5/Document/ImmobilisationDelivery.py
View file @
92424b19
...
@@ -28,10 +28,8 @@
...
@@ -28,10 +28,8 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5.Document.ImmobilisableItem
import
ImmobilisationValidityError
class
ImmobilisationDelivery
(
XMLObject
):
class
ImmobilisationDelivery
(
XMLObject
):
"""
"""
...
@@ -68,6 +66,7 @@ class ImmobilisationDelivery(XMLObject):
...
@@ -68,6 +66,7 @@ class ImmobilisationDelivery(XMLObject):
an invalid state
an invalid state
"""
"""
if
self
.
getImmobilisationState
()
==
'calculating'
:
if
self
.
getImmobilisationState
()
==
'calculating'
:
from
erp5.component.document.ImmobilisableItem
import
ImmobilisationValidityError
try
:
try
:
if
self
.
isValidImmobilisationMovement
(
**
kw
):
if
self
.
isValidImmobilisationMovement
(
**
kw
):
self
.
validateImmobilisation
()
self
.
validateImmobilisation
()
...
@@ -116,11 +115,12 @@ class ImmobilisationDelivery(XMLObject):
...
@@ -116,11 +115,12 @@ class ImmobilisationDelivery(XMLObject):
"""
"""
Return the list of each next immobilisation movement for each aggregated item
Return the list of each next immobilisation movement for each aggregated item
"""
"""
from
erp5.component.interface.IImmobilisationItem
import
IImmobilisationItem
returned_list
=
[]
returned_list
=
[]
sub_movement_list
=
self
.
contentValues
()
sub_movement_list
=
self
.
contentValues
()
for
movement
in
self
.
getImmobilisationMovementList
(
**
kw
):
for
movement
in
self
.
getImmobilisationMovementList
(
**
kw
):
for
item
in
movement
.
getAggregateValueList
():
for
item
in
movement
.
getAggregateValueList
():
if
interfaces
.
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
future_movement_list
=
item
.
getFutureImmobilisationMovementValueList
(
future_movement_list
=
item
.
getFutureImmobilisationMovementValueList
(
at_date
=
self
.
getStopDate
(),
at_date
=
self
.
getStopDate
(),
from_movement
=
self
,
from_movement
=
self
,
...
...
product/ERP5/Document/ImmobilisationMovement.py
View file @
92424b19
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5.Document.Movement
import
Movement
from
Products.ERP5.Document.Movement
import
Movement
...
@@ -97,6 +97,8 @@ class ImmobilisationMovement(Movement, XMLObject):
...
@@ -97,6 +97,8 @@ class ImmobilisationMovement(Movement, XMLObject):
"""
"""
If to_translate is set, the method may return a dictionary {'msg':'...', 'mapping':{} }
If to_translate is set, the method may return a dictionary {'msg':'...', 'mapping':{} }
"""
"""
from
erp5.component.interface.IImmobilisationItem
import
IImmobilisationItem
relative_url
=
self
.
getRelativeUrl
()
relative_url
=
self
.
getRelativeUrl
()
def
checkValuesAreNotNone
(
property_list
):
def
checkValuesAreNotNone
(
property_list
):
errors
=
[]
errors
=
[]
...
@@ -140,7 +142,7 @@ class ImmobilisationMovement(Movement, XMLObject):
...
@@ -140,7 +142,7 @@ class ImmobilisationMovement(Movement, XMLObject):
# Check if the date of this movement is unique
# Check if the date of this movement is unique
date_error
=
0
date_error
=
0
for
item
in
self
.
getAggregateValueList
():
for
item
in
self
.
getAggregateValueList
():
if
interfaces
.
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
same_date_list
=
item
.
getUnfilteredImmobilisationMovementValueList
(
same_date_list
=
item
.
getUnfilteredImmobilisationMovementValueList
(
from_date
=
self
.
getStopDate
(),
from_date
=
self
.
getStopDate
(),
to_date
=
self
.
getStopDate
(),
to_date
=
self
.
getStopDate
(),
...
@@ -198,7 +200,7 @@ class ImmobilisationMovement(Movement, XMLObject):
...
@@ -198,7 +200,7 @@ class ImmobilisationMovement(Movement, XMLObject):
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
for
item
in
self
.
getAggregateValueList
():
for
item
in
self
.
getAggregateValueList
():
if
interfaces
.
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
if
not
checkPreviousMovementForItem
(
self
,
item
):
if
not
checkPreviousMovementForItem
(
self
,
item
):
check_uncontinuous
=
1
check_uncontinuous
=
1
else
:
else
:
...
...
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