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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
6b957b22
Commit
6b957b22
authored
Aug 09, 2023
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: add individual delivery rule
parent
796e7780
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
402 additions
and
0 deletions
+402
-0
bt5/erp5_trade/ActionTemplateItem/portal_types/Individual%20Delivery%20Simulation%20Rule/view.xml
..._types/Individual%20Delivery%20Simulation%20Rule/view.xml
+79
-0
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.IndividualDeliverySimulationRule.py
...ponents/document.erp5.IndividualDeliverySimulationRule.py
+108
-0
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.IndividualDeliverySimulationRule.xml
...onents/document.erp5.IndividualDeliverySimulationRule.xml
+112
-0
bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
...eAllowedContentTypeTemplateItem/allowed_content_types.xml
+11
-0
bt5/erp5_trade/PortalTypeTemplateItem/portal_types/Individual%20Delivery%20Simulation%20Rule.xml
...ortal_types/Individual%20Delivery%20Simulation%20Rule.xml
+74
-0
bt5/erp5_trade/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+4
-0
bt5/erp5_trade/bt/template_action_path_list
bt5/erp5_trade/bt/template_action_path_list
+1
-0
bt5/erp5_trade/bt/template_document_id_list
bt5/erp5_trade/bt/template_document_id_list
+1
-0
bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list
...5_trade/bt/template_portal_type_allowed_content_type_list
+9
-0
bt5/erp5_trade/bt/template_portal_type_id_list
bt5/erp5_trade/bt/template_portal_type_id_list
+1
-0
bt5/erp5_trade/bt/template_portal_type_workflow_chain_list
bt5/erp5_trade/bt/template_portal_type_workflow_chain_list
+2
-0
No files found.
bt5/erp5_trade/ActionTemplateItem/portal_types/Individual%20Delivery%20Simulation%20Rule/view.xml
0 → 100644
View file @
6b957b22
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
View
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Rule_view
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.IndividualDeliverySimulationRule.py
0 → 100644
View file @
6b957b22
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 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.
#
##############################################################################
import
zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.mixin.RuleMixin
import
RuleMixin
from
erp5.component.mixin.MovementGeneratorMixin
import
MovementGeneratorMixin
from
erp5.component.mixin.MovementCollectionUpdaterMixin
import
\
MovementCollectionUpdaterMixin
from
erp5.component.interface.IRule
import
IRule
from
erp5.component.interface.IDivergenceController
import
IDivergenceController
from
erp5.component.interface.IMovementCollectionUpdater
import
IMovementCollectionUpdater
@
zope
.
interface
.
implementer
(
IRule
,
IDivergenceController
,
IMovementCollectionUpdater
,)
class
IndividualDeliverySimulationRule
(
RuleMixin
,
MovementCollectionUpdaterMixin
):
"""
Delivery Rule object make sure an Delivery in the simulation
is consistent with the real delivery
WARNING: what to do with movement split ?
"""
# CMF Type Definition
meta_type
=
'ERP5 Individual Delivery Simulation Rule'
portal_type
=
'Individual Delivery Simulation Rule'
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Default Properties
property_sheets
=
(
PropertySheet
.
Base
,
PropertySheet
.
XMLObject
,
PropertySheet
.
CategoryCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
Task
,
PropertySheet
.
Predicate
,
PropertySheet
.
Reference
,
PropertySheet
.
Version
,
PropertySheet
.
Rule
)
def
_getMovementGenerator
(
self
,
context
):
"""
Return the movement generator to use in the expand process
"""
return
DeliveryRuleMovementGenerator
(
applied_rule
=
context
,
rule
=
self
)
def
_isProfitAndLossMovement
(
self
,
movement
):
# For a kind of trade rule, a profit and loss movement lacks source
# or destination.
return
(
movement
.
getSource
()
is
None
or
movement
.
getDestination
()
is
None
)
class
DeliveryRuleMovementGenerator
(
MovementGeneratorMixin
):
def
_getUpdatePropertyDict
(
self
,
input_movement
):
# Override default mixin implementation
return
{
'order'
:
None
,
'delivery'
:
None
,}
def
_getInputMovementList
(
self
,
movement_list
=
None
,
rounding
=
None
):
movement_list
=
[]
parent_value
=
self
.
_applied_rule
.
getParentValue
()
root_referene
=
parent_value
.
getExplanationReference
()
delivery_id
=
parent_value
.
getDeliveryId
()
resource_reference
=
parent_value
.
getResourceReference
()
movement_reference
=
"%s-%s-%s"
%
(
root_referene
,
delivery_id
,
resource_reference
)
for
index
in
range
(
int
(
parent_value
.
getQuantity
())):
tmp
=
parent_value
.
asContext
()
tmp
.
edit
(
quantity
=
1
,
reference
=
'%s-%s'
%
(
movement_reference
,
index
)
)
movement_list
.
append
(
tmp
)
return
movement_list
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.IndividualDeliverySimulationRule.xml
0 → 100644
View file @
6b957b22
<?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>
IndividualDeliverySimulationRule
</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.IndividualDeliverySimulationRule
</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>
bt5/erp5_trade/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
View file @
6b957b22
...
@@ -45,6 +45,16 @@
...
@@ -45,6 +45,16 @@
<item>
String Divergence Tester
</item>
<item>
String Divergence Tester
</item>
<item>
Variation Divergence Tester
</item>
<item>
Variation Divergence Tester
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Individual Delivery Simulation Rule"
>
<item>
Category Membership Divergence Tester
</item>
<item>
DateTime Divergence Tester
</item>
<item>
Filtered Category Membership Equivalence Tester
</item>
<item>
Float Divergence Tester
</item>
<item>
Net Converted Quantity Divergence Tester
</item>
<item>
Specialise Divergence Tester
</item>
<item>
String Divergence Tester
</item>
<item>
Variation Divergence Tester
</item>
</portal_type>
<portal_type
id=
"Internal Order"
>
<portal_type
id=
"Internal Order"
>
<item>
Internal Order Line
</item>
<item>
Internal Order Line
</item>
<item>
Payment Condition
</item>
<item>
Payment Condition
</item>
...
@@ -183,6 +193,7 @@
...
@@ -183,6 +193,7 @@
<portal_type
id=
"Rule Tool"
>
<portal_type
id=
"Rule Tool"
>
<item>
Delivery Root Simulation Rule
</item>
<item>
Delivery Root Simulation Rule
</item>
<item>
Delivery Simulation Rule
</item>
<item>
Delivery Simulation Rule
</item>
<item>
Individual Delivery Simulation Rule
</item>
<item>
Order Root Simulation Rule
</item>
<item>
Order Root Simulation Rule
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Sale Order"
>
<portal_type
id=
"Sale Order"
>
...
...
bt5/erp5_trade/PortalTypeTemplateItem/portal_types/Individual%20Delivery%20Simulation%20Rule.xml
0 → 100644
View file @
6b957b22
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Base Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
acquire_local_roles
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
content_icon
</string>
</key>
<value>
<string>
rule_icon.gif
</string>
</value>
</item>
<item>
<key>
<string>
content_meta_type
</string>
</key>
<value>
<string>
ERP5 Delivery Simulation Rule
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
An ERP5 Rule...
</string>
</value>
</item>
<item>
<key>
<string>
factory
</string>
</key>
<value>
<string>
addDeliverySimulationRule
</string>
</value>
</item>
<item>
<key>
<string>
filter_content_types
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<tuple>
<string>
rule
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Individual Delivery Simulation Rule
</string>
</value>
</item>
<item>
<key>
<string>
init_script
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
IndividualDeliverySimulationRule
</string>
</value>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
6b957b22
...
@@ -35,6 +35,10 @@
...
@@ -35,6 +35,10 @@
<type>
Delivery Simulation Rule
</type>
<type>
Delivery Simulation Rule
</type>
<workflow>
edit_workflow, rule_validation_workflow
</workflow>
<workflow>
edit_workflow, rule_validation_workflow
</workflow>
</chain>
</chain>
<chain>
<type>
Individual Delivery Simulation Rule
</type>
<workflow>
edit_workflow, rule_validation_workflow
</workflow>
</chain>
<chain>
<chain>
<type>
Internal Order
</type>
<type>
Internal Order
</type>
<workflow>
delivery_causality_interaction_workflow, delivery_causality_workflow, delivery_simulation_interaction_workflow, edit_workflow, order_workflow
</workflow>
<workflow>
delivery_causality_interaction_workflow, delivery_causality_workflow, delivery_simulation_interaction_workflow, edit_workflow, order_workflow
</workflow>
...
...
bt5/erp5_trade/bt/template_action_path_list
View file @
6b957b22
...
@@ -14,6 +14,7 @@ Delivery Root Simulation Rule | view
...
@@ -14,6 +14,7 @@ Delivery Root Simulation Rule | view
Delivery Simulation Rule | view
Delivery Simulation Rule | view
Duplicate Inventory Constraint | view
Duplicate Inventory Constraint | view
First Causality Movement Group | view
First Causality Movement Group | view
Individual Delivery Simulation Rule | view
Internal Order Cell | view
Internal Order Cell | view
Internal Order Line | price_view
Internal Order Line | price_view
Internal Order Line | profile_view
Internal Order Line | profile_view
...
...
bt5/erp5_trade/bt/template_document_id_list
View file @
6b957b22
...
@@ -5,6 +5,7 @@ document.erp5.ContainerLine
...
@@ -5,6 +5,7 @@ document.erp5.ContainerLine
document.erp5.DeliveryRootSimulationRule
document.erp5.DeliveryRootSimulationRule
document.erp5.DeliverySimulationRule
document.erp5.DeliverySimulationRule
document.erp5.DuplicateInventoryConstraint
document.erp5.DuplicateInventoryConstraint
document.erp5.IndividualDeliverySimulationRule
document.erp5.OrderCell
document.erp5.OrderCell
document.erp5.OrderLine
document.erp5.OrderLine
document.erp5.OrderRootSimulationRule
document.erp5.OrderRootSimulationRule
...
...
bt5/erp5_trade/bt/template_portal_type_allowed_content_type_list
View file @
6b957b22
...
@@ -26,6 +26,14 @@ Delivery Simulation Rule | Net Converted Quantity Divergence Tester
...
@@ -26,6 +26,14 @@ Delivery Simulation Rule | Net Converted Quantity Divergence Tester
Delivery Simulation Rule | Specialise Divergence Tester
Delivery Simulation Rule | Specialise Divergence Tester
Delivery Simulation Rule | String Divergence Tester
Delivery Simulation Rule | String Divergence Tester
Delivery Simulation Rule | Variation Divergence Tester
Delivery Simulation Rule | Variation Divergence Tester
Individual Delivery Simulation Rule | Category Membership Divergence Tester
Individual Delivery Simulation Rule | DateTime Divergence Tester
Individual Delivery Simulation Rule | Filtered Category Membership Equivalence Tester
Individual Delivery Simulation Rule | Float Divergence Tester
Individual Delivery Simulation Rule | Net Converted Quantity Divergence Tester
Individual Delivery Simulation Rule | Specialise Divergence Tester
Individual Delivery Simulation Rule | String Divergence Tester
Individual Delivery Simulation Rule | Variation Divergence Tester
Internal Order Line | Internal Order Cell
Internal Order Line | Internal Order Cell
Internal Order Line | Internal Order Line
Internal Order Line | Internal Order Line
Internal Order Module | Internal Order
Internal Order Module | Internal Order
...
@@ -89,6 +97,7 @@ Returned Sale Packing List | Payment Condition
...
@@ -89,6 +97,7 @@ Returned Sale Packing List | Payment Condition
Returned Sale Packing List | Returned Sale Packing List Line
Returned Sale Packing List | Returned Sale Packing List Line
Rule Tool | Delivery Root Simulation Rule
Rule Tool | Delivery Root Simulation Rule
Rule Tool | Delivery Simulation Rule
Rule Tool | Delivery Simulation Rule
Rule Tool | Individual Delivery Simulation Rule
Rule Tool | Order Root Simulation Rule
Rule Tool | Order Root Simulation Rule
Sale Order Line | Sale Order Cell
Sale Order Line | Sale Order Cell
Sale Order Line | Sale Order Line
Sale Order Line | Sale Order Line
...
...
bt5/erp5_trade/bt/template_portal_type_id_list
View file @
6b957b22
...
@@ -11,6 +11,7 @@ Delivery Root Simulation Rule
...
@@ -11,6 +11,7 @@ Delivery Root Simulation Rule
Delivery Simulation Rule
Delivery Simulation Rule
Duplicate Inventory Constraint
Duplicate Inventory Constraint
First Causality Movement Group
First Causality Movement Group
Individual Delivery Simulation Rule
Internal Order
Internal Order
Internal Order Cell
Internal Order Cell
Internal Order Line
Internal Order Line
...
...
bt5/erp5_trade/bt/template_portal_type_workflow_chain_list
View file @
6b957b22
...
@@ -19,6 +19,8 @@ Delivery Root Simulation Rule | edit_workflow
...
@@ -19,6 +19,8 @@ Delivery Root Simulation Rule | edit_workflow
Delivery Root Simulation Rule | rule_validation_workflow
Delivery Root Simulation Rule | rule_validation_workflow
Delivery Simulation Rule | edit_workflow
Delivery Simulation Rule | edit_workflow
Delivery Simulation Rule | rule_validation_workflow
Delivery Simulation Rule | rule_validation_workflow
Individual Delivery Simulation Rule | edit_workflow
Individual Delivery Simulation Rule | rule_validation_workflow
Internal Order Cell | delivery_movement_causality_interaction_workflow
Internal Order Cell | delivery_movement_causality_interaction_workflow
Internal Order Cell | delivery_movement_simulation_interaction_workflow
Internal Order Cell | delivery_movement_simulation_interaction_workflow
Internal Order Cell | edit_workflow
Internal Order Cell | edit_workflow
...
...
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