首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >odoo向导无法继承该模型

odoo向导无法继承该模型
EN

Stack Overflow用户
提问于 2021-12-26 08:20:01
回答 2查看 174关注 0票数 0

我创建了这样一个模型

代码语言:javascript
复制
class FoundCheque(models.TransientModel):
    _name = "found.cheque"


    date_Found = fields.Date(string='Found Date', default=fields.Date.context_today, required=True, translate=True)

及其观点

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <record model="ir.ui.view" id="wizard_found_cheque">
            <field name="name">found.cheque.wizard</field>
            <field name="model">found.cheque</field>
            <field name="arch" type="xml">
                <form string="found Cheque">
                    <group>
                        <field name="date_found" style="width:40%%"/>
                    </group>
                    <footer>
                        <button name="found_cheque" string="Post" type="object" class="oe_highlight"/>
                        or <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>
    </data>
</odoo>

但是,当我试图在重新启动服务后更新模块时,它只是说:

代码语言:javascript
复制
Field `date_found` does not exist

Error context:
View `found.cheque.wizard`
[view_id: 4100, xml_id: n/a, model: found.cheque, parent_id: n/a]
None" while parsing /opt/odoo/odoo11-custom-addons/cheque_management/views/found_cheque.xml:4, near
<record model="ir.ui.view" id="wizard_found_cheque">
            <field name="name">found.cheque.wizard</field>
            <field name="model">found.cheque</field>
            <field name="arch" type="xml">
                <form string="found Cheque">
                    <group>
                        <field name="date_found" style="width:40%%"/>
                    </group>
                    <footer>
                        <button name="found_cheque" string="Post" type="object" class="oe_highlight" confirm="آیا مطمئن هستید؟"/>
                        or <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>

为了补充一句,我重新启动了几次服务

如有需要,我们会增加更多资料。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-12-28 08:14:41

python文件中的字段名是xml中的date_Found和date_found。两者都不一样。因此,在xml文件中更改字段名

票数 0
EN

Stack Overflow用户

发布于 2021-12-26 09:22:33

模型中定义的字段为"date_Found“,向导中定义的字段为"date_found”。

F

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70485073

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档