Community mailing list archives

[8.0] wizard view during module install

- 01/17/2015 12:03:20
Hi guys,
i'm trying to launch a wizard view during module install. I've looked at the code in the account module and made something similar, but can't reach the goal.
How can i achieve this task?

This is the code written until now (i'm porting a module to v8). The view is listed in the data section in and the is imported in the file
Thanks in advance
from openerp.osv import osv
from openerp import fields, models

class CorrispettiviConfigData(models.TransientModel):
    _name = ''
    _inherit = 'res.config'

    default_credit_account_id = fields.Many2one('account.account', 'Default credit account', domain=[('type','!=','view')], required=True, help='If doubtful, use income account')
    default_debit_account_id = fields.Many2one('account.account', 'Default debit account', domain=[('type','!=','view')], required=True, help='If doubtful, use income account')

    def execute(self, cr, uid, ids, context=None):
        for o in self.browse(cr, uid, ids, context=context):
            seq_id = self.pool.get('ir.sequence').create(cr, uid, {
                'name': 'Sezionale Corrispettivi',
                'padding': 3,
                'prefix': 'COJ/%(year)s/',
            journal_id = self.pool.get('account.journal').create(cr, uid, {
                'code': 'COJ',
                'name': 'Sezionale Corrispettivi',
                'type': 'sale',
                'corrispettivi': True,
                'sequence_id': seq_id,
            partner_id = self.pool.get('res.partner').create(cr, uid, {
                'name': 'Corrispettivi',
                'ref': 'COJ',
                'customer': False,
                'supplier': False,
                'corrispettivi': True,

<?xml version="1.0" encoding="utf-8"?>

        <!-- configartion view -->

        <record id="view_corrispettivi_config_data" model="ir.ui.view">
            <field name="name">Configure Corrispettivi</field>
            <field name="model"></field>
            <field name="type">form</field>
            <field name="inherit_id" ref="base.res_config_installer"/>
            <field name="arch" type="xml">
                <form position="attributes">
                  <attribute name="string">Corrispettivi Configuration</attribute>
<separator string="title" position="replace">
                    <p class="oe_grey">
Select data to configure Corrispettivi module.
                    <group string="Configure corrispettivi" groups="account.group_account_user">
<group colspan="4" >
                            <field name="default_credit_account_id"/>
                            <field name="default_debit_account_id"/>
<footer position="replace">
                      <button name="action_next" type="object" string="Continue" class="oe_highlight"/>
                      <button string="Skip" class="oe_link" special="cancel" />

        <record id="action_corrispettivi_config_data" model="ir.actions.act_window">
            <field name="name">Configure Corrispettivi</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model"></field>
            <field name="view_id" ref="view_corrispettivi_config_data"/>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>

        <!-- register configuration wizard -->
        <record id="config_wizard_step_corrispettivi_config_data" model="ir.actions.todo">
            <field name="action_id" ref="action_corrispettivi_config_data"/>
            <field name="restart">onskip</field>
            <field name="groups_id" eval="[(6,0,[ref('base.group_no_one')])]"/>