Configuration wizard to install extra modules on accounting,association,manufacturing profile
bzr revid: hmo@tinyerp.com-20080826111035-sa7ps00fjbhbkaud
This commit is contained in:
parent
51c6c66a7c
commit
1794ee6b6d
|
@ -27,7 +27,7 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import profile_accounting
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"category":"Profile",
|
||||
"depends":["account","report_analytic","board_account","account_followup",'invoice_payment_tab'],
|
||||
"demo_xml":[],
|
||||
"update_xml":[],
|
||||
"update_xml":["profile_accounting.xml"],
|
||||
"active":False,
|
||||
"installable":True,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
###############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import pooler
|
||||
|
||||
class config_install_extra_modules(osv.osv_memory):
|
||||
_name='config.install_extra_modules'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=64),
|
||||
'account_analytic_analysis':fields.boolean('Analytic Accounting'),
|
||||
'account_analytic_plans':fields.boolean('Multiple Analytic Plans'),
|
||||
'account_payment':fields.boolean('Suppliers Payment Management'),
|
||||
'account_asset':fields.boolean('Asset Management'),
|
||||
'hr_timesheet_invoice':fields.boolean('Invoice on Analytic Entries'),
|
||||
'account_budget_crossover':fields.boolean('Analytic Budgets'),
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
result=self.read(cr,uid,ids)
|
||||
mod_obj = self.pool.get('ir.module.module')
|
||||
for res in result:
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
ids += mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.action_install(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
config_install_extra_modules()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
<record id="view_confirm_install_module_form" model="ir.ui.view">
|
||||
<field name="name">Install extra modules</field>
|
||||
<field name="model">config.install_extra_modules</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Install Extra Module">
|
||||
<separator string="Accounting Management" colspan="4"/>
|
||||
<field name="account_analytic_analysis"/>
|
||||
<field name="account_analytic_plans"/>
|
||||
<field name="account_payment"/>
|
||||
<separator string="Resources Management" colspan="4"/>
|
||||
<field name="account_budget_crossover"/>
|
||||
<field name="account_asset"/>
|
||||
<separator string="Services Management" colspan="4"/>
|
||||
<field name="hr_timesheet_invoice"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
|
||||
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_install_module" model="ir.actions.act_window">
|
||||
<field name="name">Install Extra Modules</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">config.install_extra_modules</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.module.module.configuration.step"
|
||||
id="config_install_module">
|
||||
<field name="name">Install Extra modules</field>
|
||||
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
|
||||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
|
@ -26,5 +26,6 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
import profile_association
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"category":"Profile",
|
||||
"depends":["membership", "event", "association_vertical", "board_association"],
|
||||
"demo_xml":[],
|
||||
"update_xml":[],
|
||||
"update_xml":["profile_association.xml"],
|
||||
"active":False,
|
||||
"installable":True,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
###############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import pooler
|
||||
|
||||
|
||||
class config_install_extra_modules(osv.osv_memory):
|
||||
_name='config.install_extra_modules'
|
||||
_columns = {
|
||||
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
|
||||
'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
|
||||
'project':fields.boolean('Project Management'),
|
||||
'event' : fields.boolean('Events Organisation'),
|
||||
'crm' : fields.boolean('Fund Raising'),
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
result=self.read(cr,uid,ids)
|
||||
mod_obj = self.pool.get('ir.module.module')
|
||||
for res in result:
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.action_install(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
config_install_extra_modules()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
<record id="view_confirm_install_module_form" model="ir.ui.view">
|
||||
<field name="name">Install extra modules</field>
|
||||
<field name="model">config.install_extra_modules</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Install Extra Module">
|
||||
<separator string="Project Management" colspan="4"/>
|
||||
<field name="project"/>
|
||||
<field name="event"/>
|
||||
<separator string="Resources Management" colspan="4"/>
|
||||
<field name="hr_expense"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="crm_configuration"/>
|
||||
<field name="crm"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
|
||||
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_install_module" model="ir.actions.act_window">
|
||||
<field name="name">Install Extra Modules</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">config.install_extra_modules</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.module.module.configuration.step"
|
||||
id="config_install_module">
|
||||
<field name="name">Install Extra modules</field>
|
||||
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
|
||||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
|
@ -27,7 +27,7 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import profile_manufacturing
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"category":"Profile",
|
||||
"depends":["mrp", "crm", "sale", "delivery","board_manufacturing"],
|
||||
"demo_xml":[],
|
||||
"update_xml":[],
|
||||
"update_xml":["profile_manufacturing.xml"],
|
||||
"active":False,
|
||||
"installable":True,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id: __terp__.py 8595 2008-06-16 13:00:21Z stw $
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
###############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import pooler
|
||||
|
||||
|
||||
class config_install_extra_modules(osv.osv_memory):
|
||||
_name='config.install_extra_modules'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=64),
|
||||
'mrp_jit':fields.boolean('Just in Time Scheduling'),
|
||||
'sale_margin':fields.boolean('Margins on Sales Order'),
|
||||
'crm_configuration':fields.boolean('CRM & Calendars'),
|
||||
'sale_journal':fields.boolean('Manage by Journals'),
|
||||
'project':fields.boolean('Project Management'),
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
result=self.read(cr,uid,ids)
|
||||
mod_obj = self.pool.get('ir.module.module')
|
||||
for res in result:
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.action_install(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.module.module.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
|
||||
config_install_extra_modules()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<terp>
|
||||
<data>
|
||||
<record id="view_confirm_install_module_form" model="ir.ui.view">
|
||||
<field name="name">Install extra modules</field>
|
||||
<field name="model">config.install_extra_modules</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Install Extra Module">
|
||||
<separator string="Manufacturing Management" colspan="4"/>
|
||||
<field name="mrp_jit"/>
|
||||
<separator string="Sale Management" colspan="4"/>
|
||||
<field name="sale_margin"/>
|
||||
<field name="sale_journal"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="crm_configuration"/>
|
||||
<separator string="Project Management" colspan="4"/>
|
||||
<field name="project"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
|
||||
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_install_module" model="ir.actions.act_window">
|
||||
<field name="name">Install Extra Modules</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">config.install_extra_modules</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.module.module.configuration.step"
|
||||
id="config_install_module">
|
||||
<field name="name">Install Extra modules</field>
|
||||
<field name="note">Install more modules. A few modules are proposed according to the service profile you selected. You will be able to install them based on our requirements.</field>
|
||||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="state">open</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
|
@ -53,13 +53,15 @@ class config_install_extra_modules(osv.osv_memory):
|
|||
'target':'new',
|
||||
}
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
res=self.read(cr,uid,ids)[0]
|
||||
result=self.read(cr,uid,ids)
|
||||
mod_obj = self.pool.get('ir.module.module')
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', res[r])])
|
||||
mod_obj.download(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
for res in result:
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.action_install(cr,uid,ids,context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
|
|
Loading…
Reference in New Issue