Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python OpenChatter与OpenERP定制模块erro的集成_Python_Openerp - Fatal编程技术网

Python OpenChatter与OpenERP定制模块erro的集成

Python OpenChatter与OpenERP定制模块erro的集成,python,openerp,Python,Openerp,我创建了一个带有表单和几个字段的模块。我想添加一个评论,比如系统(OpenERP中的Chatter),如何轻松地将Chatter添加到我的模块中 给我代码片段,让我知道在我的表单中放在哪里 我的XML文件是 <?xml version="1.0" encoding="UTF-8"?> <openerp> <data> <!-- action windows --> <record model="ir.actions.act_windo

我创建了一个带有表单和几个字段的模块。我想添加一个评论,比如系统(OpenERP中的Chatter),如何轻松地将Chatter添加到我的模块中

给我代码片段,让我知道在我的表单中放在哪里

我的XML文件是

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- action windows -->
    <record model="ir.actions.act_window" id="course_list_action">
        <field name="name">Questions form</field>
        <!--<field name="date_of_q_created">Date of Q xml</field>-->
        <field name="res_model">openacademy.course</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
        <p class="oe_view_nocontent_create">Create the first Question</p>
        </field>
    </record>

    <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="Questions Form">

      <field name="name" colspan="4" />
      <field name="description" colspan="4" />
      <field name="date_of_q_created" colspan="4" />
      <field name="category_question" colspan="4" />
      <field name="create_uid" colspan="4" />

      <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
      </form>
      </field>


     </record>

<!-- menuitems -->
    <menuitem id="main_openacademy_menu" name="Manage forum" />
        <menuitem id="openacademy_menu" name="Discussion Forum" parent="main_openacademy_menu" />
        <menuitem id="courses_menu" name="Questions sidemenu" parent="openacademy_menu" action="course_list_action" />


</data>
</openerp>
import datetime
import time
import openerp
from openerp.osv import osv, fields


class Course(osv.Model):
    _name = "openacademy.course"


    _columns = {
              'name' : fields.char(string="Question Title", size=256, required=True),
              'description' : fields.text(string="Question Description", required=True),
              'date_of_q_created': fields.datetime('Date of Created'),
              'category_question': fields.many2one('openacademy.categ', 'Question Category'),
              'create_uid': fields.many2one('res.users', 'Question Created By', readonly=True),
                 }

class Course(osv.Model):
    _name = "openacademy.course"
    _inherit = ['mail.thread', 'ir.needaction_mixin']


class question_categ(osv.osv):
    _name='openacademy.categ'
    _description='category of Question'
    _columns={
       'name':fields.char('Create a Category type',size=100)
    }
question_categ()
但我得到以下错误

'You may need to add a dependency on the parent class\' module.' % (name, parent_name))
TypeError: The model "openacademy.course" specifies an unexisting parent class "mail.thread" You may need to add a dependency on the parent class' module.

帮我摆脱这个..:-(

只需将此标记添加到表单视图的所有字段后,
…底部内容…
我希望这能对你有所帮助。更多细节

在xml中试试这个

   <div class="oe_chatter">
       <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
       <field name="message_ids" widget="mail_thread"/>
   </div>