Commit bdc4326e authored by Jérome Perrin's avatar Jérome Perrin

accounting: translate GAP category in account view

parent d6665300
......@@ -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())
......@@ -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).getTranslatedTitle()))
sub_field_property_dict['required'] = 0
sub_field_property_dict['field_type'] = 'ListField'
sub_field_property_dict['size'] = 1
......
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