Answer the question
In order to leave comments, you need to log in
How to initialize Environment in Odoo12?
I'm trying to run the code (below), but do not work out api how to connect environments to work them out?
import odoo
from odoo import models, fields, api
import logging
import skpy
import threading
_logger = logging.getLogger(__name__)
class skype_bot(models.Model):
_name = 'my.skype'
_inherit = ['mail.thread',]
_description = 'My Skype'
_logger.warning('$$$$'* 5 + "Init" + 5 * '$$$$')
message = fields.Char()
@api.multi
@api.onchange('message')
def send_message(self):
_logger.info('................' * 10)
_logger.warning(self)
_logger.info('................' * 10)
self.env['mail.message'].create({'message_type': 'notification',
'subtype': self.env.ref('mail.mt_comment').id, # subject type
'body': skype_bot.message,
'subject': 'Message subject',
'partner_ids': [(4, partner_id), ],
# partner to whom you send notification
})
class MySkype(skpy.SkypeEventLoop):
_logger.info('Init Skype Class')
def onEvent(self, event):
_logger.info('================' * 10)
_logger.warning(skype_bot)
_logger.warning(skype_bot.send_message)
_logger.info('================' * 10)
skype_bot.message = "test 123"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question