Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4403 Vues

Hi,

I'm working on connecting Magento with Odoo.  I run this call:

$records = $models->execute_kw($db, $uid, $pass, 'product.product', 'read', array(array(2))
                        , array('fields' => array(
                        'id',
                        'active',
                        'categ_id',
                        'display_name',
                        'description',
                        'image',
                        '__last_update',
                        'list_price',
                        'qty_available',
                        'taxes_id',
                        'write_date',
                        'promotion_note',
                        'publish_website'
                    ),
                   
                        )
                );

But how does the language parameter fit in? For the display_name and description I want the nl_BE translation. I was thinking of fitting

array("lang"=>"nl_BE") 

in as argument but I get a

TypeError: execute_kw() takes at most 6 arguments (7 given)

error... .  Anyone who can give me his 2 cents?

Avatar
Ignorer
Auteur Meilleure réponse

I finally found the solution,

$records = $models->execute_kw($db, $uid, $pass, 'product.product', 'read', array(array(2))
                        , array('fields' => array(
                        'id',
                        'active',
                        'categ_id',
                        'display_name',
                        'description',
                        'image',
                        '__last_update',
                        'list_price',
                        'qty_available',
                        'taxes_id',
                        'write_date',
                        'promotion_note',
                        'publish_website'
                    ),  "context" => array("lang" => "nl_BE")
                        )
                );

Hope this helps somebody

Avatar
Ignorer
Publications associées Réponses Vues Activité
0
mai 18
2743
1
sept. 20
7126
0
sept. 20
2001
1
avr. 24
1380
0
janv. 23
5640