为什么向导视图找不到模型?

时间:2015-12-30 00:34:34

标签: python-2.7 openerp wizard openerp-8

我在odoo中创建一个简单的向导,我想显示向导但是,我的模型无法找到我的视图。我的简单代码有什么问题?

这是我的向导

2.2G    ./bbg-sevent-test-159

这是我的观点:

class RequestReceiveWizard(models.TransientModel):

_name ='estate.nursery.requestreceivewizard'

# def _default_session(self):
#     return self.env['estate.nursery.requestline'].browse(self._context.get('request_id'))
name=fields.Char("Wizard name")
request_id=fields.Many2one('estate.nursery.request')
requestline_ids = fields.Many2many("estate.nursery.requestline")

我的简单代码有什么问题?这是我的错误

 <!--request Wizard -->
    <record model="ir.ui.view" id="request_view_wizard">
        <field name="name">Request receive wizard</field>
        <field name="model">estate.nursery.requestreceivewizard</field>
        <field name="arch" type="xml">
            <form string="Wizard For Request Received">
                    <group  collspan="2" col="2">
                        <field name="name"/>
                        <field name="requestline_ids"/>
                    </group>
                <footer>
                    <button name="Apply" type="Action" string="Apply" >Apply</button>
                    <button special="cancel" string="Cancel">Cancel</button>
                </footer>
            </form>
        </field>
    </record>

    <act_window id="received_request_wizard" name="Request Wizard"
                    src_model="estate.nursery.request"
                    res_model="estate.nursery.requestreceivewizard"
                    view_mode="form"
                    target="new"
                    multi="True" key2="client_action_multi"/>

1 个答案:

答案 0 :(得分:0)

act_window替换为此记录并尝试此代码:

 <record id="received_request_wizard" model="ir.actions.act_window">
        <field name="name">estate.nursery.request</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">estate.nursery.request</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="request_view_wizard"/>
        <field name="target">new</field>
    </record>

可能对你有用......