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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
00311942
Commit
00311942
authored
Feb 25, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simulation: when building, edit properties in order defined on movement groups
parent
6fd3252c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
24 additions
and
46 deletions
+24
-46
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.BaseVariantMovementGroup.py
...rtal_components/document.erp5.BaseVariantMovementGroup.py
+1
-7
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.CategoryMovementGroup.py
.../portal_components/document.erp5.CategoryMovementGroup.py
+2
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.CausalityMovementGroup.py
...portal_components/document.erp5.CausalityMovementGroup.py
+1
-4
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py
...tal_components/document.erp5.MonthlyRangeMovementGroup.py
+2
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.ParentDeliveryPropertyMovementGroup.py
...ents/document.erp5.ParentDeliveryPropertyMovementGroup.py
+2
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.ParentExplanationMovementGroup.py
...omponents/document.erp5.ParentExplanationMovementGroup.py
+1
-4
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.PropertyMovementGroup.py
.../portal_components/document.erp5.PropertyMovementGroup.py
+3
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.RequirementMovementGroup.py
...rtal_components/document.erp5.RequirementMovementGroup.py
+1
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.RootAppliedRuleCausalityMovementGroup.py
...ts/document.erp5.RootAppliedRuleCausalityMovementGroup.py
+1
-4
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.TitleMovementGroup.py
...tem/portal_components/document.erp5.TitleMovementGroup.py
+1
-3
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
...TemplateItem/portal_components/mixin.erp5.BuilderMixin.py
+0
-2
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.MovementGroup.py
...mplateItem/portal_components/module.erp5.MovementGroup.py
+9
-17
No files found.
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.BaseVariantMovementGroup.py
View file @
00311942
...
...
@@ -37,13 +37,7 @@ class BaseVariantMovementGroup(MovementGroup):
portal_type
=
'Base Variant Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
category_list
=
movement
.
getVariationBaseCategoryList
()
if
category_list
is
None
:
category_list
=
[]
category_list
.
sort
()
property_dict
[
'_base_category_list'
]
=
category_list
return
property_dict
return
{
'_base_category_list'
:
sorted
(
movement
.
getVariationBaseCategoryList
()
or
[])}
def
test
(
self
,
document
,
property_dict
,
**
kw
):
# This movement group does not affect updating.
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.CategoryMovementGroup.py
View file @
00311942
...
...
@@ -25,6 +25,7 @@
#
##############################################################################
from
collections
import
OrderedDict
from
erp5.component.document.PropertyMovementGroup
import
PropertyMovementGroup
class
CategoryMovementGroup
(
PropertyMovementGroup
):
...
...
@@ -43,7 +44,7 @@ class CategoryMovementGroup(PropertyMovementGroup):
portal_type
=
'Category Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
property_dict
=
OrderedDict
()
getProperty
=
movement
.
getProperty
for
prop
in
self
.
getTestedPropertyList
():
list_prop
=
prop
+
'_list'
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.CausalityMovementGroup.py
View file @
00311942
...
...
@@ -38,10 +38,7 @@ class CausalityMovementGroup(MovementGroup):
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
explanation_relative_url
=
self
.
_getExplanationRelativeUrl
(
movement
)
property_dict
[
'_explanation'
]
=
explanation_relative_url
return
property_dict
return
{
'_explanation'
:
self
.
_getExplanationRelativeUrl
(
movement
)}
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
# we don't care the difference of explanation url when updating
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MonthlyRangeMovementGroup.py
View file @
00311942
...
...
@@ -26,6 +26,7 @@
#
##############################################################################
from
collections
import
OrderedDict
from
erp5.component.document.MovementGroup
import
MovementGroup
from
DateTime
import
DateTime
from
erp5.component.module.DateUtils
import
atTheEndOfPeriod
...
...
@@ -45,7 +46,7 @@ class MonthlyRangeMovementGroup(MovementGroup):
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
"""Gather start_date and stop_date, converge them to the end of month.
"""
property_dict
=
{}
property_dict
=
OrderedDict
()
for
property_name
in
self
.
getTestedPropertyList
()
or
(
'start_date'
,
'stop_date'
):
date
=
movement
.
getProperty
(
property_name
,
None
)
if
date
is
not
None
:
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.ParentDeliveryPropertyMovementGroup.py
View file @
00311942
...
...
@@ -25,6 +25,7 @@
#
##############################################################################
from
collections
import
OrderedDict
from
erp5.component.document.PropertyMovementGroup
import
PropertyMovementGroup
from
Products.ERP5Type.Utils
import
UpperCase
...
...
@@ -41,7 +42,7 @@ class ParentDeliveryPropertyMovementGroup(PropertyMovementGroup):
portal_type
=
'Parent Delivery Property Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
property_dict
=
OrderedDict
()
parent_delivery
=
self
.
_getParentDelivery
(
movement
)
if
parent_delivery
is
not
None
:
for
prop
in
self
.
getTestedPropertyList
():
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.ParentExplanationMovementGroup.py
View file @
00311942
...
...
@@ -40,10 +40,7 @@ class ParentExplanationMovementGroup(MovementGroup):
portal_type
=
'Parent Explanation Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
parent_explanation_value
=
movement
.
getParentExplanationValue
()
property_dict
[
'parent_explanation_value'
]
=
parent_explanation_value
return
property_dict
return
{
'parent_explanation_value'
:
movement
.
getParentExplanationValue
()}
def
test
(
self
,
document
,
property_dict
,
**
kw
):
if
document
.
getParentExplanationValue
()
==
\
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.PropertyMovementGroup.py
View file @
00311942
...
...
@@ -26,8 +26,10 @@
#
##############################################################################
from
collections
import
OrderedDict
from
erp5.component.document.MovementGroup
import
MovementGroup
class
PropertyMovementGroup
(
MovementGroup
):
"""
The purpose of MovementGroup is to define how movements are grouped,
...
...
@@ -40,7 +42,7 @@ class PropertyMovementGroup(MovementGroup):
portal_type
=
'Property Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
property_dict
=
OrderedDict
()
getProperty
=
movement
.
getProperty
for
prop
in
self
.
getTestedPropertyList
():
property_dict
[
prop
]
=
getProperty
(
prop
)
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.RequirementMovementGroup.py
View file @
00311942
...
...
@@ -36,7 +36,7 @@ class RequirementMovementGroup(MovementGroup):
portal_type
=
'Requirement Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
return
{
'requirement'
:
self
.
_getRequirementList
(
movement
)}
return
{
'requirement'
:
self
.
_getRequirementList
(
movement
)}
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
# We can always update
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.RootAppliedRuleCausalityMovementGroup.py
View file @
00311942
...
...
@@ -39,10 +39,7 @@ class RootAppliedRuleCausalityMovementGroup(MovementGroup):
portal_type
=
'Root Applied Rule Causality Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
root_causality_value
=
self
.
_getRootCausalityValue
(
movement
)
property_dict
[
'root_causality_value_list'
]
=
[
root_causality_value
]
return
property_dict
return
{
'root_causality_value_list'
:
[
self
.
_getRootCausalityValue
(
movement
)]}
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
# We can always update
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.TitleMovementGroup.py
View file @
00311942
...
...
@@ -37,9 +37,7 @@ class TitleMovementGroup(MovementGroup):
portal_type
=
'Title Movement Group'
def
_getPropertyDict
(
self
,
movement
,
**
kw
):
property_dict
=
{}
property_dict
[
'title'
]
=
self
.
_getTitle
(
movement
)
return
property_dict
return
{
'title'
:
self
.
_getTitle
(
movement
)}
def
test
(
self
,
document
,
property_dict
,
**
kw
):
# If title is different, we want to update existing document instead
...
...
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
View file @
00311942
...
...
@@ -331,8 +331,6 @@ class BuilderMixin(XMLObject, Amount, Predicate):
# 'variation_category' or 'variation_property' pseudo properties,
# which rely on the resource being set to discover which
# categories/properties to set
# XXX-Leo: in the future: using an ordered_dict would be nice,
# but this would have to be respected on Base._edit()
edit_order
=
[]
property_dict
=
{
'edit_order'
:
edit_order
}
for
d
in
property_dict_list
:
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.MovementGroup.py
View file @
00311942
...
...
@@ -28,11 +28,10 @@
#
##############################################################################
from
collections
import
OrderedDict
from
warnings
import
warn
from
Products.PythonScripts.Utility
import
allow_class
class
FakeMovementError
(
Exception
)
:
pass
class
MovementGroupError
(
Exception
)
:
pass
class
MovementGroupNode
:
# XXX last_line_movement_group is a wrong name. Actually, it is
...
...
@@ -60,7 +59,7 @@ class MovementGroupNode:
last_line_movement_group
=
self
.
_last_line_movement_group
,
separate_method_name_list
=
self
.
_separate_method_name_list
,
merge_delivery
=
self
.
_merge_delivery
)
nested_instance
.
setGroupEdit
(
**
property_dict
)
nested_instance
.
setGroupEdit
(
property_dict
)
split_movement_list
=
nested_instance
.
append
(
movement_list
)
self
.
_group_list
.
append
(
nested_instance
)
return
split_movement_list
...
...
@@ -93,27 +92,20 @@ class MovementGroupNode:
def
getGroupList
(
self
):
return
self
.
_group_list
def
setGroupEdit
(
self
,
**
kw
):
def
setGroupEdit
(
self
,
kw
):
"""
Store properties for the futur created object
Store properties for the futur
e
created object
"""
self
.
_property_dict
=
kw
def
updateGroupEdit
(
self
,
**
kw
):
"""
Update properties for the futur created object
"""
self
.
_property_dict
.
update
(
kw
)
def
getGroupEditDict
(
self
):
"""
Get property dict for the futur created object
Get property dict for the futur
e
created object
"""
property_dict
=
getattr
(
self
,
'_property_dict'
,
{}).
copy
()
for
key
in
property_dict
.
keys
():
if
key
.
startswith
(
'_'
):
del
(
property_dict
[
key
])
return
property_dict
return
OrderedDict
([
(
k
,
v
)
for
(
k
,
v
)
in
getattr
(
self
,
'_property_dict'
,
{}).
items
()
if
not
k
.
startswith
(
'_'
)])
def
getCurrentMovementGroup
(
self
):
return
self
.
_movement_group
...
...
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