El 30/03/15 a les 20:48, El Fran ha escrit:
Hi im new in Tryton Develop and i have a problem trying to fill some
fields using Proteus, I can not find a way to add the fields
"product_suppliers" to a product, my simple script for testing is like that:

With the latest proteus versions is just as simple as:

template = Template()
.....
product_supplier = template.product_suppliers.new()
# Enter the desired data on supplier.
template.save()

With the new operator, a new instance is returned and it's already linked to the parent object, in this case the template.

Saving the template will save also all their child records. In this case all the product_supplier records created.

It's all explained with examples in the proteus README [1]


[1] https://pypi.python.org/pypi/proteus/3.4.2

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Reply via email to