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

accounting: financial section column on general ledger

/reviewed-on nexedi/erp5!1002
parents 92beebd3 eeb263f5
Pipeline #7154 failed with stage
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)
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/asset/cash/bank</string>
<string>gap/my_country/my_accounting_standards/5</string>
<string>financial_section/asset/cash</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/liability/payable/collected_vat</string>
<string>gap/my_country/my_accounting_standards/4/44/445/4457</string>
<string>financial_section/liability/payable</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/equity</string>
<string>gap/my_country/my_accounting_standards/1</string>
<string>financial_section/equity/common_stock</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/asset</string>
<string>gap/my_country/my_accounting_standards/2</string>
<string>financial_section/asset/fixed_assets</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/expense</string>
<string>gap/my_country/my_accounting_standards/6</string>
<string>financial_section/expense/cogs</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/income</string>
<string>gap/my_country/my_accounting_standards/7</string>
<string>financial_section/income/sales</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/liability/payable</string>
<string>gap/my_country/my_accounting_standards/4/40</string>
<string>financial_section/liability/payable</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/asset/receivable</string>
<string>gap/my_country/my_accounting_standards/4/41</string>
<string>financial_section/asset/receivables</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/asset/receivable/refundable_vat</string>
<string>gap/my_country/my_accounting_standards/4/44/445/4456</string>
<string>financial_section/asset/receivables</string>
</tuple>
</value>
</item>
......
......@@ -78,6 +78,7 @@
<tuple>
<string>account_type/asset</string>
<string>gap/my_country/my_accounting_standards/3</string>
<string>financial_section/asset/inventory</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cash</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cash</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>fixed_assets</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Fixed Assets</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>inventory</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Inventory</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>receivables</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounts Receivable</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>common_stock</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Common Stock</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>cogs</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cost of Sales</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sales</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Sales Revenues</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>payable</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Accounts Payable</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -23,6 +23,14 @@ organisation_module/supplier
organisation_module/supplier/**
person_module/john_smith
person_module/john_smith/**
portal_categories/financial_section/asset/cash
portal_categories/financial_section/asset/fixed_assets
portal_categories/financial_section/asset/inventory
portal_categories/financial_section/asset/receivables
portal_categories/financial_section/equity/common_stock
portal_categories/financial_section/expense/cogs
portal_categories/financial_section/income/sales
portal_categories/financial_section/liability/payable
portal_categories/gap/another_country
portal_categories/gap/another_country/**
portal_categories/gap/my_country
......
......@@ -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