Commit 7f6e6e34 authored by Titouan Soulard's avatar Titouan Soulard

erp5_trade: WIP add Offset Cell components for Offset Line and Cell

parent 792eb499
##############################################################################
#
# Copyright (c) 2024 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability 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
# garantees 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from erp5.component.document.DeliveryCell import DeliveryCell
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
class InventoryOffsetCell(DeliveryCell):
"""
An Inventory Offset Cell corresponds to the inventory
effective movement of a variated resource.
"""
meta_type = "ERP5 Inventory Offset Cell"
portal_type = "Inventory Offset Cell"
add_permission = Permissions.AddPortalContent
isInventoryMovement = ConstantGetter("isInventoryMovement", value=True)
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.InventoryMovement
, PropertySheet.Task
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.Predicate
, PropertySheet.MappedValue
, PropertySheet.ItemAggregation
)
<?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>InventoryOffsetCell</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InventoryOffsetCell</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>
##############################################################################
#
# Copyright (c) 2024 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability 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
# garantees 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet
from erp5.component.document.DeliveryLine import DeliveryLine
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
class InventoryOffsetLine(DeliveryLine):
"""
An Inventory Offset Line corresponds to the inventory
effective movement of a resource, by variations.
"""
meta_type = "ERP5 Inventory Offset Line"
portal_type = "Inventory Offset Line"
add_permission = Permissions.AddPortalContent
isInventoryMovement = ConstantGetter("isInventoryMovement", value=True)
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.InventoryMovement
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.VariationRange
, PropertySheet.ItemAggregation
)
<?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>InventoryOffsetLine</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InventoryOffsetLine</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>
......@@ -82,6 +82,9 @@
<portal_type id="Inventory Module">
<item>Inventory</item>
</portal_type>
<portal_type id="Inventory Offset Line">
<item>Inventory Offset Cell</item>
</portal_type>
<portal_type id="Inventory Report">
<item>Inventory Report Line</item>
</portal_type>
......
......@@ -8,6 +8,9 @@
<portal_type id="Internal Packing List Line">
<item>Internal Packing List Cell</item>
</portal_type>
<portal_type id="Inventory">
<item>Inventory Offset Line</item>
</portal_type>
<portal_type id="Inventory Line">
<item>Inventory Cell</item>
</portal_type>
......
<?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>document.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Inventory Offset Cell</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>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>InventoryOffsetCell</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,6 +75,10 @@
<type>Inventory Line</type>
<workflow>edit_workflow, pricing_interaction_workflow, trade_matrix_workflow</workflow>
</chain>
<chain>
<type>Inventory Offset Cell</type>
<workflow>edit_workflow, pricing_interaction_workflow</workflow>
</chain>
<chain>
<type>Inventory Offset Line</type>
<workflow>edit_workflow, pricing_interaction_workflow, trade_matrix_workflow</workflow>
......
......@@ -5,6 +5,8 @@ document.erp5.ContainerLine
document.erp5.DeliveryRootSimulationRule
document.erp5.DeliverySimulationRule
document.erp5.DuplicateInventoryConstraint
document.erp5.InventoryOffsetCell
document.erp5.InventoryOffsetLine
document.erp5.OrderCell
document.erp5.OrderLine
document.erp5.OrderRootSimulationRule
......
......@@ -39,6 +39,7 @@ Internal Trade Condition | Payment Condition
Internal Trade Condition | Trade Model Line
Inventory Line | Inventory Cell
Inventory Module | Inventory
Inventory Offset Line | Inventory Offset Cell
Inventory Report Module | Inventory Report
Inventory Report | Inventory Report Line
Inventory | Inventory Line
......
......@@ -2,6 +2,7 @@ Container Line | Container Cell
Internal Order Line | Internal Order Cell
Internal Packing List Line | Internal Packing List Cell
Inventory Line | Inventory Cell
Inventory | Inventory Offset Line
Preference | Purchase Order
Preference | Sale Order
Purchase Order Line | Purchase Order Cell
......
......@@ -25,6 +25,7 @@ Inventory
Inventory Cell
Inventory Line
Inventory Module
Inventory Offset Cell
Inventory Offset Line
Inventory Report
Inventory Report Line
......
......@@ -55,6 +55,8 @@ Inventory Cell | pricing_interaction_workflow
Inventory Line | edit_workflow
Inventory Line | pricing_interaction_workflow
Inventory Line | trade_matrix_workflow
Inventory Offset Cell | edit_workflow
Inventory Offset Cell | pricing_interaction_workflow
Inventory Offset Line | edit_workflow
Inventory Offset Line | pricing_interaction_workflow
Inventory Offset Line | trade_matrix_workflow
......
DeliveryNode
InventoryConstraint
InventoryReport
TradeModelLineCellConsistencyConstraint
TradeModelLineConstraint
DeliveryNode
InventoryReport
\ No newline at end of file
TradeModelLineConstraint
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment