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
    • Intelligence artificielle
    • 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
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • 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
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & 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
    Parcourir toutes les 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
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    • Referral Program
    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
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

odoo 8: Perl XMLRPC to lookup product pricelist help

S'inscrire

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

Cette question a été signalée
xmlrpcpricelist
1 Répondre
5192 Vues
Avatar
Steve Switzer

I tried several different ways and calls and I finally have things typed correctly, but after several attempts I can't get past this last error. I've tried calling product.product name_search and I get back ID 1 for the product I want a price for. However, in the product.pricelist model, I've called price_get and price_get_multi and both fail the same way:

Fault returned from XML RPC Server, fault code 2: No value found for product.product('1',).product_tmpl_id

My goal is to lookup the current price of a product for a particular customer, given the current price list.
Here's the code that I'm using with some of my other attempts commented out:

sub get_labor_price {
  my ($pricelistid) = @_;
  my ($uid, $server, $index);
  $server = Frontier::Client->new('url' => $Hours2odoo::Config{O_SERVERURL}.'/xmlrpc/common');
  $uid = $server->call('login',$Hours2odoo::Config{O_DBNAME},$Hours2odoo::Config{O_USERNAME},$Hours2odoo::Config{O_PASSWORD});
  print "UID: $uid\n" if ${DEBUG}>=10;

  $server = Frontier::Client->new('url' => $Hours2odoo::Config{O_SERVERURL}.'/xmlrpc/2/object');
 
  my $query = [
                ['name', '=', 'LAB-Hours'],
            ];
=begin     
  my $productprice = $server->call('execute',
            $Hours2odoo::Config{O_DBNAME}, $uid, $Hours2odoo::Config{O_PASSWORD},
            'product.product', 'search_read', $query
  );
  #print Dumper($productprice);
=cut
 
  print 'Pricelist ID: '.$pricelistid."\n";
  my $productid=$Hours2odoo::Config{O_PARTID};
  #self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product, qty or 1.0, partner_id, {'uom': 'Hours', 'date': date_order, })            
  my $productprice = $server->call('execute',
            $Hours2odoo::Config{O_DBNAME}, $uid, $Hours2odoo::Config{O_PASSWORD},
#            'product.pricelist', 'price_get', $server->int($pricelistid), $server->string($productid), $server->string(6)
            'product.pricelist', 'price_get', $server->int($pricelistid), $server->string($productid), $server->int(6)
            
#            'product.pricelist', 'price_get_multi', $server->string($pricelistid),
#            [
#                [$productid, 1, 6],
#            ],
 
  );
  print "PRICE: $productprice\n";
}

This is generating an XML request like this:

<?xml version="1.0"?>
<methodCall>
<methodName>execute</methodName>
<params>
<param><value><string>SBS</string></value></param>
<param><value><i4>1</i4></value></param>
<param><value><string>xxxxxxxxx</string></value></param>
<param><value><string>product.pricelist</string></value></param>
<param><value><string>price_get</string></value></param>
<param><value><int>5</int></value>
</param>
<param><value><string>1</string></value>
</param>
<param><value><string>6</string></value>
</param>
</params>
</methodCall>

The response is this:

<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
<name>faultCode</name>
<value><int>2</int></value>
</member>
<member>
<name>faultString</name>
<value><string>No value found for product.product('1',).product_tmpl_id</string></value>
</member>
</struct></value>
</fault>
</methodResponse>

I would appreciate any insight into why this is not workout the way I expected. Thank you!

Steve

0
Avatar
Ignorer
Avatar
IWEINS
Meilleure réponse

Hi Steve,

I have the same problem, have you found a solution?

Thax

Nicolas


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é
Create product pricelist via XMLRPC - Odoo 9
c# xmlrpc pricelist
Avatar
0
déc. 16
5806
'Discount' Pricelist not show up in Product detail page Résolu
pricelist
Avatar
Avatar
2
mars 26
3344
xmlrpc Error when attempting to connect to my local instance Résolu
xmlrpc
Avatar
Avatar
Avatar
3
juil. 25
6531
Price list update
pricelist
Avatar
Avatar
1
juin 25
3205
Pricelist Changes Unexpectedly During Contact Duplication in Multi-Company Setup
pricelist
Avatar
0
janv. 25
3143
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
  • Devenir 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 Svenska ภาษาไทย 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