Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Customization inside CRM (Odoo-16)

Odebírat

Get notified when there's activity on this post

This question has been flagged
product.productcrm.lead
2 Odpovědi
1860 Zobrazení
Avatar
S.M. Kawsar Hossain

I have a page inside notebook which is "Product Info". Inside this page, I have added two fields : product_id, product_image. So whenever I select a product, it will automatically show relevant image of that product.I want to this product_id field as a one2many relation type with product.product alongside with product_image and attachment file field similar like order_line so that I can select as much product as I want. I have gotten the structure. But now, its not showing my existing product but want me to create new one which I dont want. I want to select my existing product. If I need to create one, i will do it in product.product model as usual rule. Can anyone suggest me what I need to do?

here my code:

.py:

from odoo import models, fields, api

class CrmLead(models.Model):

_inherit = 'crm.lead'

product_ids = fields.One2many('product.product', 'crm_lead_id', string='Products')

class ProductProduct(models.Model):

_inherit = 'product.product'

crm_lead_id = fields.Many2one('crm.lead', string='CRM Lead')

product_image = fields.Binary(string='Product Image')

 

.xml:

techtrioz.crm.lead.form.inherit

crm.lead



Any suggestion, what to do?




Any suggestion, what to do?



0
Avatar
Zrušit
Avatar
gregbowers
Nejlepší odpověď

To enable the selection of existing products within your product_ids field, consider changing its type in the CrmLead model to Many2many instead of One2many . This adjustment should allow you to directly choose multiple existing products. Here's the suggested code: 

product_ids = fields.Many2many( 'product.product' , 'crm_lead_product_rel' , string= 'Products' ) 

Ensure that your view form for CrmLead is appropriately configured to display the product_ids field, and confirm there are existing products in the database. If the issue persists, feel free to share additional details for further assistance.

1
Avatar
Zrušit
S.M. Kawsar Hossain
Autor

Thank you so much. Here, whenever I try to select a product from add line that I made previously, another short page pop up. But I want to select products inside line just like order_line . What I need to do here?
here my code:
.py:
from odoo import models, fields, api

class CrmLead(models.Model):
_inherit = 'crm.lead'

product_ids = fields.Many2many('product.product', string='Products', edit="inline")
combined_info = fields.Char(string='Product Info', compute='_compute_combined_info')
def _compute_combined_info(self):
for product in self:
product.combined_info = f"{product.default_code} - {product.name}"
from odoo import models, fields, api

class ProductImage(models.Model):
_inherit = 'product.product'
_description = 'Product Image'

product_image = fields.Binary(string='Design')
combined_info = fields.Char(string='Product Info', compute='_compute_combined_info')

def _compute_combined_info(self):
for product in self:
product.combined_info = f"{product.default_code} - {product.name}"

.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="wise_crm_lead_view_form_inherit" model="ir.ui.view">
<field name="name">techtrioz.crm.lead.form.inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='internal_notes']" position='after'>
<page string="Product Info" name="product_info">
<tree position="inside" editable="bottom">
<field name="product_ids" widget="one2many_list">
<tree>
<!-- <field name="default_code" string="Products"/> -->
<field name="combined_info" string="Product Info"/>
<field name="product_image" widget="image" options='{"size": [80, 80]}'/>
</tree>
</field>
</tree>
</page>
</xpath>
</field>
</record>
</odoo>

Avatar
Kaushik Pathak
Nejlepší odpověď

Please change the name of one2many with prefix before product_ids. It maybe works.

1
Avatar
Zrušit
S.M. Kawsar Hossain
Autor

It worked. Thank you

Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Button Option
product.product crm.lead
Avatar
Avatar
1
led 24
1666
Inline Edit
product.product crm.lead
Avatar
Avatar
1
led 24
2132
Relation Between crm.lead and product.product. Vyřešeno
product.product crm.lead
Avatar
Avatar
1
led 24
1815
How to modify the list display fields of crm.lead in Odoo 17 Community Edition?
crm.lead
Avatar
Avatar
Avatar
2
srp 25
3161
stage updated in Kanban View through. so, open a wizard view ?
crm.lead
Avatar
0
kvě 25
1397
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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