Remove module category as it can not be translated

This commit is contained in:
Cédric Krier committed 2008-11-06 18:44:57 +01:00
1 parent 0845ca187a
commit 07e536d6cb
9 files changed
+3 -132

No files matched your search

-2
View File
@@ -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': [
+2 -2
View File
@@ -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 *
-20
View File
@@ -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()
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.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. -->
<tryton>
<data>
<record model="ir.ui.view" id="category_view_form">
<field name="model">ir.module.category</field>
<field name="type">form</field>
<field name="arch" type="xml">
<![CDATA[
<form string="Module Category">
<label name="name"/>
<field name="name"/>
<label name="parent"/>
<field name="parent"/>
</form>
]]>
</field>
</record>
<record model="ir.ui.view" id="category_view_tree">
<field name="model">ir.module.category</field>
<field name="type">tree</field>
<field name="field_childs">childs</field>
<field name="arch" type="xml">
<![CDATA[
<tree string="Module Categories">
<field name="name"/>
</tree>
]]>
</field>
</record>
<record model="ir.action.act_window" id="act_category_tree">
<field name="name">Categories</field>
<field name="type">ir.action.act_window</field>
<field name="res_model">ir.module.category</field>
<field name="view_type">tree</field>
<field name="domain">[('parent', '=', False)]</field>
</record>
<record model="ir.action.act_window.view"
id="act_category_tree_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="category_view_tree"/>
<field name="act_window" ref="act_category_tree"/>
</record>
<menuitem parent="menu_modules"
action="act_category_tree" id="menu_category_tree"/>
</data>
</tryton>
+1 -33
View File
@@ -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"
-25
View File
@@ -93,31 +93,6 @@
<menuitem parent="menu_modules"
action="act_module_form" id="menu_module_form"/>
<record model="ir.action.act_window" id="act_module_form2">
<field name="name">Modules</field>
<field name="type">ir.action.act_window</field>
<field name="res_model">ir.module.module</field>
<field name="view_type">form</field>
<field name="domain">[('category', '=', active_id)]</field>
</record>
<record model="ir.action.act_window.view"
id="act_module_form2_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="module_view_tree"/>
<field name="act_window" ref="act_module_form2"/>
</record>
<record model="ir.action.act_window.view"
id="act_module_form2_view2">
<field name="sequence" eval="2"/>
<field name="view" ref="module_view_form"/>
<field name="act_window" ref="act_module_form2"/>
</record>
<record model="ir.action.keyword" id="act_category_keyword1">
<field name="action" ref="act_module_form2"/>
<field name="keyword">tree_open</field>
<field name="model">ir.module.category,0</field>
</record>
<record model="ir.ui.view" id="config_wizard_item_view_tree">
<field name="model">ir.module.module.config_wizard.item</field>
<field name="type">tree</field>
-1
View File
@@ -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.
''',
-1
View File
@@ -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
-1
View File
@@ -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