Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
6302 Zobrazení

I've been struggeling around with a magento-odoo-synchronization (base module by webkul) and got most of it working except tax sync. From Magento to Odoo it's done on Magento site in php...

The fields in Odoo are named taxes_id and supplier_taxes_id but when stating something like this in the product array:

For mapping have this code:

if($product->getTaxClassId() == 1){
$taxclass1 = 12;
$taxclass2 = 14;
}
if($product->getTaxClassId() == 2){
$taxclass1 = 13;
$taxclass2 = 15;
}

in the array this:

'taxes_id'=>new xmlrpcval($taxclass1, "string"),
'supplier_taxes_id'=>new xmlrpcval($taxclass2, "string"),

but nothing happens in Odoo...

Any ideas in this?

Avatar
Zrušit
Autor

Thank you Serpent Consulting, but how do I implement that in the xmlrpcval?

Autor

so, would this be correct then? $tax1 = array(new xmlrpcval( array( new xmlrpcval(6, "int"),// 6 : id link new xmlrpcval(0, "int"), new xmlrpcval(array(new xmlrpcval($taxclass1, "int")),"array") ),"array" ) ); in the following array this: 'taxes_id'=>new xmlrpcval($tax1, "string"), Didn't get it working so far... any help appreciated

Autor

Answer can be found here: http://stackoverflow.com/questions/18851680/how-to-send-many2many-into-openerp-through-xmlrpc/21013324#21013324

Nejlepší odpověď

Hello,

To update the x2many(one2many/many2many) fields, you will have to follow the 3-element tuple syntax.

It is: [(6,0,[IDs])] for your case.

Thanks.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
kvě 16
7913
3
bře 15
7015
1
kvě 17
3608
3
srp 22
41277
1
pro 19
3922