Hi
I created a very simple module with the following model:
class Dossier(models.Model):
_name = 'juridique.dossier'
_inherit = ['mail.thread', 'mail.activity']
name = fields.Char(string='Nom')
message_ids = fields.One2many('mail.message', string='Messages')
activity_ids = fields.One2many('mail.activity', string='Activités')
Here is my
<?xml version="1.0"?>
<form string="Dossiers">
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
</sheet>
</form>
and my herited view
<?xml version="1.0"?>
<data>
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</xpath>
</data>
I get an error message in trying to install my module:
No inverse field None found for 'mail.activity'
I added the mail module in the __manifest__.py (depends section):
'depends': ['base', 'mail'],
Could you say to me what is wrong with my config?
thks a lot
Bruno
I found the solution, the inheritance in my model was wrong. here is the correct code:
class Dossier(models.Model):
_name = 'juridique.dossier'
_inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char(string='Nom')
message_ids = fields.One2many('mail.message', string='Messages')
activity_ids = fields.One2many('mail.activity', string='Activités')