• Courses
    Introduction LearnPress – LMS plugin

    Introduction LearnPress – LMS plugin

    Free
    อ่านเพิ่มเติม
  • Features
    • Membership
    • Portfolio
    • About Us
    • FAQs
    • Sidebar Shop
    • 404 Page
  • Events
  • Gallery
  • Blog
  • Contact
  • Shop
    มีคำถามเกี่ยวกับ odoo ?
    (063) 5525296
    info@odoothaidev.com
    Login
    Odoothaidev - We are Odoo professional in ThailandOdoothaidev - We are Odoo professional in Thailand
    • Courses
      Introduction LearnPress – LMS plugin

      Introduction LearnPress – LMS plugin

      Free
      อ่านเพิ่มเติม
    • Features
      • Membership
      • Portfolio
      • About Us
      • FAQs
      • Sidebar Shop
      • 404 Page
    • Events
    • Gallery
    • Blog
    • Contact
    • Shop

      Form View

      • บ้าน
      • บล็อก
      • Form View
      • How to Add Chatter to Form View in Odoo v12

      How to Add Chatter to Form View in Odoo v12

      • โพสโดย admin
      • หมวดหมู่ Form View
      • วันที่ กรกฎาคม 20, 2019
      • ความคิดเห็น 0 ความคิดเห็น

      How to Add Chatter to Form View in Odoo v12

      In this blog let us discuss on how to add a chatter in the form view. For those, who are unaware of the chatter, see the below image,

      This is the chatter and we have already seen this in many forms. So let us look at how we can add the same in our student form that we already have created in the previous blog: How to Create Module in Odoo 12 – Defining the Views

      So we already have  a form view,

      <record id=”student_free_view” model=”ir.ui.view”>
      <field name=”name”>Student Form</field>
      <field name=”model”>student.student</field>
      <field name=”arch” type=”xml”>
      <form string=”Student”>
      <sheet>
      <field name=”photo” widget=”image” class=”oe_left oe_avatar” />
      <div class=”oe_title”>
      <h3>
      <field name=”name”/>
      </h3>
      </div>
      <group>
      <group>
      <field name=”age”/>
      <field name=”gender”/>
      </group>
      <group>
      <field name=”student_dob”/>
      <field name=”student_blood_group”/>
      <field name=”nationality”/>
      </group>
      </group>
      </sheet>
      </form>
      </field>
      </record>

      This is the current form we have, where there is no chatter

      So now we can have a look at how to add the chatter to this, for this what we have to do is that first of all in the python file, in the model student.student (the model we are using, one can do accordingly to their model),

      Code:

      class StudentStudent(models.Model):
      _name = ‘student.student’
      _inherit = ‘mail.thread’
      _description = ‘Student Record’

      Inherit the model mail.thread to student.student as shown in the above image. This is only what we have to do in the python file, the rest of the coding is the views, so let us look at what changes has to be done in the views.

      A four line of XML code has to be added to the view, as shown above, image.

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

      Once we add this code in the form view and upgrade the module, we can see that the chatter got added in the form view. As we have made the changes in the python file, don’t forget to restart the service before upgrading.

      This is the form we see now, one can see that the chatter got added in the bottom of the screen. Using the option, one can message to the followers or to the channels as well as in the Log Note tab. We can log some notes to see later.

      Logging Note:

      Sending Message:

      All the logs and messages will get recorded in the bottom view.

      So this is how one can add the chatter to the form.

      Before winding up this, let us see what is the track_visibilty in odoo. Have you heard about it?

      Track Visibility

      Track visibility is used to track the changes made to the fields, as our system is a multi-user system and the different person can access the same record. There might be cases where we have to keep track of who changed the field values. In these cases, we can use track_visibilty.

      So let us look at how can we do it in our model.

      In the above image, you can see that I have added track_visibility for the fields name and age.

      Just upgrade the module and to see the changes, just open the student record and change the value of the age, I have opened my record and changed the age to 25 from 24.

      Once the age is changed, we can see that the change got recorded. If you check the above image, you can see the old value and new value, so that we will get the idea about who changed the value and history of that field values.

      In the above example, I have added the track_visibility always for the field name, but it is not getting updated in the logger, will check the case and update it. So let us see the difference between the track visibility onchange and always.

      Track Visibility: onchange (if it should be displayed in the notification only if the field changed) or always (if the value should always be displayed in change notifications even if this particular field did not change – useful to make notification more explanatory by always adding the name field, for example).

      So this is all about how to add the chatter and the track_visibility.

       

      Thank you and Credit : https://www.cybrosys.com/blog/how-to-add-chatter-to-form-view-in-odoo-v12

      แท็ก:Form View

      • แบ่งปัน:
      อวตารของผู้แต่ง
      admin

      โพสต์ก่อนหน้า

      How to Create Module in Odoo 12 - Search View and Filters
      กรกฎาคม 20, 2019

      โพสต์ถัดไป

      How to Add Custom Fields to Existing Views in Odoo v12
      กรกฎาคม 20, 2019

      ทิ้งคำตอบไว้ ยกเลิกการตอบ

      อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น

      Search

      หมวดหมู่

      • Accounting
      • Adobe XD
      • API
      • Blog
      • Business
      • Buttons
      • CRM
      • Custom Fields
      • Design / Branding
      • Django
      • Ecommerce
      • ERP
      • Express
      • Form View
      • Frontend
      • Grant Chart
      • Header
      • iReport
      • Jasper Server & Server
      • Jaspersoft Studio
      • Java
      • JSON-RPC
      • Linux
      • MRP
      • NodeJS
      • Odoo 10
      • Odoo 12 Module
      • Odoo 13
      • Odoo 8
      • Odoo 9
      • Odoo API
      • Odoo Developer
      • Odoo Ebook
      • Odoo ERP
      • Odoo Event
      • Odoo Report
      • Open-office
      • OpenERP 7.0
      • PhantomJS
      • Postgres SQL
      • Programming Language
      • Project Management
      • Python
      • Qweb
      • Reporting ระบบรายงาน
      • RML Report
      • Search View and Filters
      • Statusbar
      • Ubuntu
      • Uncategorized
      • Voip & Call Center
      • Warehouse Management
      • WMS
      • Woocommerce
      • XML-RPC
      • การ Implement
      • การเก็บข้อมูล Pre-Requirement
      • การเตรียมตัวเพื่อใช้งาน erp
      • ธีมเว็บไซต์ Odoo
      • ธุรกิจบริการ
      • ธุรกิจประเภทจัดอบรมสัมมนา
      • ธุรกิจสิ่งพิมพ์
      • ประเภทธุรกิจที่เหมาะกับ Odoo
      • ระบบบัญชี
      • ระบบเคลม

      หลักสูตรล่าสุด

      Introduction LearnPress – LMS plugin

      Introduction LearnPress – LMS plugin

      Free
      From Zero to Hero with Nodejs

      From Zero to Hero with Nodejs

      Free
      Learn Python – Interactive Python

      Learn Python – Interactive Python

      $69.00
      (00) 123 456 789
      hello@eduma.com
      Facebook
      Twitter
      Google-plus
      Pinterest

      Education WordPress Theme by ThimPress. Powered by WordPress.

      • Privacy
      • Terms
      • Sitemap
      • Purchase

      เข้าสู่ระบบด้วยบัญชีไซต์ของคุณ

      ลืมรหัสผ่าน?