Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

put a customer under a company using XML-RPC

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
customercompany
5424 Vues
Avatar
Muszik Adrián

I'm trying to import Both customers and companies into OpenERP from another database. I can import both customers and company, but i am unable to link them: this is the code i am trying to use:

     if data:
            for erprow in data:
                #mielöt updatelünk vagy létrehozunk csekoljuk le hogy alá tudjuk e rendelniegy cégnek
                cegargs = [('panda_id', '=', int(csvrow[1])),]
                cegids = sock.execute(dbname, uid, pwd, model, 'search', cegargs)
                cegfields = ['id', 'name', 'child_ids',]
                cegdata = sock.execute(dbname, uid, pwd, 'res.partner', 'read', cegids, cegfields)
                """if cegdata:
                    #childcustomer = str(erprow['id']) + '/' + str(cegdata[0]['id'])
                    child = cegdata[0]['child_ids']
                    if not child:
                        child = False
                    update = True
                    print cegdata[0]['child_ids']
                    if erprow['id'] in child:
                        update = False
                    else:
                        child.append(int(erprow['id']))
                    if update:
                        cegvalues = {}
                        cegvalues['child_ids'] = child
                        results = sock.execute(dbname, uid, pwd, 'res.partner', 'write', cegids, cegvalues)
                    print '-------', cegdata[0]['child_ids']"""
                parent_id = False
                if cegdata:
                    parent_id = [int(cegdata[0]['id']), cegdata[0]['name']]
                # a tömböknek (dictionary pythomban) nevük van....
                values = {}
                #string be convertálom különben mindig külömböző lesz
                """if str(erprow['active']) != str(csvrow[0]):
                    values['active'] = csvrow[0]"""
                # x_panda_id ki hagyva mert az alapján vana keresés...
                if erprow['zip'] != csvrow[11]:
                    values['zip'] = csvrow[11]
                #a country kicsit nezebb mivel Openerpnek van saját táblája országokrol és IDvel müködik.
                if erprow['country'] != country_tomb:   
                    values['country'] = country_id
                    values['country_id'] = country_id
                if erprow['name'] != nev:
                    values['name'] = nev
                if erprow['street'] != csvrow[13]:
                    values['street'] = csvrow[13]
                """if erprow['street2'] != csvrow[6]:
                    values['street2'] = csvrow[6]"""
                if erprow['city'] != csvrow[12]:
                    values['city'] = csvrow[12]
                """if erprow['comment'] != csvrow[8]:
                    values['comment'] = csvrow[8]"""
                if erprow['email'] != csvrow[9]:
                    values['email'] = csvrow[9]
                if erprow['fax'] != csvrow[8]:
                    values['fax'] = csvrow[8]
                if erprow['mobile'] != csvrow[10]:
                    values['mobile'] = csvrow[10]
                if erprow['function'] != csvrow[5]:
                    values['function'] = csvrow[5]
                if erprow['phone'] != telefon:
                    values['phone'] = telefon
                if erprow['parent_id'] != parent_id:
                    erprow['parent_id'] = parent_id
                if cegdata:
                    if erprow['company_id'] != int(cegdata[0]['id']):
                        values['company_id'] = cegdata[0]['id']
                if values: 
                    number += 1
                    results = sock.execute(dbname, uid, pwd, model, 'write', ids, values)
                    print loop, '. ', number , ". results frissités pandából...", parent_id
                else:
                    number += 1
                    print loop, '. ', number , ". sor létezik de nincs frisités.", parent_id


        else:
            #mielöt updatelünk vagy létrehozunk csekoljuk le hogy alá tudjuk e rendelniegy cégnek
            cegargs = [('panda_id', '=', int(csvrow[1])),]
            cegids = sock.execute(dbname, uid, pwd, model, 'search', cegargs)
            cegfields = ['id', 'name',]
            cegdata = sock.execute(dbname, uid, pwd, 'res.partner', 'read', cegids, cegfields)
            parent_id = False
            if cegdata:
                parent_id = [int(cegdata[0]['id']), cegdata[0]['name']]
            number += 1
            print loop, '. ', number, ".Nem létezik - Létrehozzás"
            partner_data = {'name':nev, 'active': True, 'panda_id': csvrow[0], 'zip' : csvrow[11], 'country_id': country_id, 'street': csvrow[13],  'city': csvrow[12], 'email': csvrow[9], 'fax': csvrow[8], 'mobile': csvrow[10], 'function': csvrow[5], 'phone': telefon, 'parent_id': parent_id,}
            partner_id = sock.execute(dbname, uid, pwd, model, 'create', partner_data)
    loop += 1
    print loop, local_number

it has a lot of print due to this script i run from command line and not openerp scheduler. Sadly i cant figure out how to link them as Company-> child.

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Could we also set the company for a customer in the point of sale?
customer company Point Of Sale
Avatar
0
déc. 15
3554
Company under Company
customer v7 company
Avatar
Avatar
1
mars 15
9451
list index out of range
import customer company
Avatar
Avatar
1
mars 15
12511
Can we attribe more than one company to a partner
partner customer company
Avatar
Avatar
1
mars 15
4653
Accessing the full Contact record from a Customer? Not just a popup? Résolu
customer contact company popup
Avatar
Avatar
Avatar
2
avr. 25
5655
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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