Odoo Help

7
4
Serpent Consulting Services Pvt. Ltd.
On 10/20/15, 6:09 AM

Hello Jignesh,

At the end of the method add following code to add reference of product template in "product.supplierinfo".

destination_sock.execute(destination_db, 1, destination_password, 'product.supplierinfo', 'write', seller_list, {'product_tmpl_id': product['product_tmpl_id']})

Hope this will help you.

-----------------------------------------------------------------------------------------------------------------------------------------

The type of field values to pass in "vals" for relationship fields is specific:

For a one2many field, a lits of tuples is expected.

Here is the list of tuple that are accepted, with the corresponding semantics:

  • (0, 0, { values }) link to a new record that needs to be created with the given values dictionary

  • (1, ID, { values }) update the linked record with id = ID (write *values* on it)

  • (2, ID) remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)

Example:

[(0, 0, {'field_name':field_value_record1, ...}), (0, 0, {'field_name':field_value_record2, ...})]

----------------------------------------------------------------------------------------------------------------------------

Edit:

You are reading 'name' field only from product.supplierinfo table. You should either pass list of fields in read method or can pass blank "[]" which will read value of those particular fields or all the fields (in the case of blank list).

Like this:

source_user1 = source_sock.execute(source_db, source_userId, source_password, 'product.supplierinfo', 'read', seller, [])    

Hello SerpentTeam, I have update code and also update seller vals, but i am still facing error. updated vals :- seller_vals = { 'name' : source_user1['name'] or False, 'delay' : source_user1['delay'] or False, 'min_qty' : source_user1['min_qty'] or False, 'company_id' : company_id or False, } Error Log :- Traceback (most recent call last): File "product_migration.py", line 143, in 'delay' : source_user1['delay'] or False, KeyError: 'delay' delay field already in the "product.supplierinfo".

Jignesh Mehta
on 10/20/15, 6:34 AM

You are only reading 'name' field from product.supplierinfo table as you are passing only ['name'] in the read method during rpc call. See my updated answer please.

Serpent Consulting Services Pvt. Ltd., Serpent Consulting Services Pvt. Ltd.
on 10/20/15, 8:00 AM

Thank u so much @Serpent Consulting Services Pvt. Ltd.

Jignesh Mehta
on 10/20/15, 9:08 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 10/20/15, 5:47 AM
Seen: 3500 times
Last updated: 4/25/16, 2:55 AM