summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2011-12-06 12:15:31 +0100
committerFabien Pinckaers <fp@tinyerp.com>2011-12-06 12:15:31 +0100
commitf7d4c3384d57e21739eeea377aa96a628e0f2e40 (patch)
tree88d1c0e07f636da566b06e573345724882be96c6
parent1719b9408b5eb93cba3fe82920e6fb39988197c2 (diff)
[IMP] Core features on modules, better views for modules
bzr revid: fp@tinyerp.com-20111206111531-qdkajwatqzb0dz45
-rw-r--r--openerp/addons/base/base.sql2
-rw-r--r--openerp/addons/base/module/module.py1
-rw-r--r--openerp/addons/base/module/module_view.xml41
-rw-r--r--openerp/modules/db.py6
-rw-r--r--openerp/modules/module.py2
5 files changed, 26 insertions, 26 deletions
diff --git a/openerp/addons/base/base.sql b/openerp/addons/base/base.sql
index 55c4d41aba5..6f3a8ed1ee8 100644
--- a/openerp/addons/base/base.sql
+++ b/openerp/addons/base/base.sql
@@ -287,6 +287,7 @@ CREATE TABLE ir_module_module (
name character varying(128) NOT NULL,
author character varying(128),
url character varying(128),
+ icon character varying(64),
state character varying(16),
latest_version character varying(64),
shortdesc character varying(256),
@@ -294,6 +295,7 @@ CREATE TABLE ir_module_module (
category_id integer REFERENCES ir_module_category ON DELETE SET NULL,
certificate character varying(64),
description text,
+ core boolean default False,
demo boolean default False,
web boolean DEFAULT FALSE,
license character varying(32),
diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py
index 7a4ca000e63..fd69c0750ab 100644
--- a/openerp/addons/base/module/module.py
+++ b/openerp/addons/base/module/module.py
@@ -215,6 +215,7 @@ class module(osv.osv):
'views_by_module': fields.function(_get_views, method=True, string='Views', type='text', multi="meta", store=True),
'certificate' : fields.char('Quality Certificate', size=64, readonly=True),
'web': fields.boolean('Has a web component', readonly=True),
+ 'core': fields.boolean('Is a Core Application', readonly=True),
'icon': fields.char('Icon URL', size=128),
'complexity': fields.selection([('easy','Easy'), ('normal','Normal'), ('expert','Expert')],
string='Complexity', readonly=True,
diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml
index 80a13a75e35..38595f2bc19 100644
--- a/openerp/addons/base/module/module_view.xml
+++ b/openerp/addons/base/module/module_view.xml
@@ -39,24 +39,16 @@
<field name="arch" type="xml">
<search string="Search modules">
<group col='10' colspan='4'>
- <filter icon="terp-check" string="Installed" domain="[('state', 'in', ['installed', 'to upgrade', 'to remove'])]"/>
- <filter icon="terp-dialog-close" string="Not Installed" domain="[('state', 'in', ['uninstalled', 'uninstallable'])]"/>
- <filter icon="terp-gtk-jump-to-ltr" string="To be upgraded" domain="[('state','in', ['to upgrade', 'to remove', 'to install'])]"/>
- <separator orientation="vertical"/>
- <filter icon="terp-camera_test" string="Certified" domain="[('certificate','&lt;&gt;', False)]"/>
+ <filter icon="terp-check" string="Main Apps" domain="[('core', '=', 1)]"/>
+ <filter icon="terp-check" string="Extra" domain="[('core', '=', 0)]"/>
+
<separator orientation="vertical"/>
- <field name="name"/>
- <field name="complexity"/>
- <field name="description"/>
- <field name="dependencies_id"/>
- <field name="state"/>
- </group>
- <newline/>
- <group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
- <filter string="Author" icon="terp-personal" domain="[]" context="{'group_by':'author'}"/>
+ <filter icon="terp-check" string="Installed" domain="[('state', 'in', ['installed', 'to upgrade', 'to remove'])]"/>
+ <filter icon="terp-dialog-close" string="Not Installed" domain="[('state', 'in', ['uninstalled', 'uninstallable', 'to install'])]"/>
<separator orientation="vertical"/>
- <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category_id'}"/>
- <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
+ <field name="name"
+ domain="['|','|', ('name','ilike',self), ('description','ilike',self), ('shortdesc','ilike',self) ]"
+ string="Name / Keywords"/>
</group>
</search>
</field>
@@ -118,13 +110,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Module">
- <field name="name" select="1"/>
- <field name="certificate" />
- <field colspan="4" name="shortdesc" select="2"/>
- <field name="category_id"/>
- <field name="complexity"/>
- <field name="demo" readonly="1"/>
- <field name="icon"/>
+ <group colspan="4" col="6">
+ <field name="name"/>
+ <field name="shortdesc"/>
+ <field name="certificate" />
+ <field name="category_id"/>
+ <field name="complexity"/>
+ <field name="demo"/>
+ <field name="icon"/>
+ <field name="core"/>
+ </group>
<notebook colspan="4">
<page string="Module">
<group colspan="4" col="4">
diff --git a/openerp/modules/db.py b/openerp/modules/db.py
index 692bf9732f1..4f8032716a9 100644
--- a/openerp/modules/db.py
+++ b/openerp/modules/db.py
@@ -75,14 +75,14 @@ def initialize(cr):
cr.execute('INSERT INTO ir_module_module \
(author, website, name, shortdesc, description, \
- category_id, state, certificate, web, license, complexity) \
- VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
+ category_id, state, certificate, web, license, complexity, core, icon) \
+ VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id', (
info['author'],
info['website'], i, info['name'],
info['description'], category_id, state, info['certificate'],
info['web'],
info['license'],
- info['complexity']))
+ info['complexity'], info['core'], info['icon']))
id = cr.fetchone()[0]
cr.execute('INSERT INTO ir_model_data \
(name,model,module, res_id, noupdate) VALUES (%s,%s,%s,%s,%s)', (
diff --git a/openerp/modules/module.py b/openerp/modules/module.py
index 53e8b86d6bf..09fcb2e9a0a 100644
--- a/openerp/modules/module.py
+++ b/openerp/modules/module.py
@@ -250,6 +250,8 @@ def load_information_from_description_file(module):
info.setdefault('name', False)
info.setdefault('description', '')
info.setdefault('complexity', 'normal')
+ info.setdefault('core', False)
+ info.setdefault('icon', '')
info['certificate'] = info.get('certificate') or None
info['web'] = info.get('web') or False
info['license'] = info.get('license') or 'AGPL-3'