[fix] profile_manufacturing: migrate to res.config-based initial configuration
bzr revid: xmo@tinyerp.com-20091215145847-j0x1ermf1lqeozfq
This commit is contained in:
@@ -25,6 +25,8 @@ import pooler
|
||||
|
||||
class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
|
||||
_name='profile.manufacturing.config.install_modules_wizard'
|
||||
_inherit = 'res.config'
|
||||
|
||||
_columns = {
|
||||
'mrp_jit':fields.boolean('Just in Time Scheduling',
|
||||
help="The JIT module allows you to not run the scheduler "\
|
||||
@@ -76,31 +78,16 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
|
||||
help="Allow to manage product repairs. Handle the guarantee limit date and the invoicing of products and services."),
|
||||
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
result=self.read(cr,uid,ids)
|
||||
def execute(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]:
|
||||
if r != 'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.button_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.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
profile_manufacturing_config_install_modules_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -5,46 +5,47 @@
|
||||
<field name="name">Manufacturing Profile: Install Extra Modules</field>
|
||||
<field name="model">profile.manufacturing.config.install_modules_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Manufacturing Profile: Install Extra Modules">
|
||||
<separator string="Stock & Manufacturing" colspan="4"/>
|
||||
<field name="stock_location"/>
|
||||
<field name="mrp_jit"/>
|
||||
<field name="mrp_operation"/>
|
||||
<field name="mrp_subproduct"/>
|
||||
<field name="mrp_repair"/>
|
||||
<separator string="Sales Management" colspan="4"/>
|
||||
<field name="point_of_sale"/>
|
||||
<field name="sale_journal"/>
|
||||
<field name="sale_margin"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="sale_crm"/>
|
||||
<field name="board_document"/>
|
||||
<field name="warning"/>
|
||||
<field name="portal"/>
|
||||
<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>
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Manufacturing Profile: Install Extra Modules
|
||||
</attribute></form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<label colspan="4" align="0.0" string="
|
||||
Install more modules. A few modules are proposed according
|
||||
to the Account Profile you selected. You will be able to
|
||||
install them based on our requirements."/>
|
||||
<separator string="Stock & Manufacturing" colspan="4"/>
|
||||
<field name="stock_location"/>
|
||||
<field name="mrp_jit"/>
|
||||
<field name="mrp_operation"/>
|
||||
<field name="mrp_subproduct"/>
|
||||
<field name="mrp_repair"/>
|
||||
<separator string="Sales Management" colspan="4"/>
|
||||
<field name="point_of_sale"/>
|
||||
<field name="sale_journal"/>
|
||||
<field name="sale_margin"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="sale_crm"/>
|
||||
<field name="board_document"/>
|
||||
<field name="warning"/>
|
||||
<field name="portal"/>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_install_module" model="ir.actions.act_window">
|
||||
<field name="name">Manufacturing Profile: Install Extra Modules</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">profile.manufacturing.config.install_modules_wizard</field>
|
||||
<field name="view_id" ref="view_confirm_install_module_form"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.todo"
|
||||
id="config_install_module">
|
||||
<field name="name">Manufacturing Profile: Install Extra modules</field>
|
||||
<field name="note">Install more modules. A few modules are proposed according to the manufacturing profile you selected. You will be able to install them based on our requirements.</field>
|
||||
<field name="action_id" ref="action_config_install_module"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user