summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonin Bourguignon <abo@openerp.com>2013-02-22 18:05:41 +0100
committerAntonin Bourguignon <abo@openerp.com>2013-02-22 18:05:41 +0100
commit74e7deafb8c04311f0190982cd062dbc8da1925a (patch)
treead84bd2aba75314226de4b645a668b1aa88f87f3
parenta961e5e37773dba44dd36b64c467d81e52002f91 (diff)
[IMP] res_config doc
bzr revid: abo@openerp.com-20130222170541-26wsg1r8kkb0h4vp
-rw-r--r--openerp/addons/base/res/res_config.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py
index 354a612d075..3137cab24d9 100644
--- a/openerp/addons/base/res/res_config.py
+++ b/openerp/addons/base/res/res_config.py
@@ -612,7 +612,7 @@ class res_config_settings(osv.osv_memory):
"""
Fetch the human readable name of a specified configuration option.
- :param string full_field_name: the full name of the field, structured as follows:
+ :param string full_field_name: the full name of the field, structured as follows:
model_name.field_name (e.g.: "sale.config.settings.fetchmail_lead")
:return string: human readable name of the field (e.g.: "Create leads from incoming mails")
"""
@@ -622,7 +622,7 @@ class res_config_settings(osv.osv_memory):
def get_config_warning(self, cr, msg, context=None):
"""
- Helper: return a Warning exception with the given message where the %(field:xxx)s
+ Helper: return a Warning exception with the given message where the %(field:xxx)s
and/or %(menu:yyy)s are replaced by the human readable field's name and/or menuitem's
full path.
@@ -639,6 +639,14 @@ class res_config_settings(osv.osv_memory):
This will return an exception containing the following message:
Error: this action is prohibited. You should check the field Create leads from incoming mails in Settings/Configuration/Sales.
+
+ What if there is another substitution in the message already?
+ -------------------------------------------------------------
+ You could have a situation where the error message you want to upgrade already contains a substitution. Example:
+ Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\Journals.
+ What you want to do here is simply to replace the path by %menu:account.menu_account_config)s, and leave the rest alone.
+ In order to do that, you can use the double percent (%%) to escape your new substitution, like so:
+ Cannot find any account journal of %s type for this company.\n\nYou can create one in the %%(menu:account.menu_account_config)s.
"""
res_config_obj = pooler.get_pool(cr.dbname).get('res.config.settings')