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