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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
bdc4326e
Commit
bdc4326e
authored
Jun 23, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: translate GAP category in account view
parent
d6665300
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapItemList.py
...em/portal_skins/erp5_accounting/Account_getGapItemList.py
+11
-5
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_hashGapItemList.py
...m/portal_skins/erp5_accounting/Account_hashGapItemList.py
+2
-2
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapItemList.py
View file @
bdc4326e
...
...
@@ -12,8 +12,9 @@ def display(x):
if
x
not
in
display_cache
:
gap_id
=
x
.
getReference
()
if
gap_id
:
display_cache
[
x
]
=
'%s - %s'
%
(
gap_id
,
x
.
getShortTitle
()
or
x
.
getTitle
())
display_cache
[
x
]
=
'%s - %s'
%
(
gap_id
,
x
.
getTranslatedShortTitle
()
or
x
.
getTranslatedTitle
())
else
:
display_cache
[
x
]
=
x
.
getIndentedTitle
()
...
...
@@ -36,6 +37,11 @@ def getGapItemList(only_preferred_gap, gap_root=None):
return
result
from
Products.ERP5Type.Cache
import
CachingMethod
getGapItemList
=
CachingMethod
(
getGapItemList
,
id
=
'Account_getGapItemList'
,
cache_factory
=
'erp5_content_long'
)
return
getGapItemList
(
only_preferred_gap
=
only_preferred_gap
,
gap_root
=
portal
.
portal_preferences
.
getPreferredAccountingTransactionGap
())
getGapItemList
=
CachingMethod
(
getGapItemList
,
id
=
'Account_getGapItemList.%s'
%
portal
.
Localizer
.
get_selected_language
(),
cache_factory
=
'erp5_content_long'
)
return
getGapItemList
(
only_preferred_gap
=
only_preferred_gap
,
gap_root
=
portal
.
portal_preferences
.
getPreferredAccountingTransactionGap
())
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_hashGapItemList.py
View file @
bdc4326e
...
...
@@ -9,7 +9,7 @@ def getSubFieldDict():
for
item
in
item_list
:
# Get value of the item
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
])
...
...
@@ -21,7 +21,7 @@ def getSubFieldDict():
sub_field_property_dict
[
'key'
]
=
item_key
sub_field_property_dict
[
'title'
]
=
Base_translateString
(
"GAP - ${gap_title}"
,
mapping
=
dict
(
gap_title
=
context
.
portal_categories
.
resolveCategory
(
'gap/%s'
%
item_key
).
getTitle
()))
'gap/%s'
%
item_key
).
getT
ranslatedT
itle
()))
sub_field_property_dict
[
'required'
]
=
0
sub_field_property_dict
[
'field_type'
]
=
'ListField'
sub_field_property_dict
[
'size'
]
=
1
...
...
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