我已经在 linux 上安装了 odoo 10,它运行良好我正在关注 odoo 网站“构建模块”的官方教程
https://www.odoo.com/documentation/10.0/howtos/backend.html#build-an-odoo-module
我创建了一个空模块
odoo-bin scaffold openacademy addons
但是当我尝试将模块导入到 xml 文件openacademy.xml 时,我收到以下错误
Error context:
View `course.form`
[view_id: 4867, xml_id: n/a, model: openacademy.course, parent_id: n/a]
None" while parsing /opt/odoo/odoo-
10.0/addons/openacademy/views/openacademy.xml:6, near
<record model="ir.ui.view" id="course_form_view">
<field name="name">course.form</field>
<field name="model">openacademy.course</field>
<field name="arch" type="xml">
<form string="Course Form">
<sheet>
<group>
<field name="name"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>
openacademy.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="course_form_view">
<field name="name">`course.form`</field>
<field name="model">`openacademy.course`</field>
<field name="arch" type="xml">
<form string="Course Form">
<sheet>
<group>
<field name="name"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>
</data>
</odoo>
模型.py
from odoo import models, fields, api
class Course(models.Model):
_name = 'openacademy.course'
name = fields.Char(string="Title", required=True)
description = fields.Text()
__init__.py
from . import models