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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
ed6b2a5d
Commit
ed6b2a5d
authored
Sep 09, 2013
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor code to not search for Moviments, all projects validated are enough
parent
6c25d870
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
21 deletions
+11
-21
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml
...counting/AccountingTransactionLine_getProjectItemList.xml
+9
-19
bt5/erp5_accounting/bt/change_log
bt5/erp5_accounting/bt/change_log
+1
-1
bt5/erp5_accounting/bt/revision
bt5/erp5_accounting/bt/revision
+1
-1
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getProjectItemList.xml
View file @
ed6b2a5d
...
@@ -50,34 +50,24 @@
...
@@ -50,34 +50,24 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""Returns
the item list of possible projects to use on accounting line
s.\n
<value>
<string>
"""Returns
all validated project
s.\n
\n
\n
This script is indented to be used on custom listfields for accounting lines, and on reports.\n
This script is indented to be used on custom listfields for accounting lines, and on reports.\n
If this script returns an empty list, it means that reports by project are disabled.\n
If this script returns an empty list, it means that reports by project are disabled.\n
"""\n
"""\n
from Products.ERP5Type.Message import translateString\n
from Products.ERP5Type.Message import translateString\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
request = portal.REQUEST\n
\n
\n
# case 1: script is used for reports, we display all
project that have been used in accounting
.\n
# case 1: script is used for reports, we display all
validated projects
.\n
if context.getPortalType() == \'Accounting Transaction Module\':\n
if context.getPortalType() == \'Accounting Transaction Module\':\n
getObject = portal.portal_catalog.getObject\n
search_kw=dict(portal_type=portal.getPortalAccountingMovementTypeList(),\n
group_by=(\'stock.project_uid\',))\n
section_category = request.get(\'your_section_category\',\n
portal.portal_preferences.getPreferredAccountingTransactionSectionCategory())\n
if section_category:\n
section_uid = portal.Base_getSectionUidListForSectionCategory(\n
section_category=section_category,\n
strict_membership=request.get(\'your_section_category_strict\', False))\n
search_kw[\'section_uid\'] = section_uid\n
\n
project_list = []\n
project_list = []\n
for brain in portal.portal_simulation.getInventoryList(**search_kw):\n
for project in portal.project_module.searchFolder(\n
if brain.project_uid:\n
portal_type=\'Project\',\n
project = getObject(brain.project_uid)\n
select_list=[\'relative_url\', \'title\'],\n
project_list.append((project.getTitle(), project.getRelativeUrl(),))\n
validation_state=(\'validated\',),\n
project_list.sort(key=lambda x:x[0])\n
sort_on=((\'title\', \'ASC\'),)):\n
project_list.append((project.title, project.relative_url,))\n
\n
if not project_list:\n
if not project_list:\n
return [] # returning an empty list, not to add project column on reports\n
return [] # returning an empty list, not to add project column on reports\n
return [(\'\', \'\'), (translateString(\'No Project\'), \'None\')] + project_list\n
return [(\'\', \'\'), (translateString(\'No Project\'), \'None\')] + project_list\n
...
...
bt5/erp5_accounting/bt/change_log
View file @
ed6b2a5d
2013-09-09 Gabriel Monnerat
2013-09-09 Gabriel Monnerat
* Refactor ERP5Site_getAccountItemList
to search only for validated accounts.
* Refactor ERP5Site_getAccountItemList
and AccountingTransactionLine_getProjectItemList to not search for Movements becauses it generate slow queries
2013-04-17 arnaud.fontaine
2013-04-17 arnaud.fontaine
* erp5_simulation should not be required as some system do not use simulation.
* erp5_simulation should not be required as some system do not use simulation.
...
...
bt5/erp5_accounting/bt/revision
View file @
ed6b2a5d
1542
1543
\ No newline at end of file
\ No newline at end of file
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