[REM]: base_setup: Removed unused code, cleaned code

bzr revid: rpa@tinyerp.com-20110627061340-yk7f5shyzj1qvcrj
This commit is contained in:
Rucha (Open ERP) 2011-06-27 11:43:40 +05:30
parent a62aacaf7c
commit 111aaad609
6 changed files with 67 additions and 121 deletions

View File

@ -20,7 +20,6 @@
##############################################################################
import installer
import todo
import wizard
import os
import base64

View File

@ -39,7 +39,6 @@ It also helps to easily configure your company.
'update_xml': ['security/ir.model.access.csv',
'wizard/res_company_logo_view.xml',
'base_setup_installer.xml',
'base_setup_todo.xml',
],
'demo_xml': ['base_setup_demo.xml'],
'installable': True,

View File

@ -1,6 +1,6 @@
<openerp>
<data>
<record id="view_base_setup_installer" model="ir.ui.view">
<field name="name">base.setup.installer.view</field>
<field name="model">base.setup.installer</field>
@ -24,7 +24,7 @@
<separator string="title" position="attributes">
<attribute name="string">Install Applications</attribute>
</separator>
<group colspan="8">
<field name="crm" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account_accountant,purchase,hr,point_of_sale,marketing,profile_tools,report_designer,association,auction,product_expiry)"/>
<field name="sale" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account_accountant,purchase,hr,point_of_sale,marketing,profile_tools,report_designer,association,auction,product_expiry)"/>
@ -44,18 +44,18 @@
<field name="association" attrs="{'readonly':['|',('auction','=',True),('product_expiry','=',True)]}" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account_accountant,purchase,hr,point_of_sale,marketing,profile_tools,report_designer,association,auction,product_expiry)"/>
<field name="auction" attrs="{'readonly':['|',('association','=',True),('product_expiry','=',True)]}" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account_accountant,purchase,hr,point_of_sale,marketing,profile_tools,report_designer,association,auction,product_expiry)"/>
<field name="product_expiry" attrs="{'readonly':['|',('association','=',True),('auction','=',True)]}" on_change="onchange_moduleselection(crm,sale,project,knowledge,stock,mrp,account_accountant,purchase,hr,point_of_sale,marketing,profile_tools,report_designer,association,auction,product_expiry)"/>
<group name="crm"/>
<group name="sale"/>
<group name="project"/>
<group name="knowledge"/>
<group name="mrp"/>
<group name="crm"/>
<group name="sale"/>
<group name="project"/>
<group name="knowledge"/>
<group name="mrp"/>
<group name="account_accountant"/>
<group name="purchase"/>
<group name="hr"/>
<group name="profile_tools"/>
<group name="marketing"/>
<group name="report_designer"/>
<group name="association"/>
<group name="hr"/>
<group name="profile_tools"/>
<group name="marketing"/>
<group name="report_designer"/>
<group name="association"/>
</group>
</data>
</field>
@ -77,7 +77,7 @@
<field name="sequence">2</field>
<field name="type">normal_recurring</field>
</record>
<!-- Migrate data from another application Conf Wiz-->
<record id="view_migrade_application_installer_modules" model="ir.ui.view">
@ -111,7 +111,7 @@
</data>
</field>
</record>
<record id="action_migrade_application_installer_modules" model="ir.actions.act_window">
<field name="name">Migrate data from another application</field>
<field name="type">ir.actions.act_window</field>
@ -121,16 +121,16 @@
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="migrade_application_installer_modules_todo" model="ir.actions.todo">
<field name="action_id" ref="action_migrade_application_installer_modules"/>
<field name="category_id" ref="base.category_administration_config"/>
<field name="type">normal</field>
<field name="state">skip</field>
</record>
<!-- Import or create customers configartion view -->
<record id="action_import_create_installer" model="ir.actions.act_window">
<field name="name">Import or create customers </field>
<field name="type">ir.actions.act_window</field>
@ -149,7 +149,7 @@
<field name="target">current</field>
<field name="state">skip</field>
</record>
<!-- Define default users preferences-->
<record id="view_user_preferences_config_form" model="ir.ui.view">
@ -196,16 +196,16 @@
</record>
<!-- Register configuration wizard -->
<record id="config_action_user_preferences_config_form" model="ir.actions.todo">
<field name="action_id" ref="action_user_preferences_config_form"/>
<field name="category_id" ref="base.category_administration_config"/>
<field name="type">normal</field>
<field name="state">skip</field>
</record>
<!-- Config Wiz Create New User's Login -->
<record id="action_config_access_other_user" model="ir.actions.act_window">
<field name="name">Create New User's Login</field>
<field name="type">ir.actions.act_window</field>
@ -214,7 +214,7 @@
<field name="view_mode">form</field>
<field name="view_id" ref="base.view_users_form"/>
</record>
<!-- register configuration wizard -->
<record id="config_wizard_action_config_user_form" model="ir.actions.todo">
@ -225,7 +225,7 @@
<field name="sequence">1000</field>
<field name="state">cancel</field>
</record>
<!-- Inherit company Form -->
<record id="view_inherit_res_company_logo" model="ir.ui.view">
@ -242,7 +242,7 @@
</field>
</field>
</record>
<!-- register Upload Logo configuration wizard -->
<record id="config_wizard_action_res_company_logo" model="ir.actions.todo">
@ -250,7 +250,7 @@
<field name="category_id" ref="base.category_administration_config"/>
<field name="type">normal</field>
<field name="state">cancel</field>
</record>
</record>
<!-- Specify Your Terminology Config Wiz-->
@ -295,13 +295,32 @@
</record>
<!-- Register configuration wizard -->
<record id="config_action_partner_terminology_config_form" model="ir.actions.todo">
<field name="action_id" ref="action_partner_terminology_config_form"/>
<field name="category_id" ref="base.category_administration_config"/>
<field name="type">normal</field>
<field name="state">skip</field>
</record>
</record>
<record id="action_base_setup_company" model="ir.actions.act_window">
<field name="name">Company Configuration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_id" ref="base.view_company_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="context">{'res_id': 1}</field>
</record>
<record id="base_setup_company_todo" model="ir.actions.todo">
<field name="action_id" ref="action_base_setup_company"/>
<field name="category_id" ref="base.category_administration_config"/>
<field name="sequence">1</field>
<field name="type">normal</field>
<field name="state">skip</field>
</record>
</data>
</openerp>

View File

@ -1,23 +0,0 @@
<openerp>
<data>
<record id="action_base_setup_company" model="ir.actions.act_window">
<field name="name">Company Configuration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_id" ref="base.view_company_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="context">{'res_id': 1}</field>
</record>
<record id="base_setup_company_todo" model="ir.actions.todo">
<field name="action_id" ref="action_base_setup_company"/>
<field name="category_id" ref="base.category_administration_config"/>
<field name="sequence">1</field>
<field name="type">normal</field>
<field name="state">skip</field>
</record>
</data>
</openerp>

View File

@ -22,6 +22,7 @@ from osv import fields, osv
import pooler
import pytz
from tools.translate import _
import tools
class base_setup_installer(osv.osv_memory):
_name = 'base.setup.installer'
@ -318,4 +319,23 @@ class specify_partner_terminology(osv.osv_memory):
specify_partner_terminology()
# this code is needed to be moved in main currency class
class res_currency(osv.osv):
_inherit = 'res.currency'
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
# We can use the following line,if we want to restrict this name_get for company setup only
# But, its better to show currencies as name(Code).
if not len(ids):
return []
if isinstance(ids, (int, long)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write')
return [(x['id'], tools.ustr(x['name']) + (x['symbol'] and (' (' + tools.ustr(x['symbol']) + ')') or '')) for x in reads]
res_currency()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,68 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
from osv import osv
import tools
class base_setup_company(osv.osv_memory):
"""
"""
_name = 'base.setup.company'
_inherit = 'res.config'
def execute(self, cr, uid, ids, context=None):
ir_pool = self.pool.get('ir.model.data')
model, company_view_form = ir_pool.get_object_reference(cr, uid, 'base', 'view_company_form')
model, company_view_tree = ir_pool.get_object_reference(cr, uid, 'base', 'view_company_tree')
company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
return {
'name': _('Configure Company'),
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'crm.lead',
'domain': [('id', '=', company_id)],
'res_id': company_id,
'view_id': False,
'views': [(company_view_form, 'form'),
(company_view_tree, 'tree')],
'type': 'ir.actions.act_window'
}
base_setup_company()
class res_currency(osv.osv):
_inherit = 'res.currency'
def name_get(self, cr, uid, ids, context=None):
if context is None:
context = {}
# We can use the following line,if we want to restrict this name_get for company setup only
# But, its better to show currencies as name(Code).
if not len(ids):
return []
if isinstance(ids, (int, long)):
ids = [ids]
reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write')
return [(x['id'], tools.ustr(x['name']) + (x['symbol'] and (' (' + tools.ustr(x['symbol']) + ')') or '')) for x in reads]
res_currency()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: