From 68a30421efc8b3c55469eae166d907ff596a0a13 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 20 Aug 2010 17:27:50 +0200 Subject: [PATCH 1/2] [IMP] res_roles: improved documentation and views: - added description field and o2m to wkf transitions - improved views: tooltips, layout - added related wkf_id field on transitions to display it in list view - added basic docstring on check() method bzr revid: odo@openerp.com-20100820152750-ad5ypnwwxjnzdfn9 --- bin/addons/base/ir/ir.xml | 18 ++++++++++++++++-- bin/addons/base/ir/workflow/workflow.py | 1 + bin/addons/base/res/res_user.py | 12 +++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/bin/addons/base/ir/ir.xml b/bin/addons/base/ir/ir.xml index f84a0868709..f5422607d3f 100644 --- a/bin/addons/base/ir/ir.xml +++ b/bin/addons/base/ir/ir.xml @@ -606,8 +606,20 @@ form
- - + + + + + + + + + + + + + + @@ -619,6 +631,8 @@ + + diff --git a/bin/addons/base/ir/workflow/workflow.py b/bin/addons/base/ir/workflow/workflow.py index 7518700a3c3..dae77781503 100644 --- a/bin/addons/base/ir/workflow/workflow.py +++ b/bin/addons/base/ir/workflow/workflow.py @@ -151,6 +151,7 @@ class wkf_transition(osv.osv): 'condition': fields.char('Condition', required=True, size=128), 'act_from': fields.many2one('workflow.activity', 'Source Activity', required=True, select=True, ondelete='cascade'), 'act_to': fields.many2one('workflow.activity', 'Destination Activity', required=True, select=True, ondelete='cascade'), + 'wkf_id': fields.related('act_from','wkf_id', type='many2one', relation='workflow', string='Workflow', select=True), } _defaults = { 'condition': lambda *a: 'True', diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index 59351b80d71..99e75fd7ec3 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -93,13 +93,19 @@ class roles(osv.osv): _name = "res.roles" _columns = { 'name': fields.char('Role Name', size=64, required=True), - 'parent_id': fields.many2one('res.roles', 'Parent', select=True), + 'parent_id': fields.many2one('res.roles', 'Parent', select=True, + help="The parent role can be used to construct a hierarchy of roles. Parent roles inherit from the roles of their descendants."), 'child_id': fields.one2many('res.roles', 'parent_id', 'Children'), 'users': fields.many2many('res.users', 'res_roles_users_rel', 'rid', 'uid', 'Users'), - } - _defaults = { + 'description': fields.text('Description', help="Description of this role and where it is relevant in workflows and processes"), + 'workflow_transition_ids': fields.one2many('workflow.transition', 'role_id', 'Workflow Transitions', + help="The workflow transitions associated with this role"), } def check(self, cr, uid, ids, role_id): + """Verifies that the role with id ``role_id`` is granted directly or indirectly to a + user that possesses the roles with ids ``ids``. Indirectly means that one of the + roles with id in ``ids`` is an ancestor role of the role with id ``role_id``. + """ if role_id in ids: return True cr.execute('select parent_id from res_roles where id=%s', (role_id,)) From eaf02eebb3786d9a729f0566dc146f0a5b7a1181 Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Mon, 23 Aug 2010 04:58:53 +0100 Subject: [PATCH 2/2] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100821035524-8fmdf608gc0woe6v bzr revid: codehost@crowberry-20100822034810-e914n9p11jk1gam6 bzr revid: codehost@crowberry-20100823035853-lna61rv964ypumcx --- bin/addons/base/i18n/hr.po | 4 ++-- bin/addons/base/i18n/it.po | 4 ++-- bin/addons/base/i18n/ja.po | 4 ++-- bin/addons/base/i18n/pt_BR.po | 4 ++-- bin/addons/base/i18n/sv.po | 4 ++-- bin/addons/base/i18n/uk.po | 4 ++-- bin/addons/base/i18n/zh_CN.po | 4 ++-- bin/addons/base/i18n/zh_TW.po | 6 +++--- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/addons/base/i18n/hr.po b/bin/addons/base/i18n/hr.po index 5927ef6c5fe..4ce1212911c 100644 --- a/bin/addons/base/i18n/hr.po +++ b/bin/addons/base/i18n/hr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:28+0000\n" +"PO-Revision-Date: 2010-08-22 05:34+0000\n" "Last-Translator: Goran Kliska \n" "Language-Team: openerp-translators\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Language: hr\n" diff --git a/bin/addons/base/i18n/it.po b/bin/addons/base/i18n/it.po index 58fa382f73c..5b49922ef41 100644 --- a/bin/addons/base/i18n/it.po +++ b/bin/addons/base/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:26+0000\n" +"PO-Revision-Date: 2010-08-22 05:31+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/ja.po b/bin/addons/base/i18n/ja.po index fc134c07546..d2a54cc45e1 100644 --- a/bin/addons/base/i18n/ja.po +++ b/bin/addons/base/i18n/ja.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:21+0000\n" +"PO-Revision-Date: 2010-08-22 05:23+0000\n" "Last-Translator: Harry (Open ERP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/pt_BR.po b/bin/addons/base/i18n/pt_BR.po index 0dda53322cf..7d0050964e5 100644 --- a/bin/addons/base/i18n/pt_BR.po +++ b/bin/addons/base/i18n/pt_BR.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:31+0000\n" +"PO-Revision-Date: 2010-08-22 05:37+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/sv.po b/bin/addons/base/i18n/sv.po index 9b1d8ec464a..e027adfa5f6 100644 --- a/bin/addons/base/i18n/sv.po +++ b/bin/addons/base/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:18+0000\n" +"PO-Revision-Date: 2010-08-22 05:19+0000\n" "Last-Translator: Anders Wallenquist \n" "Language-Team: <>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index ca747dc8b72..d15e26bfa39 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:24+0000\n" +"PO-Revision-Date: 2010-08-22 05:26+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:35+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_CN.po b/bin/addons/base/i18n/zh_CN.po index 803c8ab4a40..c3eb1b350ff 100644 --- a/bin/addons/base/i18n/zh_CN.po +++ b/bin/addons/base/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-19 05:26+0000\n" +"PO-Revision-Date: 2010-08-22 05:32+0000\n" "Last-Translator: Eleanor Chen \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:36+0000\n" +"X-Launchpad-Export-Date: 2010-08-23 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base diff --git a/bin/addons/base/i18n/zh_TW.po b/bin/addons/base/i18n/zh_TW.po index 0471cc85fc8..1c93b4ad775 100644 --- a/bin/addons/base/i18n/zh_TW.po +++ b/bin/addons/base/i18n/zh_TW.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-08-20 01:30+0000\n" -"Last-Translator: Beata \n" +"PO-Revision-Date: 2010-08-20 04:54+0000\n" +"Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-20 03:36+0000\n" +"X-Launchpad-Export-Date: 2010-08-21 03:55+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base