How to post a message in chatter during create method in Odoo?
Date : March 29 2020, 07:55 AM
seems to work fine I was writing create method for my own custom module. , Openerp 7 Create Method def create(self, cr, uid, vals, context=None):
new_id = super(CRM_Lead, self).create(cr, uid, vals, context=context)
return new_id
@api.model
def create(self, vals):
rec = super(ClassName, self).create(vals)
# ...
return rec
track_visibility='always'
track_visibility='onchange'
|
Odoo 9 How to edit chatter opportunity notes view
Date : March 29 2020, 07:55 AM
help you fix your problem Ok guys, as always, I must to do everything by myself, so I will post what I found maybe I will help someone: You need to go to static > src > xml > thread.xml there you must to search in website source what is this thing you want to edit: <t t-if="message.model == 'crm.lead' && (message.is_note)">
Type: <t t-esc="message.subtype_id[1]"/>
</t>
<div t-att-class="'o_thread_message_core' + (message.is_note ? ' o_mail_note' : '')">
<p t-if="message.display_author" class="o_mail_info">
<t t-if="message.is_note">
Note by
</t>
<strong t-if="message.mailto">
<a class="o_mail_mailto" t-attf-href="mailto:#{message.mailto}?subject=Re: #{message.subject}">
<t t-esc="message.mailto"/>
</a>
</strong>
<strong t-if="!message.mailto && message.author_id[0]"
data-oe-model="res.partner" t-att-data-oe-id="message.author_redirect ? message.author_id[0] : ''"
t-attf-class="#{message.author_redirect ? 'o_mail_redirect' : ''}">
<t t-esc="message.displayed_author"/>
</strong>
<strong t-if="!message.mailto && !message.author_id[0]">
<t t-esc="message.displayed_author"/>
</strong>
<small t-att-title="message.date">
- <t t-esc="message.hour"/>
</small>
<!-- VVV HERE I ADDED THIS VVV-->
<t t-if="message.model == 'crm.lead' && (message.is_note)">
Type: <t t-esc="message.subtype_id[1]"/>
</t>
<!-- ^^^ HERE I ADDED THIS ^^^-->
<t t-if="message.model && (message.model != 'mail.channel') && options.display_document_link">
on <a t-att-href="message.url" t-att-data-oe-model="message.model" t-att-data-oe-id="message.res_id"><t t-esc="message.record_name"/></a>
</t>
<t t-if="message.origin_id && (message.origin_id !== options.channel_id)">
(from <a t-att-data-oe-id="message.origin_id" href="#">#<t t-esc="message.origin_name"/></a>)
</t>
<span>
<i t-if="options.display_stars && !message.is_system_notification"
t-att-class="'fa fa-lg o_thread_message_star ' + (message.is_starred ? 'fa-star' : 'fa-star-o')"
t-att-data-message-id="message.id" title="Mark as Todo"/>
<i t-if="message.record_name && message.model != 'mail.channel' && options.display_reply_icon"
class="fa fa-reply o_thread_message_reply"
t-att-data-message-id="message.id" title="Reply"/>
<i t-if="message.is_needaction && options.display_needactions"
class="fa fa-check o_thread_message_needaction"
t-att-data-message-id="message.id" title="Mark as Read"/>
</span>
</p>
|
How to use Chatter in Odoo?
Date : March 29 2020, 07:55 AM
help you fix your problem In order to log changes of specific fields you need so set the track_visibility attribute on each field you want to track: class OpStudent(models.Model):
_name = 'op.student'
_inherits = {
'res.partner': 'partner_id',
}
_inherit = [
'mail.thread',
'ir.needaction_mixin',
]
foo = fields.Char(track_visibility='always')
|
How to Override mail.chatter js of mail module in odoo 9?
Date : March 29 2020, 07:55 AM
wish helps you If you look at chatter.js, you will see that it only returns Chatter. And on the Chatter code you will see that the instance of the ChatterComposer that it holds is called composer: this.composer = new ChatterComposer(...)
return {
'Chatter': Chatter,
'ChatterComposer': ChatterComposer,
}
var MyCustomChatterComposer = form_common.AbstractField.extend({...})
var chatter = require('mail.Chatter');
chatter.open_composer = function (options) {
...
chatter.composer = new MyCustomChatterComposer();
...
}
|
odoo chatter doesn't appear in scrap form?
Date : March 29 2020, 07:55 AM
this will help You're extending the wrong way. The model which should implement the chatter, should be inheriting mail.thread and other mixins, if needed. class StockScrap(models.Model):
_name = 'stock.scrap'
_inherit = ['stock.scrap', 'mail.thread']
# and so on
|