Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
08cea86c
Commit
08cea86c
authored
Oct 21, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Research Item Report: various fixes
parent
84ed891f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml
...rch_item/ResearchItemModule_callResearchSummaryReport.xml
+19
-16
No files found.
bt5/erp5_research_item/SkinTemplateItem/portal_skins/erp5_research_item/ResearchItemModule_callResearchSummaryReport.xml
View file @
08cea86c
...
@@ -53,6 +53,8 @@
...
@@ -53,6 +53,8 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
inventory_kw = {}\n
inventory_kw = {}\n
if multiplier in (None, \'\'):\n
multiplier = 1.0\n
inventory_kw["at_date"] = at_date\n
inventory_kw["at_date"] = at_date\n
inventory_kw["from_date"] = from_date\n
inventory_kw["from_date"] = from_date\n
inventory_kw["quantity"] = "<0"\n
inventory_kw["quantity"] = "<0"\n
...
@@ -62,7 +64,6 @@ if multiplier is None:\n
...
@@ -62,7 +64,6 @@ if multiplier is None:\n
multiplier = 1\n
multiplier = 1\n
\n
\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
\n
simulation_state_set = set(simulation_state_list)\n
simulation_state_set = set(simulation_state_list)\n
# We will use inventory API in order to find all quantities\n
# We will use inventory API in order to find all quantities\n
before_confirmed_task_state_set = set(portal.getPortalPlannedOrderStateList() + \\\n
before_confirmed_task_state_set = set(portal.getPortalPlannedOrderStateList() + \\\n
...
@@ -110,14 +111,14 @@ def getColumnUrl(brain=None, column_id=None, **kw):\n
...
@@ -110,14 +111,14 @@ def getColumnUrl(brain=None, column_id=None, **kw):\n
absolute_url = portal.absolute_url()\n
absolute_url = portal.absolute_url()\n
\n
\n
if len(summary_dict):\n
if len(summary_dict):\n
for person in portal.portal_catalog(portal_type=
"Person"
, uid=summary_dict.keys(), select_list=["title"]):\n
for person in portal.portal_catalog(portal_type=
("Person", "Organisation")
, uid=summary_dict.keys(), select_list=["title"]):\n
person_title_dict[person.uid] = person.title\n
person_title_dict[person.uid] = person.title\n
for person_uid in summary_dict.keys():\n
for person_uid in summary_dict.keys():\n
person_kw = summary_dict[person_uid]\n
person_kw = summary_dict[person_uid]\n
person_kw["source_title"] = person_title_dict[person_uid]\n
person_kw["source_title"] = person_title_dict[person_uid]\n
person = portal.person_module.newContent(temp_object=1, **person_kw)\n
person = portal.person_module.newContent(temp_object=1, **person_kw)\n
for item_url in summary_dict[person_uid].keys():\n
for item_url in summary_dict[person_uid].keys():\n
task_report_module_url = "%s/task_report_module/view?reset:int=1&default_source_uid=%s" % (absolute_url, person_uid)\n
task_report_module_url = "%s/task_report_module/view?reset:int=1&default_source_uid=%s
&title=%%
" % (absolute_url, person_uid)\n
if item_url == "None":\n
if item_url == "None":\n
task_report_module_url += "&child_aggregate_relative_url=%%3dNULL&left_join_list=child_aggregate_relative_url&journal_relative_url=journal/%s" % \\\n
task_report_module_url += "&child_aggregate_relative_url=%%3dNULL&left_join_list=child_aggregate_relative_url&journal_relative_url=journal/%s" % \\\n
(journal, )\n
(journal, )\n
...
@@ -128,6 +129,7 @@ if len(summary_dict):\n
...
@@ -128,6 +129,7 @@ if len(summary_dict):\n
person.setProperty("getColumnUrl", getColumnUrl)\n
person.setProperty("getColumnUrl", getColumnUrl)\n
listbox_line_list.append(person)\n
listbox_line_list.append(person)\n
\n
\n
listbox_line_list.sort(key=lambda x: x.getProperty("source_title"))\n
# now add an extra line for total\n
# now add an extra line for total\n
person = portal.person_module.newContent(temp_object=1, source_title="Total", **total_project_dict)\n
person = portal.person_module.newContent(temp_object=1, source_title="Total", **total_project_dict)\n
listbox_line_list.append(person)\n
listbox_line_list.append(person)\n
...
@@ -139,9 +141,11 @@ if item_url_set:\n
...
@@ -139,9 +141,11 @@ if item_url_set:\n
item_title_dict["None"] = "undefined"\n
item_title_dict["None"] = "undefined"\n
\n
\n
# define which property to display in columns\n
# define which property to display in columns\n
column_list = [("source_title", "Worker")]\n
column_list = [("source_title", "Worker"),\n
for item_url, item_title in item_title_dict.items():\n
("None", "Undefined"), ]\n
column_list.append((item_url, item_title))\n
for item_url, item_title in sorted(item_title_dict.items(), key=lambda url_title: url_title[1]):\n
if item_url != \'None\':\n
column_list.append((item_url, item_title))\n
column_list.append(("total", "Total"))\n
column_list.append(("total", "Total"))\n
\n
\n
# define which script to display url in columns\n
# define which script to display url in columns\n
...
@@ -149,16 +153,15 @@ column_url_script_list = []\n
...
@@ -149,16 +153,15 @@ column_url_script_list = []\n
for item_url in item_title_dict.keys():\n
for item_url in item_title_dict.keys():\n
column_url_script_list.append((item_url, "getColumnUrl"))\n
column_url_script_list.append((item_url, "getColumnUrl"))\n
\n
\n
context_kw = {}\n
context = context.asContext(column_list=column_list,\n
context_kw.update(column_list=column_list,\n
at_date=at_date,\n
at_date=at_date,\n
from_date=from_date,\n
from_date=from_date,\n
simulation_state_list=simulation_state_list,\n
simulation_state_list=simulation_state_list,\n
column_url_script_list=column_url_script_list,\n
column_url_script_list=column_url_script_list,\n
journal=journal,\n
journal=journal,\n
multiplier=multiplier,\n
multiplier=multiplier,\n
listbox_line_list=listbox_line_list)\n
listbox_line_list=listbox_line_list)\n
\n
context = context.getObject().asContext(**context_kw)\n
if batch_mode:\n
if batch_mode:\n
return context\n
return context\n
return context.ResearchItemModule_viewResearchSummaryReportData()\n
return context.ResearchItemModule_viewResearchSummaryReportData()\n
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment