Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Customization inside CRM (Odoo-16)

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
product.productcrm.lead
2 Replies
1867 Tampilan
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
Buang
Avatar
gregbowers
Jawaban Terbai

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
Buang
S.M. Kawsar Hossain
Penulis

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
Jawaban Terbai

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

1
Avatar
Buang
S.M. Kawsar Hossain
Penulis

It worked. Thank you

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Button Option
product.product crm.lead
Avatar
Avatar
1
Jan 24
1673
Inline Edit
product.product crm.lead
Avatar
Avatar
1
Jan 24
2142
Relation Between crm.lead and product.product. Diselesaikan
product.product crm.lead
Avatar
Avatar
1
Jan 24
1820
How to modify the list display fields of crm.lead in Odoo 17 Community Edition?
crm.lead
Avatar
Avatar
Avatar
2
Agu 25
3197
stage updated in Kanban View through. so, open a wizard view ?
crm.lead
Avatar
0
Mei 25
1414
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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