Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
697 Prikazi

i am using the following code in my .xml file:

<record id="view_hospital_patient_form" model="ir.ui.view">
<field name="name">hospital.patient.form</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<form string="Patients">
<sheet>
<group>
<field name="name"/>
<field name="date_of_birth" optional="show"/>
<field name="gender" optional="hide"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>

and also inheriting:

class HospitalPatient(models.Model):
_name = "hospital.patient"
​ _inherit = ['mail.thread']

but instead of Send Message and Log Note being displayed.


The following table is being displayed:
Related Document Model Name                         Related Document ID                Related Partner
Add a line


Date   ​​Subject ​Author ​Related Document Model  ​Related Document ID
Add a line

Why is it? How do i solve this?

Avatar
Opusti
Best Answer

Hello Arslan Jabbar,


I have reviewed your code,


This kind of view is visible in Odoo-18.


In Odoo-18, Instead of adding

//Code in Comment//

Just add tag "<chatter/>", than your issue will get solved.


Hope this Helps,

If you need any help in customization feel free to contact us.


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

Avatar
Opusti

"<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>"

Best Answer

Hi,

in Odoo 18, using <div class="oe_chatter"> is outdated, simply use <chatter/>


Please refer to the code below:

Python:

from odoo import fields, models

class HospitalPatient(models.Model):
_name = "hospital.patient"
_inherit = ['mail.thread', 'mail.activity.mixin']

XML:

<record id="view_hospital_patient_form" model="ir.ui.view">
<field name="name">hospital.patient.form</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<form string="Patients">
<sheet>
<group>
<field name="name"/>
<field name="date_of_birth" optional="show"/>
<field name="gender" optional="hide"/>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>

Hope it helps.

Avatar
Opusti