[MERGE] base: improved config wizard, plus some usability improvements in views
bzr revid: odo@openerp.com-20100923105124-g0jn3lf7w7pprxkt
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
'module/wizard/base_language_install_view.xml',
|
||||
'module/wizard/base_import_language_view.xml',
|
||||
'module/wizard/base_module_upgrade_view.xml',
|
||||
#TODO: 'module/wizard/base_module_configuration_view.xml',
|
||||
'module/wizard/base_module_configuration_view.xml',
|
||||
'module/wizard/base_export_language_view.xml',
|
||||
'module/wizard/base_update_translations_view.xml',
|
||||
'res/res_request_view.xml',
|
||||
|
||||
@@ -1908,9 +1908,6 @@
|
||||
<field name="action_id"/>
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
<button name="action_open" states="cancel,skip,done"
|
||||
string="Todo" type="object" help="Set as Todo"
|
||||
icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1961,14 +1958,8 @@
|
||||
</record>
|
||||
<menuitem id="next_id_11" name="Configuration Wizards" parent="base.menu_config" sequence="1"/>
|
||||
|
||||
<wizard id="wizard_configuration" model="ir.module.module" name="module.configuration" string="Start Configuration"/>
|
||||
<menuitem action="act_ir_actions_todo_form" id="menu_ir_actions_todo_form"
|
||||
parent="next_id_11" groups="base.group_extended" sequence="20"/>
|
||||
|
||||
<menuitem
|
||||
action="wizard_configuration" name="Start Configuration"
|
||||
id="menu_configurator_module" parent="next_id_11"
|
||||
type="wizard"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="maintenance_contract_search_view" model="ir.ui.view">
|
||||
<field name="name">maintenance.contract.search</field>
|
||||
<field name="model">maintenance.contract</field>
|
||||
@@ -51,7 +51,7 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="maintenance_contract_view_calendar" model="ir.ui.view">
|
||||
<field name="name">maintenance.contract.calendar</field>
|
||||
<field name="model">maintenance.contract</field>
|
||||
@@ -106,9 +106,9 @@
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button type="object" string="_Close" icon="gtk-cancel" special="cancel" states="draft"/>
|
||||
<button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="draft"/>
|
||||
<button type="object" string="_Validate" icon="gtk-apply" name="action_validate" states="draft"/>
|
||||
<button type="object" string="_Close" icon="gtk-close" special="cancel" states="validated,unvalidated"/>
|
||||
<button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="validated,unvalidated"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
#Old Wizard
|
||||
import wizard_configuration
|
||||
|
||||
import base_module_import
|
||||
import base_module_update
|
||||
import base_language_install
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
<group col="2" colspan="2">
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" states="choose" string="_Close" type="object"/>
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" states="choose" string="_Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_getfile" states="choose" string="_Export" type="object"></button>
|
||||
<button icon="gtk-close" name="act_destroy" special="cancel" states="get" string="_Close" type="object"/>
|
||||
</group>
|
||||
<button icon="gtk-cancel" name="act_destroy" special="cancel" states="get" string="_Cancel" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help">
|
||||
<label align="0.0" colspan="4" string="The official translations pack of all OpenERP/OpenObjects module are managed through launchpad. We use their online interface to synchronize all translations efforts."/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<group colspan="2" col="2">
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<button special="cancel" string="_Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="_Cancel" icon="gtk-cancel"/>
|
||||
<button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</page>
|
||||
@@ -32,7 +32,7 @@
|
||||
<label string="You can also import .po files." colspan="4" align="0.0"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<field name="lang" colspan="4"/>
|
||||
<label align="0.0" string="Note that this operation may take a few minutes." colspan="4"/>
|
||||
<separator string="" colspan="6"/>
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="lang_install" string="Start installation" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -19,15 +19,33 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import pooler
|
||||
from osv import osv, fields
|
||||
from osv import osv
|
||||
from tools.translate import _
|
||||
|
||||
class base_module_configuration(osv.osv_memory):
|
||||
|
||||
_name = "base.module.configuration"
|
||||
_name = "base.module.configuration"
|
||||
|
||||
def config(self, cr, uid, data, context=None):
|
||||
return self.pool.get('res.config').next(cr, uid, [], context=context)
|
||||
def start(self, cr, uid, ids, context=None):
|
||||
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), ('restart', '=', 'always')])
|
||||
if not todo_ids:
|
||||
# When there is no wizard todo it will display message
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
result = data_obj._get_id(cr, uid, 'base', 'view_base_module_configuration_form')
|
||||
view_id = data_obj.browse(cr, uid, result).res_id
|
||||
value = {
|
||||
'name': _('System Configuration done'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'base.module.configuration',
|
||||
'view_id': [view_id],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
return value
|
||||
# Run the config wizards
|
||||
config_pool = self.pool.get('res.config')
|
||||
return config_pool.start(cr, uid, ids, context=context)
|
||||
|
||||
base_module_configuration()
|
||||
|
||||
|
||||
@@ -2,35 +2,42 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_base_module_configuration" model="ir.ui.view">
|
||||
<record id="view_base_module_configuration_form" model="ir.ui.view">
|
||||
<field name="name">Module Configuration</field>
|
||||
<field name="model">base.module.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="">
|
||||
</form>
|
||||
<form string="System Configuration Done">
|
||||
<label align="0.0" string="All pending configuration wizards have been executed. You may restart individual wizards via the list of configuration wizards." colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<button special="cancel" string="_Ok" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_base_module_configuration" model="ir.actions.act_window">
|
||||
<field name="name">Module Configuration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.module.configuration</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
|
||||
<record id="action_start_configurator" model="ir.actions.server">
|
||||
<field name="name">Start Configuration</field>
|
||||
<field name="model_id" ref="model_base_module_configuration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = obj.start([])</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Start Configuration"
|
||||
action="action_view_base_module_configuration"
|
||||
id="menu_view_base_module_configuration"
|
||||
parent="next_id_11"
|
||||
sequence="2"/>
|
||||
<menuitem name="Start Configuration"
|
||||
action="action_start_configurator"
|
||||
id="menu_view_base_module_configuration" parent="next_id_11"
|
||||
type="server" icon="STOCK_EXECUTE" sequence="2" />
|
||||
|
||||
<act_window id="action_view_base_module_configuration_window"
|
||||
key2="client_action_multi" name="Start Configuration"
|
||||
res_model="base.module.configuration" src_model="ir.module.module"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
<record model="ir.values" id="action_todo_config">
|
||||
<field name="model_id" ref="model_ir_actions_todo" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Start Configuration</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('action_start_configurator'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">ir.actions.todo</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="importzip" string="Import module" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
@@ -47,7 +47,7 @@
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<group>
|
||||
<button name="action_module_open" string="Close" type="object" icon="gtk-cancel"/>
|
||||
<button name="action_module_open" string="Cancel" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="update_module" string="Check new modules" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
@@ -47,7 +47,7 @@
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_module_open" string="OK" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<separator string="Modules to update" colspan="4"/>
|
||||
<field name="module_info" nolabel="1" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="upgrade_module" string="Start update" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
@@ -53,7 +53,7 @@
|
||||
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<button special="cancel" string="Close" icon="gtk-cancel"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="config" string="Start configuration" type="object" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<label align="0.0" colspan="4" string="This wizard will detect new terms in the application so that you can update them manually."/>
|
||||
<separator colspan="4"/>
|
||||
<group col="2" colspan="4" fill="0">
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="Close" type="object"/>
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_update" string="Update" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
class wizard_configuration(wizard.interface):
|
||||
|
||||
def _config(self, cr, uid, data, context=None):
|
||||
return pooler.get_pool(cr.dbname).get('res.config')\
|
||||
.next(cr, uid, [], context=context)
|
||||
|
||||
states = {
|
||||
'init':{
|
||||
'result': {
|
||||
'type': 'action',
|
||||
'action': _config,
|
||||
'state': 'end',
|
||||
},
|
||||
}
|
||||
}
|
||||
wizard_configuration('module.configuration')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">res.request</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Requests">
|
||||
<tree string="Requests" colors="blue:state in ('draft');gray:state in ('closed')">
|
||||
<field name="create_date"/>
|
||||
<field name="act_from"/>
|
||||
<field name="act_to"/>
|
||||
@@ -87,7 +87,7 @@
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
</record>
|
||||
<record id="res_request_calendar_view" model="ir.ui.view">
|
||||
<field name="name">res.request.calendar</field>
|
||||
<field name="model">res.request</field>
|
||||
@@ -109,7 +109,7 @@
|
||||
<field name="context">{"search_default_act_to":uid}</field>
|
||||
</record>
|
||||
<menuitem action="res_request-act" id="menu_res_request_act" parent="base.next_id_4" sequence="1"/>
|
||||
|
||||
|
||||
<record id="res_request_link-view" model="ir.ui.view">
|
||||
<field name="name">res.request.link.form</field>
|
||||
<field name="model">res.request.link</field>
|
||||
@@ -144,7 +144,7 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="res_request_link-act" model="ir.actions.act_window">
|
||||
<field name="name">References Link</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -154,8 +154,8 @@
|
||||
<field name="search_view_id" ref="res_request_link_search_view"/>
|
||||
</record>
|
||||
<menuitem action="res_request_link-act" id="menu_res_request_link_act" parent="base.next_id_4" sequence="4"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="res_request_history_tree-view" model="ir.ui.view">
|
||||
<field name="name">res.request.history.tree</field>
|
||||
<field name="model">res.request.history</field>
|
||||
@@ -169,7 +169,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="res_request_history_form-view" model="ir.ui.view">
|
||||
<field name="name">res.request.history.form</field>
|
||||
<field name="model">res.request.history</field>
|
||||
|
||||
Reference in New Issue
Block a user