Commit 26a790db authored by Jérome Perrin's avatar Jérome Perrin

Support lines where source and destination, source_section and...

Support lines where source and destination, source_section and destination_section are the same, they should be included twice

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29983 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4700fbc5
...@@ -57,9 +57,17 @@ ...@@ -57,9 +57,17 @@
destination reference.\n destination reference.\n
"""\n """\n
delivery = brain.getObject().getExplanationValue()\n delivery = brain.getObject().getExplanationValue()\n
if delivery.getSourceSectionUid() == brain.section_uid:\n if brain.section_uid != brain.mirror_section_uid:\n
return delivery.getSourceReference()\n if delivery.getSourceSectionUid() == brain.section_uid:\n
return delivery.getDestinationReference()\n return delivery.getSourceReference()\n
return delivery.getDestinationReference()\n
\n
# If we have a movement which exists for both section uid and mirror section uid,\n
# we can only guess what reference should be used.\n
if round(brain.total_quantity - brain.getObject().getQuantity(), 5) == 0:\n
return delivery.getDestinationReference()\n
\n
return delivery.getSourceReference()\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -101,6 +109,7 @@ return delivery.getDestinationReference()\n ...@@ -101,6 +109,7 @@ return delivery.getDestinationReference()\n
<string>kwd</string> <string>kwd</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>delivery</string> <string>delivery</string>
<string>round</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -87,6 +87,7 @@ if node_category:\n ...@@ -87,6 +87,7 @@ if node_category:\n
if not \'parent_portal_type\' in params:\n if not \'parent_portal_type\' in params:\n
params.setdefault(\'portal_type\', portal.getPortalAccountingMovementTypeList())\n params.setdefault(\'portal_type\', portal.getPortalAccountingMovementTypeList())\n
\n \n
\n
# Create the related accouting line list\n # Create the related accouting line list\n
new_result = []\n new_result = []\n
net_balance = 0.0\n net_balance = 0.0\n
...@@ -189,12 +190,14 @@ if from_date or node_account_type in (\'expense\', \'income\'):\n ...@@ -189,12 +190,14 @@ if from_date or node_account_type in (\'expense\', \'income\'):\n
selection_domain=context.portal_selections.getSelectionDomainDictFor(selection_name),\n selection_domain=context.portal_selections.getSelectionDomainDictFor(selection_name),\n
selection_domain_join_column=\'section_uid\',\n selection_domain_join_column=\'section_uid\',\n
sort_on=sort_on,\n sort_on=sort_on,\n
ignore_group_by=True,\n
**params))\n **params))\n
return new_result\n return new_result\n
\n \n
if context.portal_selections.getSelectionParamsFor(selection_name).get(\'hide_grouping\'):\n if context.portal_selections.getSelectionParamsFor(selection_name).get(\'hide_grouping\'):\n
params[\'where_expression\'] = \'catalog.grouping_reference is NULL\'\n params[\'where_expression\'] = \'catalog.grouping_reference is NULL\'\n
\n \n
\n
# We try not to convert to a list, hence the copy & paste\n # We try not to convert to a list, hence the copy & paste\n
return portal.portal_simulation.getMovementHistoryList(\n return portal.portal_simulation.getMovementHistoryList(\n
from_date=from_date,\n from_date=from_date,\n
...@@ -203,6 +206,7 @@ return portal.portal_simulation.getMovementHistoryList(\n ...@@ -203,6 +206,7 @@ return portal.portal_simulation.getMovementHistoryList(\n
selection_domain=context.portal_selections.getSelectionDomainDictFor(selection_name),\n selection_domain=context.portal_selections.getSelectionDomainDictFor(selection_name),\n
selection_domain_join_column=\'section_uid\',\n selection_domain_join_column=\'section_uid\',\n
sort_on=sort_on,\n sort_on=sort_on,\n
ignore_group_by=True,\n
**params)\n **params)\n
......
1014 1019
\ 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