def whatsapp_send(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): phone = move.mobile_to.encode('utf-8') message = move.message.encode('utf-8') wa = WhatsappEchoClient(phone, message) login = move.gateway.phone password = move.gateway.password password = base64.b64decode(bytes(password.encode('utf-8'))) wa.login(login, password) return self.pool.get('warning_box').info(cr, uid, title='Test send message', message="Ok")
def test_gateway(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): time_local = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) phone = move.test_to.encode('utf-8') message = move.test_message.encode('utf-8') + "\n\nTime: " + time_local wa = WhatsappEchoClient(phone, message) login = move.phone password = move.password password = base64.b64decode(bytes(password.encode('utf-8'))) wa.login(login, password) return self.pool.get('warning_box').info(cr, uid, title='Test send message', message="Ok")
def test_gateway(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): time_local = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) phone = move.test_to.encode('utf-8') message = move.test_message.encode( 'utf-8') + "\n\nTime: " + time_local wa = WhatsappEchoClient(phone, message) login = move.phone password = move.password password = base64.b64decode(bytes(password.encode('utf-8'))) wa.login(login, password) return self.pool.get('warning_box').info(cr, uid, title='Test send message', message="Ok")