Commit 7aa15ad4 authored by Jérome Perrin's avatar Jérome Perrin

add source_funding and destination_funding, and make it possible to do

inventory queries by funding


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39697 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a58b6bde
...@@ -325,6 +325,7 @@ class Arrow: ...@@ -325,6 +325,7 @@ class Arrow:
'source_carrier', 'destination_carrier', 'source_carrier', 'destination_carrier',
'source_referral', 'destination_referral', 'source_referral', 'destination_referral',
'source_account', 'destination_account', 'source_account', 'destination_account',
'source_funding', 'destination_funding',
#'source_advice', 'destination_advice', #'source_advice', 'destination_advice',
#'source_transport', 'destination_transport', #'source_transport', 'destination_transport',
# Virtual categories # Virtual categories
......
...@@ -575,13 +575,13 @@ class SimulationTool(BaseTool): ...@@ -575,13 +575,13 @@ class SimulationTool(BaseTool):
# instances # instances
resource=None, node=None, payment=None, resource=None, node=None, payment=None,
section=None, mirror_section=None, item=None, section=None, mirror_section=None, item=None,
function=None, project=None, transformed_resource=None, function=None, project=None, funding=None, transformed_resource=None,
# used for tracking # used for tracking
input=0, output=0, input=0, output=0,
# categories # categories
resource_category=None, node_category=None, payment_category=None, resource_category=None, node_category=None, payment_category=None,
section_category=None, mirror_section_category=None, section_category=None, mirror_section_category=None,
function_category=None, project_category=None, function_category=None, project_category=None, funding_category=None,
# categories with strict membership # categories with strict membership
resource_category_strict_membership=None, resource_category_strict_membership=None,
node_category_strict_membership=None, node_category_strict_membership=None,
...@@ -590,6 +590,7 @@ class SimulationTool(BaseTool): ...@@ -590,6 +590,7 @@ class SimulationTool(BaseTool):
mirror_section_category_strict_membership=None, mirror_section_category_strict_membership=None,
function_category_strict_membership=None, function_category_strict_membership=None,
project_category_strict_membership=None, project_category_strict_membership=None,
funding_category_strict_membership=None,
# simulation_state # simulation_state
strict_simulation_state=0, strict_simulation_state=0,
simulation_state=None, transit_simulation_state = None, omit_transit=0, simulation_state=None, transit_simulation_state = None, omit_transit=0,
...@@ -602,7 +603,7 @@ class SimulationTool(BaseTool): ...@@ -602,7 +603,7 @@ class SimulationTool(BaseTool):
# uids # uids
resource_uid=None, node_uid=None, section_uid=None, payment_uid=None, resource_uid=None, node_uid=None, section_uid=None, payment_uid=None,
mirror_node_uid=None, mirror_section_uid=None, function_uid=None, mirror_node_uid=None, mirror_section_uid=None, function_uid=None,
project_uid=None, project_uid=None, funding_uid=None,
# omit input and output # omit input and output
omit_input=0, omit_input=0,
omit_output=0, omit_output=0,
...@@ -631,6 +632,9 @@ class SimulationTool(BaseTool): ...@@ -631,6 +632,9 @@ class SimulationTool(BaseTool):
group_by_project=0, group_by_project=0,
group_by_project_category=0, group_by_project_category=0,
group_by_project_category_strict_membership=0, group_by_project_category_strict_membership=0,
group_by_funding=0,
group_by_funding_category=0,
group_by_funding_category_strict_membership=0,
group_by_function=0, group_by_function=0,
group_by_function_category=0, group_by_function_category=0,
group_by_function_category_strict_membership=0, group_by_function_category_strict_membership=0,
...@@ -694,6 +698,7 @@ class SimulationTool(BaseTool): ...@@ -694,6 +698,7 @@ class SimulationTool(BaseTool):
column_value_dict.set('resource_uid', resource_uid) column_value_dict.set('resource_uid', resource_uid)
column_value_dict.set('payment_uid', payment_uid) column_value_dict.set('payment_uid', payment_uid)
column_value_dict.set('project_uid', project_uid) column_value_dict.set('project_uid', project_uid)
column_value_dict.set('funding_uid', funding_uid)
column_value_dict.set('function_uid', function_uid) column_value_dict.set('function_uid', function_uid)
if column_value_dict.set('section_uid', section_uid): if column_value_dict.set('section_uid', section_uid):
sql_kw['section_filtered'] = 1 sql_kw['section_filtered'] = 1
...@@ -705,6 +710,7 @@ class SimulationTool(BaseTool): ...@@ -705,6 +710,7 @@ class SimulationTool(BaseTool):
column_value_dict.setUIDList('node_uid', node) column_value_dict.setUIDList('node_uid', node)
column_value_dict.setUIDList('payment_uid', payment) column_value_dict.setUIDList('payment_uid', payment)
column_value_dict.setUIDList('project_uid', project) column_value_dict.setUIDList('project_uid', project)
column_value_dict.setUIDList('funding_uid', funding)
column_value_dict.setUIDList('function_uid', function) column_value_dict.setUIDList('function_uid', function)
sql_kw['transformed_uid'] = self._generatePropertyUidList(transformed_resource) sql_kw['transformed_uid'] = self._generatePropertyUidList(transformed_resource)
...@@ -723,6 +729,7 @@ class SimulationTool(BaseTool): ...@@ -723,6 +729,7 @@ class SimulationTool(BaseTool):
related_key_dict.setUIDList('resource_category_uid', resource_category) related_key_dict.setUIDList('resource_category_uid', resource_category)
related_key_dict.setUIDList('node_category_uid', node_category) related_key_dict.setUIDList('node_category_uid', node_category)
related_key_dict.setUIDList('project_category_uid', project_category) related_key_dict.setUIDList('project_category_uid', project_category)
related_key_dict.setUIDList('funding_category_uid', funding_category)
related_key_dict.setUIDList('function_category_uid', function_category) related_key_dict.setUIDList('function_category_uid', function_category)
related_key_dict.setUIDList('payment_category_uid', payment_category) related_key_dict.setUIDList('payment_category_uid', payment_category)
if related_key_dict.setUIDList('section_category_uid', if related_key_dict.setUIDList('section_category_uid',
...@@ -737,6 +744,8 @@ class SimulationTool(BaseTool): ...@@ -737,6 +744,8 @@ class SimulationTool(BaseTool):
node_category_strict_membership) node_category_strict_membership)
related_key_dict.setUIDList('project_category_strict_membership_uid', related_key_dict.setUIDList('project_category_strict_membership_uid',
project_category_strict_membership) project_category_strict_membership)
related_key_dict.setUIDList('funding_category_strict_membership_uid',
funding_category_strict_membership)
related_key_dict.setUIDList('function_category_strict_membership_uid', related_key_dict.setUIDList('function_category_strict_membership_uid',
function_category_strict_membership) function_category_strict_membership)
related_key_dict.setUIDList('payment_category_strict_membership_uid', related_key_dict.setUIDList('payment_category_strict_membership_uid',
...@@ -839,6 +848,8 @@ class SimulationTool(BaseTool): ...@@ -839,6 +848,8 @@ class SimulationTool(BaseTool):
column_group_by_expression_list.append('resource_uid') column_group_by_expression_list.append('resource_uid')
if group_by_project: if group_by_project:
column_group_by_expression_list.append('project_uid') column_group_by_expression_list.append('project_uid')
if group_by_funding:
column_group_by_expression_list.append('funding_uid')
if group_by_function: if group_by_function:
column_group_by_expression_list.append('function_uid') column_group_by_expression_list.append('function_uid')
if group_by_date: if group_by_date:
...@@ -902,6 +913,14 @@ class SimulationTool(BaseTool): ...@@ -902,6 +913,14 @@ class SimulationTool(BaseTool):
'project_category_strict_membership_uid') 'project_category_strict_membership_uid')
related_key_select_expression_list.append( related_key_select_expression_list.append(
'project_category_strict_membership_uid') 'project_category_strict_membership_uid')
if group_by_funding_category:
related_key_group_by_expression_list.append('funding_category_uid')
related_key_select_expression_list.append('funding_category_uid')
if group_by_funding_category_strict_membership:
related_key_group_by_expression_list.append(
'funding_category_strict_membership_uid')
related_key_select_expression_list.append(
'funding_category_strict_membership_uid')
if related_key_group_by_expression_list: if related_key_group_by_expression_list:
new_kw['related_key_group_by'] = related_key_group_by_expression_list new_kw['related_key_group_by'] = related_key_group_by_expression_list
...@@ -1108,7 +1127,7 @@ class SimulationTool(BaseTool): ...@@ -1108,7 +1127,7 @@ class SimulationTool(BaseTool):
def _getDefaultGroupByParameters(self, ignore_group_by=0, def _getDefaultGroupByParameters(self, ignore_group_by=0,
group_by_node=0, group_by_mirror_node=0, group_by_node=0, group_by_mirror_node=0,
group_by_section=0, group_by_mirror_section=0, group_by_section=0, group_by_mirror_section=0,
group_by_payment=0, group_by_project=0, group_by_payment=0, group_by_project=0, group_by_funding=0,
group_by_function=0, group_by_function=0,
group_by_variation=0, group_by_sub_variation=0, group_by_variation=0, group_by_sub_variation=0,
group_by_movement=0, group_by_date=0, group_by_movement=0, group_by_date=0,
...@@ -1136,7 +1155,7 @@ class SimulationTool(BaseTool): ...@@ -1136,7 +1155,7 @@ class SimulationTool(BaseTool):
new_group_by_dict = {} new_group_by_dict = {}
if not ignore_group_by and group_by is None: if not ignore_group_by and group_by is None:
if group_by_node or group_by_mirror_node or group_by_section or \ if group_by_node or group_by_mirror_node or group_by_section or \
group_by_project or group_by_function or \ group_by_project or group_by_funding or group_by_function or \
group_by_mirror_section or group_by_payment or \ group_by_mirror_section or group_by_payment or \
group_by_sub_variation or group_by_variation or \ group_by_sub_variation or group_by_variation or \
group_by_movement or group_by_date or group_by_section_category or\ group_by_movement or group_by_date or group_by_section_category or\
......
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