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

creation of custom demo data v17

Abonare

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

Această întrebare a fost marcată
product.productProductsV17.0
1 Răspunde
1839 Vizualizări
Imagine profil
James Rocket

I am trying to create some custom demo data for testing in Odoo v17 in xml

currently i am struggling with the creation of product.product while inheriting from product.template

this is the code that i currently have:

<record id="sales_test_1_product_template" model="product.template">
<field name="name">The better table</field>
<field name="detailed_type">product</field>
<field name="invoice_policy">delivery</field>
<field name="tracking">serial</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Solid wood table.</field>
<field name="standard_price">200</field>
<field name="list_price">500</field>
<field name="image_1920" type="base64" file="mrp/static/img/table.png"/>
</record>

<record id="sales_test_1_product_template_product1" model="product.product">
<field name="product_tmpl_id" ref="sales_test_1_product_template"/>
<field name="default_code">FURN_009</field>
<field name="standard_price">299</field>
<field name="list_price">520</field>
</record>

the error that i get when trying to run this is this:

psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "product_product_combination_unique"
DETAIL:  Key (product_tmpl_id, combination_indices)=(74, ) already exists.

i assume this is because the product.template creates a default product with the Key (74, ), and then when i try to create a product.product, i am trying to create a product with the same Key. I cant figure out how to change this "Key"


My goal is to get 3 pieces of the product to be "on hand", 3 different Serial Numbers, while being visible for a certain company

0
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

Hi,

Please refer to the code below:

For Product:


<record id="sales_test_1_product_template" model="product.template">

    <field name="name">The better table</field>

    <field name="detailed_type">product</field>

    <field name="invoice_policy">delivery</field>

    <field name="tracking">serial</field>

    <field name="categ_id" ref="product.product_category_5"/>

    <field name="uom_id" ref="uom.product_uom_unit"/>

    <field name="uom_po_id" ref="uom.product_uom_unit"/>

    <field name="description">Solid wood table.</field>

    <field name="standard_price">200</field>

    <field name="list_price">500</field>

    <field name="image_1920" type="base64"

           file="my_module/static/img/table.png"/>

    <field name="company_id" ref="base.main_company"/>

</record>


No need to create a separate product.product. Odoo creates it automatically.


For serial:


  <record id="serial_001" model="stock.lot">

    <field name="name">SERIAL001</field>

    <field name="product_id" ref="sales_test_1_product_template"/>

    <field name="company_id" ref="base.main_company"/>

</record>


<record id="serial_002" model="stock.lot">

    <field name="name">SERIAL002</field>

    <field name="product_id" ref="sales_test_1_product_template"/>

    <field name="company_id" ref="base.main_company"/>

</record>


<record id="serial_003" model="stock.lot">

    <field name="name">SERIAL003</field>

    <field name="product_id" ref="sales_test_1_product_template"/>

    <field name="company_id" ref="base.main_company"/>

</record>


Hope it helps.

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
Inventory Reporting Access Level Rezolvat
V17.0
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
oct. 25
2195
Product Variant id in Odoo website product page??
product.product product.id website website_sale Products
Imagine profil
0
mai 21
3860
Report for product.template
product.product
Imagine profil
Imagine profil
1
mai 21
7677
How to print Barcode Labels with price from pricelist?
product.product
Imagine profil
Imagine profil
5
aug. 16
6560
How to have data from product.template in product.product object
product.product
Imagine profil
Imagine profil
1
iul. 15
8784
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