Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

OpenERP 7.0 and NetRPC

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
7.06.0
1 Responder
6092 Visualizações
Avatar
Assem

Hello,

I have a php application that connect to a 6.0 version of OpenERP using netrpc. I'm now trying to check if I can use the same code to connect my application to a 7.0 version. After analysing the code, I found that it's based on socket communications, so I prepared this code to make somme tests:

import socket
import cPickle
msg = ('common', 'login', 'db_name', 'admin', 'secret')
msg = cPickle.dumps([msg,None])
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print sock.connect_ex(('localhost', 8070))
sock.sendall('%8d%s%s' % (len(msg), True and "1" or "0", msg))
#buf=''
#print sock.recv(8 - len(buf))
#print "put"


def read(socket, size):
    buf=''
    while len(buf) < size:
        print "innn"
        try:
            chunk = socket.recv(size - len(buf))
            print "cunk ", chunk
            if chunk == '':
                raise RuntimeError, "socket connection broken"
            buf += chunk
        except Exception, e:
            print e
            
    return buf

size = int(read(sock, 8))
buf = read(sock, 1)
exception = buf != '0' and buf or False
res = cPickle.loads(read(sock, size))

if isinstance(res[0],Exception):
    if exception:
        raise TinySocketError(ustr(res[0]), ustr(res[1]))
    raise res[0]
else:
    print "res ",res[0]

When I run this code whyle a 6.0 server is running, I got an answer. But with a 7.0 server running, I have a Timeout problem (and I see openerp.service.netrpc_server: starting NET-RPC service on 0.0.0.0:8070 in the log so the netrpc service must be running). So I digged a litte in the OpenERP net-rpc code, and I found that the netrpc server is runned via the netrcp_server.py. After that I discovered that the difference between 6.0 and 7.0 is that in the first one, the function TinySocketServerThread.run was called, but in the second, it wasn't, witch means (If I'm not wrong) that there was no client socket waiting for connection witch explain why I don't get an answer.

So, is there anything wrong with my analysis? Did someone tested to use net rpc with a 7.0 of openerp? Did I miss something to make the netrpc work properly?

Thanks,

Assem.

0
Avatar
Cancelar
Avatar
Assem
Autor Melhor resposta

Well, 

After more checking I found this: in the 6.0 version, the netrpc and other service are runned by calling

netsvc.Server.startAll()

In openerp-server.py. In 7.0 version, this function is not called nowere, so I added :

netrpc_server.Server.startAll()

In the __init__.py under the service folder in the end of the start_services function : after that, the thread was lunched and I can see that the server did receive the socket call. But I found another problem: in TinySocketClientThread.run function, this line 

ts = openerp.server.netrpc_socket.mysocket(self.sock)

must be replaced by this one

ts = openerp.service.netrpc_socket.mysocket(self.sock)

After that, it worked fine. 

0
Avatar
Cancelar
Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
Human Resource Module - Employee Expense - change journal?
7.0
Avatar
Avatar
1
jul. 18
4609
How to change number visual days in Gant Chart
7.0
Avatar
0
set. 15
4504
We wanted to turn off customer portal, so we uncheck the box... But then
7.0
Avatar
Avatar
Avatar
Avatar
6
abr. 15
7879
Problems accessing openerp 7.0
7.0
Avatar
1
mar. 15
6571
how to slove the internal server prblem
7.0
Avatar
Avatar
1
mar. 15
364
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now