Commit 3c48ed49 authored by Klaus Wölfel's avatar Klaus Wölfel

erp5_interface_cxml: sale order cannot be planned without trade condition

parent faa8fd0c
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/xml</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleInvoiceTransaction_getInvoiceDetailRequest</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -119,8 +119,10 @@ def createSaleOrderLine(property_dict): ...@@ -119,8 +119,10 @@ def createSaleOrderLine(property_dict):
try: try:
resource_reference = property_dict.pop("resource_reference") resource_reference = property_dict.pop("resource_reference")
except KeyError: except KeyError:
resource_reference = None
if not resource_reference:
try: try:
reference = property_dict.pop('resource')['destination_reference'] reference = property_dict.pop('resource')['default_sale_supply_line_destination_reference']
except KeyError: except KeyError:
pass pass
else: else:
...@@ -225,15 +227,16 @@ for i, line in enumerate(line_list): ...@@ -225,15 +227,16 @@ for i, line in enumerate(line_list):
)) ))
break break
# for Sale Packing List also check that int_index is defined on related Sale Order Lines # for Sale Packing List and Sale Invoice also check that int_index is defined on related Sale Order Lines
for i, line in enumerate(line_list): if context.getPortalType() in ("Sale Packing List", "Sale Invoice Transaction"):
if line.DeliveryLine_getOrderLineIntIndex() is None: for i, line in enumerate(line_list):
#if fixit: if line.DeliveryLine_getOrderLineIntIndex() is None:
# line.setIntIndex(i) #if fixit:
#else: # line.setIntIndex(i)
error_list.append(translate( #else:
"Sort Index must be defined on all lines the related Sale Order." error_list.append(translate(
)) "Sort Index must be defined on all lines of the related Sale Order."
))
if line_portal_type == "Sale Order Line": if line_portal_type == "Sale Order Line":
index_method = "getIntIndex" index_method = "getIntIndex"
......
...@@ -3,6 +3,6 @@ context = state_change['object'] ...@@ -3,6 +3,6 @@ context = state_change['object']
# a Sale Order which is related to a valid Cxml Order Request # a Sale Order which is related to a valid Cxml Order Request
if not context.Base_isCxmlRelated(): if not context.Base_isCxmlRelated():
return return
text_content = context.SaleInvoiceTranaction_getInvoiceDetailRequest().encode('utf-8') text_content = context.SaleInvoiceTransaction_getInvoiceDetailRequest().encode('utf-8')
connector = context.Base_getCxmlConnectorValueForSale() connector = context.Base_getCxmlConnectorValueForSale()
connector.sendOutgoingRequest(text_content, follow_up=context.getRelativeUrl()) connector.sendOutgoingRequest(text_content, follow_up=context.getRelativeUrl())
...@@ -18,7 +18,6 @@ if state_change.kwargs.get('create_sale_order'): ...@@ -18,7 +18,6 @@ if state_change.kwargs.get('create_sale_order'):
if sale_order_value.getSimulationState() == "draft": if sale_order_value.getSimulationState() == "draft":
sale_order_value.SaleOrder_checkCxmlOrderRequestConsistency(fixit=True, order_request_value=context) sale_order_value.SaleOrder_checkCxmlOrderRequestConsistency(fixit=True, order_request_value=context)
sale_order_value.SaleOrder_cxmlInit() sale_order_value.SaleOrder_cxmlInit()
sale_order_value.plan()
else: else:
sale_order_value = context.getFollowUpValue() sale_order_value = context.getFollowUpValue()
if sale_order_value is None: if sale_order_value is None:
......
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