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

aggregate relation must be set from the invoice to the transmission sheet. Fix scripts and forms.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10076 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 27be1b69
<base_category_list>
<portal_type id="Purchase Invoice Transmission Sheet">
<portal_type id="Purchase Invoice Transaction">
<item>aggregate</item>
</portal_type>
<portal_type id="Sale Invoice Transaction">
<item>aggregate</item>
</portal_type>
</base_category_list>
\ No newline at end of file
......@@ -71,11 +71,13 @@
<value> <string>selection = context.portal_selections.getSelectionFor(\n
"transmission_sheet_add_invoice_selection")\n
\n
context.setAggregateUidList(context.getAggregateUidList() \\\n
+ (selection.getCheckedUids() or uids))\n
for uid in uids:\n
invoice = context.portal_catalog.getObject(uid)\n
aggregate_list = invoice.getAggregateValueList()\n
invoice.setAggregateValueList(aggregate_list + [context])\n
\n
return context.REQUEST.RESPONSE.redirect(\n
"%s/view?portal_status_message=Invoice+Added" % context.absolute_url())\n
"%s/view?portal_status_message=Invoice+Added." % context.absolute_url())\n
</string> </value>
</item>
<item>
......@@ -135,6 +137,10 @@ return context.REQUEST.RESPONSE.redirect(\n
<string>_getattr_</string>
<string>context</string>
<string>selection</string>
<string>_getiter_</string>
<string>uid</string>
<string>invoice</string>
<string>aggregate_list</string>
</tuple>
</value>
</item>
......
......@@ -69,13 +69,14 @@
<item>
<key> <string>_body</string> </key>
<value> <string>selection = context.portal_selections.getSelectionFor(\n
\'purchase_invoice_transmission_sheet_selection\')\n
\'purchase_invoice_transmission_sheet_list_selection\')\n
\n
context.log(\'selection_uid\', selection.getCheckedUids())\n
removed_uid_list = (selection.getCheckedUids() or uids)\n
if not removed_uid_list:\n
return context.REQUEST.RESPONSE.redirect(\n
"%s/view?portal_status_message=Select+Invoices+to+Remove" % context.absolute_url())\n
for uid in selection.getCheckedUids():\n
invoice = context.portal_catalog.getObject(uid)\n
aggregate_list = invoice.getAggregateValueList()\n
if context in aggregate_list :\n
aggregate_list.remove(context) \n
invoice.setAggregateValueList(aggregate_list)\n
\n
old_uid_list = context.getAggregateUidList()\n
context.setAggregateUidList([uid for uid in old_uid_list if uid not in removed_uid_list])\n
......@@ -141,12 +142,14 @@ return context.REQUEST.RESPONSE.redirect(\n
<string>_getattr_</string>
<string>context</string>
<string>selection</string>
<string>removed_uid_list</string>
<string>_getiter_</string>
<string>uid</string>
<string>invoice</string>
<string>aggregate_list</string>
<string>old_uid_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>uid</string>
<string>removed_uid_list</string>
</tuple>
</value>
</item>
......
......@@ -338,7 +338,7 @@
<value>
<list>
<tuple>
<string>getDestinationSectionTitle</string>
<string>getSourceSectionTitle</string>
<string>Third Party</string>
</tuple>
<tuple>
......@@ -530,7 +530,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>getAggregateValueList</string> </value>
<value> <string>getAggregateRelatedValueList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -341,6 +341,10 @@
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>source_section_title</string>
<string>Section Title</string>
......
......@@ -569,7 +569,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>getAggregateValueList</string> </value>
<value> <string>getAggregateRelatedValueList</string> </value>
</item>
</dictionary>
</pickle>
......
4
\ No newline at end of file
5
\ No newline at end of file
Purchase Invoice Transmission Sheet | aggregate
\ No newline at end of file
Purchase Invoice Transaction | aggregate
Sale Invoice Transaction | aggregate
\ 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