跳至內容
選單
此問題已被標幟
3 回覆
18225 瀏覽次數

what is the module/modules name that contain odoo  chatter / Log , and where can i found its path or tables
and how could i add it to any odoo screen that do not have it already

 

頭像
捨棄
最佳答案

It's mail.thread model . just you need to inherit it in your model 

for example :

_inherit = ['mail.thread'] 

then adding in form section the following code after the sheet tag :

</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
頭像
捨棄
最佳答案

Hello,

In your class definition add these in .py,

class YourClass(models.Model):

    _name = "your.class"

    _description = "Your Class"

    _inherit = ['mail.thread', 'mail.activity.mixin', 'portal.mixin']

and in your manifest file make sure you have the correct dependency like,

'depends': ['base', 'mail',  'portal'],

and in your xml file after your sheet tag and this below div,

<record id="view_your_model_form" model="ir.ui.view">

            <field name="name">Your Model Form View</field>

            <field name="model">your.model</field>

            <field name="arch" type="xml">

                <form>

                    <header>

                    </header>

                    <sheet>

                                your field views....

                    </sheet>

                    <div class="oe_chatter">

                        <field name="message_follower_ids" widget="mail_followers"/>

                        <field name="message_ids" widget="mail_thread"/>

                    </div>

                </form>

            </field>

        </record>

In case if your doing it for any default tables of odoo, you should inherit and place the div in the view. Hope it work. Thanks 


頭像
捨棄
最佳答案

Hi, 

To add chatter in your form view, you have to inherit the mail.thread class,

class YourClass(models.Model):

    _name = 'your.class'

    _inherit = ['mail.thread']

    

Now, add chatter widget in your XML file,


        <record id="view_your_class_form" model="ir.ui.view">

            <field name="name">your.class.form</field>

            <field name="model">your.class</field>

            <field name="arch" type="xml">

                <form>

                    <sheet>                    

                    YOUR CODE

                    </sheet>

                </form>

                <div class="oe_chatter">

                    <field name="message_follower_ids" widget="mail_followers"/>

                    <field name="message_ids" widget="mail_thread"/>

                </div>

        </record>


Thanks

Muhammed Ali M - iWesabe

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
4月 24
1434
0
12月 19
2346
0
8月 24
874
0
1月 20
4934
2
3月 24
2287