From 07e536d6cbf6c32b49f06f34bad81ab2e628891e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Nov 2008 18:44:57 +0100 Subject: [PATCH] Remove module category as it can not be translated --- trytond/ir/__tryton__.py | 2 -- trytond/ir/module/__init__.py | 4 +-- trytond/ir/module/category.py | 20 --------------- trytond/ir/module/category.xml | 47 ---------------------------------- trytond/ir/module/module.py | 34 +----------------------- trytond/ir/module/module.xml | 25 ------------------ trytond/res/__tryton__.py | 1 - trytond/webdav/__tryton__.py | 1 - trytond/workflow/__tryton__.py | 1 - 9 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 trytond/ir/module/category.py delete mode 100644 trytond/ir/module/category.xml diff --git a/trytond/ir/__tryton__.py b/trytond/ir/__tryton__.py index ae04d23ad8..f40c72a7fc 100644 --- a/trytond/ir/__tryton__.py +++ b/trytond/ir/__tryton__.py @@ -3,7 +3,6 @@ { 'name': 'IR', 'name_de_DE': 'Interne Administration', - 'category': 'Generic', 'description': '''Basic module handling internal tasks of the application. Provides concepts and administration of models, actions, sequences, localizations, cron jobs etc. ''', @@ -28,7 +27,6 @@ Provides concepts and administration of models, actions, sequences, localization 'rule.xml', 'property.xml', 'module/module.xml', - 'module/category.xml', 'default.xml', ], 'translation': [ diff --git a/trytond/ir/module/__init__.py b/trytond/ir/module/__init__.py index c02fef06b7..f79830aa00 100644 --- a/trytond/ir/module/__init__.py +++ b/trytond/ir/module/__init__.py @@ -1,3 +1,3 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -from category import * +#This file is part of Tryton. The COPYRIGHT file at the top level of +#this repository contains the full copyright notices and license terms. from module import * diff --git a/trytond/ir/module/category.py b/trytond/ir/module/category.py deleted file mode 100644 index 4d635ff114..0000000000 --- a/trytond/ir/module/category.py +++ /dev/null @@ -1,20 +0,0 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -"Category" -from trytond.osv import fields, OSV - - -class Category(OSV): - "Module Category" - _name = "ir.module.category" - _description = __doc__ - name = fields.Char("Name", required=True) - parent = fields.Many2One('ir.module.category', - 'Parent Category', select=1) - childs = fields.One2Many('ir.module.category', - 'parent', 'Child Categories') - - def __init__(self): - super(Category, self).__init__() - self._order.insert(0, ('name', 'ASC')) - -Category() diff --git a/trytond/ir/module/category.xml b/trytond/ir/module/category.xml deleted file mode 100644 index 35cc856686..0000000000 --- a/trytond/ir/module/category.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - ir.module.category - form - - - - - ir.module.category - tree - childs - - - - - ]]> - - - - Categories - ir.action.act_window - ir.module.category - tree - [('parent', '=', False)] - - - - - - - - - diff --git a/trytond/ir/module/module.py b/trytond/ir/module/module.py index 18a4b86b87..b60fc08130 100644 --- a/trytond/ir/module/module.py +++ b/trytond/ir/module/module.py @@ -128,8 +128,6 @@ class Module(OSV): _name = "ir.module.module" _description = __doc__ name = fields.Char("Name", readonly=True, required=True) - category = fields.Many2One('ir.module.category', 'Category', - readonly=True) shortdesc = fields.Char('Short description', readonly=True, translate=True) description = fields.Text("Description", readonly=True, translate=True) author = fields.Char("Author", readonly=True) @@ -367,8 +365,6 @@ class Module(OSV): }, context=ctx) self._update_dependencies(cursor, user, module_id, tryton.get('depends', []), context=context) - self._update_category(cursor, user, module_id, - tryton.get('category', 'None'), context=context) continue if name in ['ir', 'workflow', 'res', 'webdav']: mod_path = os.path.join( @@ -399,8 +395,6 @@ class Module(OSV): res += 1 self._update_dependencies(cursor, user, new_id, tryton.get('depends', []), context=context) - self._update_category(cursor, user, new_id, - tryton.get('category', 'None'), context=context) return res def _update_dependencies(self, cursor, user, module_id, depends=None, @@ -418,35 +412,9 @@ class Module(OSV): 'name': depend, }, context=context) - def _update_category(self, cursor, user, module_id, category='None', - context=None): - category_obj = self.pool.get('ir.module.category') - categs = category.split('/') - parent_id = None - while categs: - if parent_id is not None: - category_ids = category_obj.search(cursor, user, [ - ('name', '=', categs[0]), - ('parent', '=', parent_id), - ], context=context) - else: - category_ids = category_obj.search(cursor, user, [ - ('name', '=', categs[0]), - ('parent', '=', False), - ], context=context) - if not category_ids: - parent_id = category_obj.create(cursor, user, { - 'name': categs[0], - 'parent': parent_id, - }, context=context) - else: - parent_id = category_ids[0] - categs = categs[1:] - self.write(cursor, user, module_id, {'category': parent_id}, - context=context) - Module() + class ModuleDependency(OSV): "Module dependency" _name = "ir.module.module.dependency" diff --git a/trytond/ir/module/module.xml b/trytond/ir/module/module.xml index e711cb05e9..352479d39a 100644 --- a/trytond/ir/module/module.xml +++ b/trytond/ir/module/module.xml @@ -93,31 +93,6 @@ - - Modules - ir.action.act_window - ir.module.module - form - [('category', '=', active_id)] - - - - - - - - - - - - - - tree_open - ir.module.category,0 - - ir.module.module.config_wizard.item tree diff --git a/trytond/res/__tryton__.py b/trytond/res/__tryton__.py index 4c7784229d..0eb1213a75 100644 --- a/trytond/res/__tryton__.py +++ b/trytond/res/__tryton__.py @@ -3,7 +3,6 @@ { 'name': 'Res', 'name_de_DE': 'Benutzerverwaltung', - 'category': 'Generic', 'description': '''Basic module handling internal tasks of the application. Provides concepts and administration of users and internal communication. ''', diff --git a/trytond/webdav/__tryton__.py b/trytond/webdav/__tryton__.py index 4de58218fd..4b630d76c9 100644 --- a/trytond/webdav/__tryton__.py +++ b/trytond/webdav/__tryton__.py @@ -3,7 +3,6 @@ { 'name': 'WebDAV', 'name_de_DE': 'WebDAV', - 'category': 'Generic', 'description': '''Basic module providing concept and administration of integrated webDAV features. ''', 'description_de_DE': '''Basismodul für Konzept und Administration der integrierten WebDAV-Komponente diff --git a/trytond/workflow/__tryton__.py b/trytond/workflow/__tryton__.py index e5d559b903..25827a940f 100644 --- a/trytond/workflow/__tryton__.py +++ b/trytond/workflow/__tryton__.py @@ -3,7 +3,6 @@ { 'name': 'Workflow', 'name_de_DE': 'Workflow', - 'category': 'Generic', 'description': '''Basic module providing concept and administration of workflows. ''', 'description_de_DE': '''Basismodul für Konzept und Administration von Workflows