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

Hello odoo community

I have a question does anyone know the example that with the function it would create "Log an internal note"?. Lets say i click a button and Log an internal note will appear on the mail thread?

Example i tried

the message is created into database but in the mail thread i cant see it 

log_message.create(cr, uid, {

'body': '{0} Invoice Date: {1}'.format(log_message_date,name[0]),

'record_name': name[0],

'model':'pp.control',

'type':'notification',

#'website_published':1,

'res_id':record.id,

})

Thank you

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

Hi,

In many cases you can just use

self.message_post(body="Your text")

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Nvm guys solved it res_id was wrong :)

อวตาร
ละทิ้ง

Hi darius, Now I'm working with new module inherit to res.partner. Create simple workflow and add state field. Do you have example how to push internal note when user click the button? from openerp import models, fields, api, tools from openerp.tools.translate import _ class res_partner(models.Model): _inherit = 'res.partner' STATE_SELECTION = [ ('draft', 'Request Approval'), ('approved', 'Approved'), ] state = fields.Selection(STATE_SELECTION, 'Status', readonly=True, help="Request Approval Record " "Approved Record. ", select=True,default='draft') @api.multi def write(self, vals): if self.state == 'approved': vals.update({'state':'draft'}) # add internal note comment return super(res_partner, self).write(vals) @api.multi def button_approved(self, vans): # add internal note comment self.write({'state': 'approved'})

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
401
0
มี.ค. 25
622
0
มี.ค. 25
435
1
มี.ค. 25
1512
2
เม.ย. 24
1483