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

accounting: add Financial Section column in GL export mode

parent 0be4a159
Pipeline #7158 failed with stage
in 0 seconds
return (
('Movement_getNodeGapId', 'Account Code'),
('node_translated_title', 'Account Name'),
('Movement_getNodeFinancialSectionTitle', 'Financial Section'),
('section_title', 'Section'),
('mirror_section_title', 'Third Party'),
('date', 'Operation Date'),
......
cache_id = '{}.cache'.format(script.getId())
financial_section_cache = context.REQUEST.other.get(cache_id, {})
key = brain.node_relative_url
financial_section_title = financial_section_cache.get(key)
if financial_section_title is None:
financial_section_title = context.getPortalObject().restrictedTraverse(
key).getFinancialSectionTranslatedTitle()
financial_section_cache[key] = financial_section_title
context.REQUEST.other[cache_id] = financial_section_cache
return financial_section_title
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>brain, selection=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Movement_getNodeFinancialSectionTitle</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -190,7 +190,8 @@ if from_date or is_pl_account:
if params.get('node_uid'):
previous_balance.edit(
Movement_getNodeGapId=node.Account_getGapId(),
node_translated_title=node.getTranslatedTitle()
node_translated_title=node.getTranslatedTitle(),
Movement_getNodeFinancialSectionTitle=node.getFinancialSectionTranslatedTitle(),
)
if params.get('mirror_section_uid'):
brain_list = portal.portal_catalog(uid=params['mirror_section_uid'], limit=2)
......
......@@ -5399,8 +5399,8 @@ DT, b, P2 - Project 2''',
self.assertEqual(3, len(data_line_list))
self.assertEqual(
['Movement_getNodeGapId', 'node_translated_title', 'section_title',
'mirror_section_title', 'date', 'modification_date',
['Movement_getNodeGapId', 'node_translated_title', 'Movement_getNodeFinancialSectionTitle',
'section_title', 'mirror_section_title', 'date', 'modification_date',
'Movement_getSpecificReference',
'Movement_getExplanationTranslatedPortalType',
'Movement_getExplanationTitle', 'Movement_getExplanationReference',
......@@ -5417,6 +5417,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[0],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5442,6 +5443,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[1],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5467,6 +5469,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[2],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5630,8 +5633,8 @@ DT, b, P2 - Project 2''',
# all the columns configured in AccountModule_getGeneralLedgerColumnItemList
# are displayed
self.assertEqual(
['Movement_getNodeGapId', 'node_translated_title', 'section_title',
'mirror_section_title', 'date', 'modification_date',
['Movement_getNodeGapId', 'node_translated_title', 'Movement_getNodeFinancialSectionTitle',
'section_title', 'mirror_section_title', 'date', 'modification_date',
'Movement_getSpecificReference',
'Movement_getExplanationTranslatedPortalType',
'Movement_getExplanationTitle', 'Movement_getExplanationReference',
......@@ -5651,6 +5654,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[0],
Movement_getNodeGapId='41',
node_translated_title='Receivable',
Movement_getNodeFinancialSectionTitle='Accounts Receivable',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5681,6 +5685,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[0],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5707,6 +5712,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[1],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......@@ -5733,6 +5739,7 @@ DT, b, P2 - Project 2''',
self.checkLineProperties(data_line_list[2],
Movement_getNodeGapId='7',
node_translated_title='Goods Sales',
Movement_getNodeFinancialSectionTitle='Sales Revenues',
section_title='My Organisation',
mirror_section_title='Client 1',
date=DateTime(2006, 2, 2),
......
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