如何在自己的模块创建记录后在消息模块产生动态?
-
销售模块创建销售订单的时候,会在消息模块下产生动态。我按照下面的方式尝试了也不行,可以在页面底部产生动态,在消息模块就不行。
<br /><br />inherit<br /><br />_inherit = ['mail.thread', 'ir.needaction_mixin']<br />for field you want to generate message add track_visibility='always'<br /><br />_columns = {<br /> 'tot_usr_fee': fields.float('Total User Fees', track_visibility='always'),<br />}<br /><br />Then in view file add<br /><br /> <record id="mt_shipment_statement_invoice" model="mail.message.subtype"><br /> <field name="name">Custom Statement Invoice Generated</field><br /> <field name="res_model">shipment.statements</field><br /> <field name="default" eval="False"/><br /> <field name="description">Invoice Generated</field><br /> </record><br /> <record id="mt_shipment_statement_confirmed" model="mail.message.subtype"><br /> <field name="name">Custom Statement Confirmed</field><br /> <field name="res_model">shipment.statements</field><br /> <field name="default" eval="False"/><br /> <field name="description">Invoice confirmed</field><br /> </record><br />