Skip to Content
Menu
This question has been flagged
4 Replies
3064 Views
Python code:
class chatter(models.Model):
_name = 'mail.chatter'
_inherit = ['stock.scrap','mail.thread','mail.activity.mixin','mail.alias.mixin']
_description = 'chatter for scrap form'
XML code:
<record id="view_chatter_inherited" model="ir.ui.view">
<field name="name">Chatter</field>
<field name="model">mail.chatter</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</xpath>
</field>
</record>


Avatar
Discard
Author Best Answer

i edit model name to stock.scrap just and it works like a charm

class chatter(models.Model):

_name = 'stock.scrap'

_inherit = ['stock.scrap','mail.thread','mail.activity.mixin']

Avatar
Discard
Best Answer

Hi,

Remove the name given for the model, 

class chatter(models.Model):
_inherit = ['stock.scrap', 'mail.thread', 'mail.activity.mixin', 'mail.alias.mixin']
_description = 'chatter for scrap form'

Then in the XML file, give model as stock.scrap instead of mail.chatter.


<field name="model">stock.scrap</field>

Thanks

Avatar
Discard
Author

it gives me this error:

Field `message_follower_ids` does not exist

Error context:

View `Chatter`

[view_id: 1654, xml_id: custom_inv.view_chatter_inherited, model: stock.scrap, parent_id: 794]

None" while parsing /home/instructor/DAL _Agriculture/custom_inv/view/custom_inv_view.xml:4, near

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

<field name="name">Chatter</field>

<field name="model">stock.scrap</field>

<field name="inherit_id" ref="stock.stock_scrap_form_view"/>

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

<xpath expr="//form/sheet" position="after">

<div class="oe_chatter">

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

<field name="activity_ids" widget="mail_activity"/>

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

</div>

</xpath>

</field>

</record>

Related Posts Replies Views Activity
0
Oct 20
2518
2
Feb 22
6909
0
Aug 20
2836
2
Jan 20
3057
1
May 24
1013