Commit 5b245984 authored by Sebastien Robin's avatar Sebastien Robin

trade: make line fast input dialog usable on containers

parent bd822a07
<?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_fast_input</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_fast_input</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>fast_input</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Add portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Add Lines</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}/Delivery_checkConsistencyForDeliveryFastInputDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -3,18 +3,23 @@ If validation succeeds, then form_dialog is returned. ...@@ -3,18 +3,23 @@ If validation succeeds, then form_dialog is returned.
Otherwise a message is displayed to the user. Otherwise a message is displayed to the user.
""" """
portal = context.getPortalObject() portal = context.getPortalObject()
delivery = context
if delivery.getPortalType() in portal.getPortalContainerTypeList():
delivery = context.getExplanationValue()
# Retrieve lines portal type # Retrieve lines portal type
line_portal_type_list = [x for x in context.getTypeInfo().getTypeAllowedContentTypeList() \ line_portal_type_list = [x for x in delivery.getTypeInfo().getTypeAllowedContentTypeList() \
if x in portal.getPortalMovementTypeList()] if x in portal.getPortalMovementTypeList()]
line_portal_type = line_portal_type_list[0] line_portal_type = line_portal_type_list[0]
use_list = [] use_list = []
# Check if the section and use preference are defined # Check if the section and use preference are defined
if line_portal_type in context.getPortalSaleTypeList(): if line_portal_type in portal.getPortalSaleTypeList():
section_uid = context.getSourceSectionUid() section_uid = delivery.getSourceSectionUid()
use_list = portal.portal_preferences.getPreferredSaleUseList() use_list = portal.portal_preferences.getPreferredSaleUseList()
elif line_portal_type in portal.getPortalPurchaseTypeList(): elif line_portal_type in portal.getPortalPurchaseTypeList():
section_uid = context.getDestinationSectionUid() section_uid = delivery.getDestinationSectionUid()
use_list = portal.portal_preferences.getPreferredPurchaseUseList() use_list = portal.portal_preferences.getPreferredPurchaseUseList()
elif line_portal_type in portal.getPortalInternalTypeList() + portal.getPortalInventoryMovementTypeList(): elif line_portal_type in portal.getPortalInternalTypeList() + portal.getPortalInventoryMovementTypeList():
section_uid = "" section_uid = ""
......
...@@ -14,19 +14,23 @@ check_stock_availability = False ...@@ -14,19 +14,23 @@ check_stock_availability = False
portal = context.getPortalObject() portal = context.getPortalObject()
Base_translateString = portal.Base_translateString Base_translateString = portal.Base_translateString
delivery = context
if delivery.getPortalType() in portal.getPortalContainerTypeList():
delivery = context.getExplanationValue()
# Retrieve lines portal type # Retrieve lines portal type
line_portal_type_list = [x for x in context.getTypeInfo().getTypeAllowedContentTypeList() \ line_portal_type_list = [x for x in delivery.getTypeInfo().getTypeAllowedContentTypeList() \
if x in portal.getPortalMovementTypeList()] if x in portal.getPortalMovementTypeList()]
line_portal_type = line_portal_type_list[0] line_portal_type = line_portal_type_list[0]
if line_portal_type in portal.getPortalSaleTypeList(): if line_portal_type in portal.getPortalSaleTypeList():
section_uid = context.getSourceSectionUid() section_uid = delivery.getSourceSectionUid()
supply_cell_portal_type = "Sale Supply Cell" supply_cell_portal_type = "Sale Supply Cell"
supply_line_id = "default_ssl" supply_line_id = "default_ssl"
use_list = portal.portal_preferences.getPreferredSaleUseList() use_list = portal.portal_preferences.getPreferredSaleUseList()
check_stock_availability = True check_stock_availability = True
elif line_portal_type in portal.getPortalPurchaseTypeList(): elif line_portal_type in portal.getPortalPurchaseTypeList():
section_uid = context.getDestinationSectionUid() section_uid = delivery.getDestinationSectionUid()
supply_cell_portal_type = "Purchase Supply Cell" supply_cell_portal_type = "Purchase Supply Cell"
supply_line_id = "default_psl" supply_line_id = "default_psl"
use_list = portal.portal_preferences.getPreferredPurchaseUseList() use_list = portal.portal_preferences.getPreferredPurchaseUseList()
......
...@@ -27,7 +27,10 @@ if resource_value is None: ...@@ -27,7 +27,10 @@ if resource_value is None:
if resource_value is None and (resource_title or resource_reference): if resource_value is None and (resource_title or resource_reference):
# Querying catalog to find a resource according title and reference parameters # Querying catalog to find a resource according title and reference parameters
# like Delivery_updateFastInputLineList does. # like Delivery_updateFastInputLineList does.
line_portal_type_list = [x for x in context.getTypeInfo().getTypeAllowedContentTypeList() \ delivery = context
if delivery.getPortalType() in portal.getPortalContainerLineTypeList():
delivery = context.getExplanationValue()
line_portal_type_list = [x for x in delivery.getTypeInfo().getTypeAllowedContentTypeList() \
if x in portal.getPortalMovementTypeList()] if x in portal.getPortalMovementTypeList()]
line_portal_type = line_portal_type_list[0] line_portal_type = line_portal_type_list[0]
......
...@@ -6,6 +6,7 @@ Business Process | view ...@@ -6,6 +6,7 @@ Business Process | view
Component Module | jump_to_related_sale_packing_list Component Module | jump_to_related_sale_packing_list
Container Line | view Container Line | view
Container Line | view_quantity Container Line | view_quantity
Container | fast_input
Container | view Container | view
Delivery Cell | view Delivery Cell | view
Delivery Node Module | view Delivery Node Module | view
......
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