39 lines
749 B
Python
Executable File
39 lines
749 B
Python
Executable File
# -*- coding: utf-8 -*-
|
|
import odoorpc
|
|
|
|
host = 'localhost'
|
|
port = 8080
|
|
db = 'tz-austria_1'
|
|
user = 'tz-admin'
|
|
pw = 'x'
|
|
|
|
odoo = odoorpc.ODOO(host, port=port)
|
|
odoo.login(db, user, pw)
|
|
|
|
values = {
|
|
"default_code": "02",
|
|
"name": "Produktname",
|
|
"length": 45.01,
|
|
"width": 13.45,
|
|
"thickness": 33.44,
|
|
"height": 88.37,
|
|
"surface": "m",
|
|
"weight": 80.45,
|
|
"active": True,
|
|
"is_internal": True,
|
|
"xcat_id": "Kategorie 1",
|
|
"notes": "notes",
|
|
"material_type_id": "Holz",
|
|
"categ_id": "all",
|
|
"intrastat_id": "Code",
|
|
"sale_ok": True,
|
|
"assembly_line_ids": ["12345", "12346"],
|
|
"list_price": 50.00
|
|
}
|
|
|
|
product_obj = odoo.env['product.template']
|
|
|
|
result = product_obj.create_product(values)
|
|
|
|
print(result)
|