Commit 718ee920 authored by Jérome Perrin's avatar Jérome Perrin

Don't copy Payment Condition and Discount from Order to Packing List, they...

Don't copy Payment Condition and Discount from Order to Packing List, they should not be present in Packing List.
Add a TODO marker for manually copied properties, it's better to use movement group instead.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20972 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7201a942
......@@ -65,38 +65,21 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
packing_list = context\n
<value> <string>packing_list = context\n
related_order = packing_list.getCausalityValue()\n
\n
if packing_list.getSimulationState() == \'draft\':\n
packing_list.edit(\n
comment = related_order.getComment(),\n
title = related_order.getTitle(),\n
\n
# TODO: use movement group instead of copying those categories:\n
delivery_mode = related_order.getDeliveryMode(),\n
incoterm = related_order.getIncoterm(),\n
source_administration_value = related_order.getSourceAdministrationValue()\n
)\n
\n
# copy PaymentCondition if none is defined on Packing List\n
filter_dict = {\'portal_type\': \'Payment Condition\'}\n
if len(packing_list.contentIds(filter = filter_dict)) == 0 :\n
to_copy = related_order.contentIds(filter = filter_dict)\n
if len(to_copy)>0 :\n
copy_data = related_order.manage_copyObjects(ids=to_copy)\n
new_id_list = packing_list.manage_pasteObjects(copy_data)\n
source_administration_value = related_order.getSourceAdministrationValue(),\n
\n
# copy Discount if none is defined on Packing List\n
filter_dict = {\'portal_type\': \'Discount\'}\n
if len(packing_list.contentIds(filter = filter_dict)) == 0 :\n
to_copy=[]\n
to_copy=related_order.contentIds(filter = filter_dict)\n
if len(to_copy)>0 :\n
copy_data = related_order.manage_copyObjects(ids=to_copy)\n
new_id_list = packing_list.manage_pasteObjects(copy_data)\n
]]></string> </value>
)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -110,6 +93,12 @@ if packing_list.getSimulationState() == \'draft\':\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
......@@ -142,11 +131,6 @@ if packing_list.getSimulationState() == \'draft\':\n
<string>packing_list</string>
<string>_getattr_</string>
<string>related_order</string>
<string>filter_dict</string>
<string>len</string>
<string>to_copy</string>
<string>copy_data</string>
<string>new_id_list</string>
</tuple>
</value>
</item>
......
361
\ No newline at end of file
362
\ 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