Odoo Help


odoo 8: Perl XMLRPC to lookup product pricelist help

Steve Switzer
on 1/16/15, 10:49 PM 1,202 views

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'],
  my $productprice = $server->call('execute',
            $Hours2odoo::Config{O_DBNAME}, $uid, $Hours2odoo::Config{O_PASSWORD},
            'product.product', 'search_read', $query
  #print Dumper($productprice);
  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"?>

The response is this:

<?xml version='1.0'?>
<value><string>No value found for product.product('1',).product_tmpl_id</string></value>

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


On 5/6/15, 12:29 PM

Hi Steve,

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



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/16/15, 10:49 PM
Seen: 1202 times
Last updated: 5/6/15, 12:29 PM