Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

OpenERP 7.0 and NetRPC

Subscriure's

Get notified when there's activity on this post

This question has been flagged
7.06.0
1 Respondre
6117 Vistes
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
Descartar
Avatar
Assem
Autor Best Answer

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
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Human Resource Module - Employee Expense - change journal?
7.0
Avatar
Avatar
1
de jul. 18
4648
How to change number visual days in Gant Chart
7.0
Avatar
0
de set. 15
4553
We wanted to turn off customer portal, so we uncheck the box... But then
7.0
Avatar
Avatar
Avatar
Avatar
6
d’abr. 15
7908
Problems accessing openerp 7.0
7.0
Avatar
1
de març 15
6587
how to slove the internal server prblem
7.0
Avatar
Avatar
1
de març 15
364
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

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