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): ...@@ -12,8 +12,9 @@ def display(x):
if x not in display_cache: if x not in display_cache:
gap_id = x.getReference() gap_id = x.getReference()
if gap_id: if gap_id:
display_cache[x] = '%s - %s' % (gap_id, display_cache[x] = '%s - %s' % (
x.getShortTitle() or x.getTitle()) gap_id,
x.getTranslatedShortTitle() or x.getTranslatedTitle())
else: else:
display_cache[x] = x.getIndentedTitle() display_cache[x] = x.getIndentedTitle()
...@@ -36,6 +37,11 @@ def getGapItemList(only_preferred_gap, gap_root=None): ...@@ -36,6 +37,11 @@ def getGapItemList(only_preferred_gap, gap_root=None):
return result return result
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
getGapItemList = CachingMethod(getGapItemList, id='Account_getGapItemList', cache_factory='erp5_content_long') getGapItemList = CachingMethod(
return getGapItemList(only_preferred_gap=only_preferred_gap, getGapItemList,
gap_root=portal.portal_preferences.getPreferredAccountingTransactionGap()) 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(): ...@@ -9,7 +9,7 @@ def getSubFieldDict():
for item in item_list: for item in item_list:
# Get value of the item # Get value of the item
item_value = item[int(not is_right_display)] item_value = item[int(not is_right_display)]
# Hash key from item_value # Hash key from item_value
item_split = item_value.split('/') item_split = item_value.split('/')
item_key = '/'.join(item_split[:split_depth]) item_key = '/'.join(item_split[:split_depth])
...@@ -21,7 +21,7 @@ def getSubFieldDict(): ...@@ -21,7 +21,7 @@ def getSubFieldDict():
sub_field_property_dict['key'] = item_key sub_field_property_dict['key'] = item_key
sub_field_property_dict['title'] = Base_translateString("GAP - ${gap_title}", mapping=dict( sub_field_property_dict['title'] = Base_translateString("GAP - ${gap_title}", mapping=dict(
gap_title=context.portal_categories.resolveCategory( 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['required'] = 0
sub_field_property_dict['field_type'] = 'ListField' sub_field_property_dict['field_type'] = 'ListField'
sub_field_property_dict['size'] = 1 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