Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

How to create product.product (variant) using RPC

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
webservicesrpcproduct.productv9.0
6 Răspunsuri
13793 Vizualizări
Imagine profil
xiaolong97427

Gi,

I need to create a Blue Color T-shirt using webservice (RPC)

I can create the product,_template(T-shirt), the product_attribute_line (Color) the product_attribute_value (Blue).

But I can't create the Blue-color-TShirt. I can't update the field  product_attribute_line.value_ids. I've tried to set it during the creation of a product_attribute_line record or after using a write method. Both didn't work. 

What is the correct way to create the product variant using RPC in Odoo v9 ?

0
Imagine profil
Abandonează
Imagine profil
Prakash
Cel mai bun răspuns

i updated the  product.attribute.line  [in php ripcode[ this way:

$existing_prodid = 59;
$existing_attribute_id = 2;
$existing_value_id = 4; 
$product_attribute_line = $models->execute($db, $uid, $password,
'product.attribute.line','create',
array('product_tmpl_id' => $existing_prodid,
'attribute_id'=>$existing_attribute_id,
'value_ids'=>array(array(6,0,array($existing_value_id)))))


In  python [using  xmlrpclib ]:


attibute_line = models.execute_kw(dbname, uid, password,

'product.attribute.line', 'create',[{

'product_tmpl_id':59,'attribute_id':2,'value_ids':[(6,0,[4])]}] )

 hope this may help you.

0
Imagine profil
Abandonează
xiaolong97427
Autor

Thank you very much Sharma. Indeed it helps. But I can't figure out what is the structure of value_ids ? How did you find it ? Or where shall I search to find the answer. Cause same problem may happened again for other objects that I would lilke to create

xiaolong97427
Autor

To be more accurate on my comment, I don't understand the constant: 6 and 0 in the value_ids. Also, please note that I was able to create my product variant thanks to your : 6,0,array($existing_value_id). So I will marked the question as answered. But I will really appreciate if you can guide on how to not get stuck in this situation. Shall I start by looking at the python method triggered by the call of /web/dataset/call_kw ?

Prakash

i have used (6,0,[ids]),it's the syntax of creating many2many try this link http://stackoverflow.com/questions/31853402/filling-many2many-field-odoo-8 and https://www.odoo.com/documentation/8.0/reference/orm.html

Prakash

here is my explanation http://stackoverflow.com/questions/36643092/create-a-record-into-many2many-table-using-web-service-api-in-odoo-8/36709180#36709180

Imagine profil
Sergio Cloud
Cel mai bun răspuns

Hi, I'm creating attribute lines with the following params: 

{ product_tmpl_id: 75, attribute_id: 13, value_ids: [(6,0,[199])] }

The attribute line has been created but the value_ids field is empty:

{ create_uid: [ 1, 'Administrator' ],    create_date: '2017-03-22 12:21:23',    __last_update: '2017-03-22 12:22:54',    value_ids: [],    write_uid: [ 1, 'Administrator' ],    product_tmpl_id: [ 75, 'todojunto' ],    attribute_id: [ 13, 'Talla' ],    write_date: '2017-03-22 12:22:54',    display_name: 'Talla',    id: 84 }

I don't know what I'm doing wrong... Any solution?


SOLVED!

The right structure is:

value_ids: [[6, 0,[191,201]]]
0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Has anyone tried to use AWS API Gateway to convert Odoo RPC API to modern style Rest API?
webservices rpc API
Imagine profil
0
iul. 20
4362
compute_taxes with XML RPC
accounting api webservices rpc
Imagine profil
Imagine profil
2
mai 24
4846
Create Products and Variants via RPC
variant rpc product.product product.template
Imagine profil
Imagine profil
2
ian. 19
4191
RPC Product Template -> Product Variant Creation
product xmlrpc rpc product.product product.template
Imagine profil
0
sept. 17
5294
Link to find detail of Odoo webservice Rezolvat
api webservices apiclient rpcjson v9.0
Imagine profil
Imagine profil
1
apr. 16
7840
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now