Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Jérome Perrin
slapos.core
Commits
bbf94fa7
Commit
bbf94fa7
authored
Mar 05, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Update Movement Group to not merge based on SPL causality
extend test to diff movement
parent
7a04d633
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
878 additions
and
24 deletions
+878
-24
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5.RootAppliedRuleCausalityCausalityMovementGroup.py
...nt.erp5.RootAppliedRuleCausalityCausalityMovementGroup.py
+11
-1
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5_slapos.RootAppliedRuleCausalityMovementGroup.py
...ment.erp5_slapos.RootAppliedRuleCausalityMovementGroup.py
+50
-0
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5_slapos.RootAppliedRuleCausalityMovementGroup.xml
...ent.erp5_slapos.RootAppliedRuleCausalityMovementGroup.xml
+133
-0
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/category_movement_group_on_line.xml
..._sale_invoice_builder/category_movement_group_on_line.xml
+1
-1
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/root_applied_rule_causality_causality_movement_group_on_delivery.xml
...d_rule_causality_causality_movement_group_on_delivery.xml
+2
-1
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/root_applied_rule_causality_movement_group_on_line.xml
...er/root_applied_rule_causality_movement_group_on_line.xml
+43
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_simulation/SaleInvoiceTransaction_postSlapOSGeneration.py
...simulation/SaleInvoiceTransaction_postSlapOSGeneration.py
+4
-2
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
...ortal_components/test.erp5.testSlapOSAccountingBuilder.py
+632
-18
master/bt5/slapos_accounting/bt/template_document_id_list
master/bt5/slapos_accounting/bt/template_document_id_list
+2
-1
No files found.
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5.RootAppliedRuleCausalityCausalityMovementGroup.py
View file @
bbf94fa7
...
@@ -45,8 +45,18 @@ class RootAppliedRuleCausalityCausalityMovementGroup(MovementGroup):
...
@@ -45,8 +45,18 @@ class RootAppliedRuleCausalityCausalityMovementGroup(MovementGroup):
return
property_dict
return
property_dict
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
if
'root_causality_causality_value_list'
in
property_dict
:
root_causality_causality_value_list
=
property_dict
[
'root_causality_causality_value_list'
]
if
root_causality_causality_value_list
[
0
]
is
None
and
not
movement
.
getCausalityValueList
():
return
True
,
property_dict
for
causality
in
movement
.
getCausalityValueList
():
test_root_causality_causality_value
=
causality
.
getCausalityValue
()
if
test_root_causality_causality_value
==
root_causality_causality_value_list
[
0
]:
return
True
,
property_dict
# We can always update
# We can always update
return
Tru
e
,
property_dict
return
Fals
e
,
property_dict
def
_getRootCausalityCausalityValue
(
self
,
movement
):
def
_getRootCausalityCausalityValue
(
self
,
movement
):
""" Get the causality value of the causality of the root applied rule for a movement """
""" Get the causality value of the causality of the root applied rule for a movement """
...
...
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5_slapos.RootAppliedRuleCausalityMovementGroup.py
0 → 100644
View file @
bbf94fa7
##############################################################################
#
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
erp5.component.document.erp5_version.RootAppliedRuleCausalityMovementGroup
\
import
RootAppliedRuleCausalityMovementGroup
as
ERP5RootAppliedRuleCausalityMovementGroup
class
RootAppliedRuleCausalityMovementGroup
(
ERP5RootAppliedRuleCausalityMovementGroup
):
"""
The purpose of MovementGroup is to define how movements are grouped,
and how values are updated from simulation movements.
This movement group is used to group movements whose root apply rule
has the same causality.
This overwrites the default for not always update, but check the information.
"""
def
test
(
self
,
movement
,
property_dict
,
**
kw
):
if
'root_causality_value_list'
in
property_dict
:
root_causality_value_list
=
property_dict
[
'root_causality_value_list'
]
for
simulation_movement
in
movement
.
getDeliveryRelatedValueList
():
if
self
.
_getRootCausalityValue
(
simulation_movement
)
==
root_causality_value_list
[
0
]:
return
True
,
property_dict
# No don't update
return
False
,
property_dict
\ No newline at end of file
master/bt5/slapos_accounting/DocumentTemplateItem/portal_components/document.erp5_slapos.RootAppliedRuleCausalityMovementGroup.xml
0 → 100644
View file @
bbf94fa7
<?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>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
RootAppliedRuleCausalityMovementGroup
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5_slapos.RootAppliedRuleCausalityMovementGroup
</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_slapos
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</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/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<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"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<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>
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/category_movement_group_on_line.xml
View file @
bbf94fa7
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
int_index
</string>
</key>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
1
</int>
</value>
<value>
<int>
3
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/root_applied_rule_causality_causality_movement_group_on_delivery.xml
View file @
bbf94fa7
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<value>
<value>
<tuple>
<tuple>
<string>
collect_order_group/delivery
</string>
<string>
collect_order_group/delivery
</string>
<string>
divergence_scope/category
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
@@ -26,7 +27,7 @@
...
@@ -26,7 +27,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
int_index
</string>
</key>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
3
</int>
</value>
<value>
<int>
2
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_builder/root_applied_rule_causality_movement_group_on_line.xml
0 → 100644
View file @
bbf94fa7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Root Applied Rule Causality Movement Group"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
collect_order_group/line
</string>
<string>
divergence_scope/category
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
root_applied_rule_causality_movement_group_on_line
</string>
</value>
</item>
<item>
<key>
<string>
int_index
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Root Applied Rule Causality Movement Group
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
root_applied_rule_causality_movement_group_on_line
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_simulation/SaleInvoiceTransaction_postSlapOSGeneration.py
View file @
bbf94fa7
...
@@ -48,10 +48,12 @@ if context.getStartDate() is None:
...
@@ -48,10 +48,12 @@ if context.getStartDate() is None:
max_stop_date
=
DateTime
().
earliestTime
()
max_stop_date
=
DateTime
().
earliestTime
()
context
.
setStopDate
(
max_stop_date
)
context
.
setStopDate
(
max_stop_date
)
if
context
.
getCausalityState
()
==
'draft'
:
context
.
startBuilding
()
comment
=
translateString
(
'Initialised by Delivery Builder.'
)
comment
=
translateString
(
'Initialised by Delivery Builder.'
)
if
invoice
.
getCausalityState
()
==
'draft'
:
invoice
.
startBuilding
(
comment
=
comment
)
if
invoice
.
portal_workflow
.
isTransitionPossible
(
invoice
,
'plan'
):
if
invoice
.
portal_workflow
.
isTransitionPossible
(
invoice
,
'plan'
):
invoice
.
plan
(
comment
=
comment
)
invoice
.
plan
(
comment
=
comment
)
if
invoice
.
portal_workflow
.
isTransitionPossible
(
invoice
,
'confirm'
):
if
invoice
.
portal_workflow
.
isTransitionPossible
(
invoice
,
'confirm'
):
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
View file @
bbf94fa7
This diff is collapsed.
Click to expand it.
master/bt5/slapos_accounting/bt/template_document_id_list
View file @
bbf94fa7
document.erp5.SlapOSAccountingQuantityUpdatingOrderBuilder
document.erp5.SlapOSAccountingQuantityUpdatingOrderBuilder
document.erp5.SubscriptionItemRootSimulationRule
document.erp5.SubscriptionItemRootSimulationRule
document.erp5.RootAppliedRuleCausalityCausalityMovementGroup
document.erp5.RootAppliedRuleCausalityCausalityMovementGroup
\ No newline at end of file
document.erp5_slapos.RootAppliedRuleCausalityMovementGroup
\ 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