1
votes

i created a wizard and now its giving me the above error , it took me ages but couldn't sorted it , between am doing wizard for the first time in Openerp . please help thanks in advance . here is my code

class test_wizard(osv.osv_memory):
    _name="test.wizard"
    _description="will generate dynamic views, that's all"
    _columns={
              'age_text': fields.text('text age'),
    }

    def next(self,cr,uid,ids,contet=None):
        test_obj=self.pool.get('test.chbc')
        for wiz in self.browse(cr,uid,ids):
            if wiz.age_text <=5:
                raise osv.except_osv('user error, please slect something ,  know what')
            limit= datetime.date.today()-datetime.timedelta(days=wiz.age_text)
            ids_to_del=test_obj.search(cr,uid,[('create_date','<',
                                                limit.striftime('%y-%m-%d 00:00:00'))],context=context)
            test_obj.unlink(cr,uid,ids_to_del)
        return{}


test_wizard()

here is my xml

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

    <record id="test_wizard" model="ir.ui.view">
        <field name="name">test.wizard.form</field>
        <field name="model">test.wizard</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Test wizard ">
                <label colspan="4" string="select age please , am in a hurry "/>
                <field name="age_text" string="Age(days)"/>
                <group col="4" colspan="4">
                    <button icon="gtk-cancel" special="cancel" string="Cancel"/>
                    <button icon="gtk-ok" name="next" string="Next" type="object"/>
                </group>
            </form>
        </field>
    </record>

    <record id="action_test_wizard" model="ir.actions.act_window">
        <field name="name">Next</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">test.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>


    </data>
</openerp>
1
Change you model name mean give the name of the class where you want to put ituser3702726

1 Answers

1
votes

Change you model name mean give the name of the class where you want to put it

<field name="model">test.wizard</field>