Commit a07fb4d1 authored by Jérome Perrin's avatar Jérome Perrin

build accounting lines (and payment lines) only for this invoice, packing list...

build accounting lines (and payment lines) only for this invoice, packing list and order, by passing explanation_uid (like in order and packing list workflow)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25354 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6986f948
...@@ -106,15 +106,29 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n ...@@ -106,15 +106,29 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n
# build accounting lines\n # build accounting lines\n
method_id_list = (\'expand\', \'edit\', \'updateAppliedRule\', \'Delivery_updateAppliedRule\',\n method_id_list = (\'expand\', \'edit\', \'updateAppliedRule\', \'Delivery_updateAppliedRule\',\n
\'immediateReindexObject\', \'recursiveImmediateReindexObject\')\n \'immediateReindexObject\', \'recursiveImmediateReindexObject\')\n
\n
explanation_uid_list = [delivery.getUid(), ]\n
packing_list = delivery.getCausalityValue(\n
portal_type=(\'Sale Packing List\',\n
\'Purchase Packing List\'))\n
if packing_list is not None:\n
explanation_uid_list.append(packing_list.getUid())\n
order = packing_list.getCausalityValue(\n
portal_type=(\'Sale Order\',\n
\'Purchase Order\'))\n
if order is not None:\n
explanation_uid_list.append(order.getUid())\n
\n
\n \n
tag = \'invoice_transaction_build_%s\' % delivery.getRelativeUrl()\n tag = \'invoice_transaction_build_%s\' % delivery.getRelativeUrl()\n
builder.activate(\n builder.activate(\n
after_method_id=method_id_list,\n after_method_id=method_id_list,\n
tag=tag,\n tag=tag,\n
activate_kw=dict(tag=tag)).build(activate_kw=dict(tag=tag))\n activate_kw=dict(tag=tag)).build(activate_kw=dict(tag=tag),\n
explanation_uid=explanation_uid_list)\n
\n \n
# build related payment transactions\n # build related payment transactions\n
portal_deliveries.payment_transaction_builder.activate(after_method_id=method_id_list).build()\n portal_deliveries.payment_transaction_builder.activate(after_method_id=method_id_list).build(explanation_uid=explanation_uid_list)\n
\n \n
# set the object in building state.\n # set the object in building state.\n
delivery.startBuilding()\n delivery.startBuilding()\n
...@@ -173,6 +187,9 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n ...@@ -173,6 +187,9 @@ if builder_by_ptype.has_key(delivery_portal_type) :\n
<string>expand_tag</string> <string>expand_tag</string>
<string>activate_kw</string> <string>activate_kw</string>
<string>method_id_list</string> <string>method_id_list</string>
<string>explanation_uid_list</string>
<string>packing_list</string>
<string>order</string>
<string>tag</string> <string>tag</string>
<string>dict</string> <string>dict</string>
</tuple> </tuple>
......
852 853
\ No newline at end of file \ 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