Commit d892c344 authored by Nicolas Wavrant's avatar Nicolas Wavrant

Merge branch 'nicolas-ledgers' into 'master'

Renaming base category "journal" to "ledger"

Because "journal" is not French, and this base category can be used in different modules.

This merge request also provides a tested method in erp5_upgrader to update the objects using the "journal" category during the post-upgrade.

See merge request !54
parents 13ce944f cfe0c15d
......@@ -41,17 +41,17 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>journal</string>
<string>ledger</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Journal is used to split deliveries of the same type in different subsets.</string> </value>
<value> <string>Ledger is used to split movements, deliveries, or orders of the same type in different subsets. It will replace the "journal" base category which is less generic</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>journal</string> </value>
<value> <string>ledger</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -59,7 +59,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Journal</string> </value>
<value> <string>Ledger</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -19,7 +19,7 @@ gender
grade
group
insurance_coverage
journal
ledger
legal_parent
marital_status
market_segment
......@@ -46,4 +46,4 @@ subordination
successor
trade_phase
update_frequency
use
\ No newline at end of file
use
......@@ -26,7 +26,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>journal_tester</string> </value>
<value> <string>ledger_tester</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -36,13 +36,13 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>journal</string>
<string>ledger</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>journal divergence tester</string> </value>
<value> <string>ledger divergence tester</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -26,7 +26,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>journal_tester</string> </value>
<value> <string>ledger_tester</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -36,13 +36,13 @@
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>journal</string>
<string>ledger</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>journal divergence tester</string> </value>
<value> <string>ledger divergence tester</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -41,7 +41,7 @@
<string>destination</string>
<string>source_section</string>
<string>destination_section</string>
<string>journal</string>
<string>ledger</string>
<string>source_project</string>
<string>destination_project</string>
<string>source_payment</string>
......
......@@ -40,12 +40,12 @@
<item>requirement</item>
</portal_type>
<portal_type id="Task">
<item>journal</item>
<item>ledger</item>
<item>predecessor</item>
<item>requirement</item>
</portal_type>
<portal_type id="Task Line">
<item>journal</item>
<item>ledger</item>
<item>requirement</item>
</portal_type>
<portal_type id="Task Module">
......@@ -53,12 +53,12 @@
</portal_type>
<portal_type id="Task Report">
<item>aggregate</item>
<item>journal</item>
<item>ledger</item>
<item>predecessor</item>
<item>requirement</item>
</portal_type>
<portal_type id="Task Report Line">
<item>journal</item>
<item>ledger</item>
<item>requirement</item>
</portal_type>
<portal_type id="Task Report Module">
......
......@@ -89,7 +89,7 @@
<string>my_source_payment</string>
<string>my_destination_reference</string>
<string>my_source_reference</string>
<string>my_view_mode_journal</string>
<string>my_view_mode_ledger</string>
<string>my_view_mode_task_line_aggregate_title</string>
<string>my_view_mode_listbox_aggregate</string>
<string>my_view_mode_aggregate_title</string>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_mode_journal</string> </value>
<value> <string>my_view_mode_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -85,7 +85,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Journal</string> </value>
<value> <string>Ledger</string> </value>
</item>
</dictionary>
</value>
......
......@@ -106,8 +106,8 @@
<string>Reference</string>
</tuple>
<tuple>
<string>journal_translated_title</string>
<string>Journal</string>
<string>ledger_translated_title</string>
<string>Ledger</string>
</tuple>
<tuple>
<string>outcome_description</string>
......@@ -194,8 +194,8 @@
<string>Region</string>
</tuple>
<tuple>
<string>journal</string>
<string>Journal</string>
<string>ledger</string>
<string>Ledger</string>
</tuple>
<tuple>
<string>validated_project_domain</string>
......@@ -255,8 +255,8 @@
<string>Region</string>
</tuple>
<tuple>
<string>journal</string>
<string>Journal</string>
<string>ledger</string>
<string>Ledger</string>
</tuple>
</list>
</value>
......
......@@ -109,8 +109,8 @@
<string>Reference</string>
</tuple>
<tuple>
<string>journal_translated_title</string>
<string>Journal</string>
<string>ledger_translated_title</string>
<string>Ledger</string>
</tuple>
<tuple>
<string>outcome_description</string>
......@@ -205,8 +205,8 @@
<string>Region</string>
</tuple>
<tuple>
<string>journal</string>
<string>Journal</string>
<string>ledger</string>
<string>Ledger</string>
</tuple>
<tuple>
<string>validated_project_domain</string>
......@@ -266,8 +266,8 @@
<string>Region</string>
</tuple>
<tuple>
<string>journal</string>
<string>Journal</string>
<string>ledger</string>
<string>Ledger</string>
</tuple>
<tuple>
<string>preferred_group_person_list_domain</string>
......
......@@ -117,7 +117,7 @@
<string>my_stop_date</string>
<string>my_total_price</string>
<string>my_price_currency</string>
<string>my_journal</string>
<string>my_ledger</string>
<string>my_comment</string>
<string>my_translated_simulation_state_title</string>
<string>my_translated_causality_state_title</string>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_journal</string> </value>
<value> <string>my_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_journal</string> </value>
<value> <string>my_view_mode_ledger</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
......@@ -119,7 +119,7 @@
<string>my_task_line_price</string>
<string>my_total_price</string>
<string>my_price_currency</string>
<string>my_journal</string>
<string>my_ledger</string>
<string>my_translated_simulation_state_title</string>
</list>
</value>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_journal</string> </value>
<value> <string>my_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_journal</string> </value>
<value> <string>my_view_mode_ledger</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
......@@ -16,16 +16,16 @@ Sale Order Milestone | requirement
Sale Order | requirement
Sale Packing List Line | predecessor
Sale Packing List Line | requirement
Task Line | journal
Task Line | ledger
Task Line | requirement
Task Module | business_application
Task Report Line | journal
Task Report Line | ledger
Task Report Line | requirement
Task Report Module | business_application
Task Report | aggregate
Task Report | journal
Task Report | ledger
Task Report | predecessor
Task Report | requirement
Task | journal
Task | ledger
Task | predecessor
Task | requirement
\ No newline at end of file
......@@ -99,10 +99,10 @@
<string>my_dialog_mode_at_date</string>
<string>my_dialog_mode_from_date</string>
<string>my_dialog_mode_simulation_state_list</string>
<string>my_dialog_mode_journal</string>
<string>my_dialog_mode_ledger</string>
<string>my_report_mode_at_date</string>
<string>my_report_mode_from_date</string>
<string>my_report_mode_journal</string>
<string>my_report_mode_ledger</string>
<string>my_report_mode_simulation_state_list</string>
<string>my_dialog_mode_multiplier</string>
<string>my_report_mode_multiplier</string>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_dialog_mode_journal</string> </value>
<value> <string>my_dialog_mode_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -85,7 +85,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Journal</string> </value>
<value> <string>Ledger</string> </value>
</item>
</dictionary>
</value>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_report_mode_journal</string> </value>
<value> <string>my_report_mode_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -122,7 +122,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Journal</string> </value>
<value> <string>Ledger</string> </value>
</item>
</dictionary>
</value>
......@@ -138,7 +138,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.journal</string> </value>
<value> <string>python: here.ledger</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -58,8 +58,8 @@ if multiplier in (None, \'\'):\n
inventory_kw["at_date"] = at_date\n
inventory_kw["from_date"] = from_date\n
inventory_kw["quantity"] = "<0"\n
if journal:\n
inventory_kw["parent_journal_relative_url"] = "journal/%s" % journal\n
if ledger:\n
inventory_kw["parent_ledger_relative_url"] = "ledger/%s" % ledger\n
if multiplier is None:\n
multiplier = 1\n
\n
......@@ -120,11 +120,11 @@ if len(summary_dict):\n
for item_url in summary_dict[person_uid].keys():\n
task_report_module_url = "%s/task_report_module/view?reset:int=1&default_source_uid=%s&title=%%" % (absolute_url, person_uid)\n
if item_url == "None":\n
task_report_module_url += "&child_aggregate_relative_url=%%3dNULL&left_join_list=child_aggregate_relative_url&journal_relative_url=journal/%s" % \\\n
(journal, )\n
task_report_module_url += "&child_aggregate_relative_url=%%3dNULL&left_join_list=child_aggregate_relative_url&ledger_relative_url=ledger/%s" % \\\n
(ledger, )\n
else:\n
task_report_module_url += "&child_aggregate_relative_url=%s&journal_relative_url=journal/%s" % \\\n
(item_url, journal)\n
task_report_module_url += "&child_aggregate_relative_url=%s&ledger_relative_url=ledger/%s" % \\\n
(item_url, ledger)\n
person.edit(**{"%s_column_url" % item_url: task_report_module_url})\n
person.setProperty("getColumnUrl", getColumnUrl)\n
listbox_line_list.append(person)\n
......@@ -158,7 +158,7 @@ context = context.asContext(column_list=column_list,\n
from_date=from_date,\n
simulation_state_list=simulation_state_list,\n
column_url_script_list=column_url_script_list,\n
journal=journal,\n
ledger=ledger,\n
multiplier=multiplier,\n
listbox_line_list=listbox_line_list)\n
\n
......@@ -171,7 +171,7 @@ return context.ResearchItemModule_viewResearchSummaryReportData()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>at_date=None, from_date=None, simulation_state_list=None, journal=None, multiplier=None, batch_mode=False, **kw</string> </value>
<value> <string>at_date=None, from_date=None, simulation_state_list=None, ledger=None, multiplier=None, batch_mode=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -82,7 +82,7 @@
<key> <string>right</string> </key>
<value>
<list>
<string>your_journal</string>
<string>your_ledger</string>
<string>your_simulation_state_list</string>
</list>
</value>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_journal</string> </value>
<value> <string>your_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_report_mode_journal</string> </value>
<value> <string>my_dialog_mode_ledger</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
......@@ -105,7 +105,7 @@
<key> <string>right</string> </key>
<value>
<list>
<string>my_journal</string>
<string>my_ledger</string>
<string>my_simulation_state_list</string>
</list>
</value>
......
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_journal</string> </value>
<value> <string>my_ledger</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_dialog_mode_journal</string> </value>
<value> <string>my_report_mode_ledger</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
......@@ -40,10 +40,10 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
"""Make sure to initialize needed categories
"""
super(TestResearchItemSummaryReport, self).afterSetUp()
journal_base_category = self.portal.portal_categories.journal
ledger_base_category = self.portal.portal_categories.ledger
for category_id in ("operation", "research"):
if not journal_base_category.has_key(category_id):
journal_base_category.newContent(
if not ledger_base_category.has_key(category_id):
ledger_base_category.newContent(
portal_type='Category', title=category_id.title(),
reference=category_id, id=category_id)
......@@ -71,7 +71,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
source_project='project_module/Project_1/Line_1',
start_date=DateTime('2013/01/10'),
stop_date=DateTime('2013/02/15'),
journal="research",
ledger="research",
simulation_state="confirmed",
**kw)
return task
......@@ -83,7 +83,7 @@ class TestResearchItemSummaryReport(TestTaskReportingMixin):
report = self.portal.research_item_module.ResearchItemModule_callResearchSummaryReport
def callReport():
return report(from_date=from_date, at_date=at_date, batch_mode=True,
journal="research", simulation_state_list=["confirmed"])
ledger="research", simulation_state_list=["confirmed"])
def getDataResult(result):
data_list = []
column_id_list = [x[0] for x in result.column_list]
......
<property_sheet_list>
<portal_type id="Template Tool">
<item>TemplateToolBusinessTemplateInstallationConstraint</item>
<item>TemplateToolCategoryNameConstraint</item>
<item>TemplateToolTableConsistencyConstraint</item>
<item>TemplateToolWorkflowChainConsistencyConstraint</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
</property_sheet_list>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TemplateToolCategoryNameConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Script Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>constraint_type/post_upgrade</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>category_name_consistency_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Script Constraint</string> </value>
</item>
<item>
<key> <string>script_id</string> </key>
<value> <string>TemplateTool_checkCategoryNameConsistency</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>