Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
8 ตอบกลับ
32079 มุมมอง

I'm creating a Custom module, and i wish to add them the possibility to add messages, follow it, add attachments, just like at the bottom of the Customer form.

image description

How can i do that?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You need to inherit your module from "mail.thread" also. That makes adding it possible.

e.g. as here (model.py):

class sale_order(osv.osv):
    _name = "sale.order"
    _inherit = ['mail.thread', 'ir.needaction_mixin']

Then you need to add the Thread to your view (view.xml):

<record id="view_order_form" model="ir.ui.view">
    <field name="name">sale.order.form</field>
    <field name="model">sale.order</field>
    <field name="arch" type="xml">
        <form string="Sales Order" version="7.0">
        ...
        </form>
        <sheet>
        ...
        </sheet>
        <div class="oe_chatter">
            <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
            <field name="message_ids" widget="mail_thread"/>
        </div>
    </field>
</record>

That's all you need to do. :)

อวตาร
ละทิ้ง
ผู้เขียน

This did work! Thank you!

Thank you!!! I'ts Work!!!

Excellent works like a charm! Thanks

คำตอบที่ดีที่สุด
     <div class="oe_chatter">
            <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
            <field name="message_ids" widget="mail_thread"/>
        </div>

just add this line at the bottom of your code

อวตาร
ละทิ้ง
ผู้เขียน

yeah that didn't really work...it said invalid xml architecture.

try to add above snippet just before the closing </form> tag.

Hi, if i use this <field name="message_ids" widget="mail_thread"/>, how can i set what messages will be display on this view?

(if i want to display all partner related emails outgoing (in & outgouing) example...

คำตอบที่ดีที่สุด

I need to write a module. This module has the function of synchronizing the notes and displaying the view (message_ids) on both the opportunity and contact sides. I can't think of a solution, if possible please help!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

i have used this code all ok except the message convertation notification is not going to mail box of the follwer


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Good night,


Please, can you tell me if this is working on odoo 8 ?



อวตาร
ละทิ้ง

It works on Odoo 8 ?

Yes, works for Odoo 8 too.

คำตอบที่ดีที่สุด

Hi there, In Online Demo chatter is working at Human Resources, employee forms by default. But in my OpenERP v7 setup it doesn't. It does work on other forms but not in employees forms.

I think all I have to do is to enable oe_chatter in employee form. I dont know much on openERP, so I managed to enter developer mode and go to Database Structure - Models - hr.employee. I click on the "Edit formview", but I cannot find "mail_thread" to inherit it. I can only add the class code in the form.

I just need a simple solution on how to enable oe_chatter in employee form, because its working everywhere else in my OpenERP setup. I am strugling to find a solution for over 2 days now but with no luck.

Please help..

อวตาร
ละทิ้ง

If you chenge form view by module installation, you should override "view_employee_form" with this code:

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

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

<div class="oe_chatter">

<field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically track the events associated to tasks and issues of this project." groups="base.group_user"/>

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

</div>

</xpath>

</field>

คำตอบที่ดีที่สุด

Hi, 

how about if I regroup in one module all of the adding a group in the followers for example in purchase, sales..... 

For example when purchase goes Sent for Waiting approval, one group 1 is automatically added in the followers.

 this purchase goes to waiting approval for approved, one group 2 is automatically added in the followers.

How to do, I want to gather all of this case in one module?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just found it, excellent. That's what I needed :)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
4518
How to use oe_chatter class แก้ไขแล้ว
3
ก.ย. 24
16659
3
มี.ค. 25
36305
0
มิ.ย. 18
2878
2
มี.ค. 16
5784