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

How to display kanban style tile in form view?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
imageone2manykanbanform_view
3 Replies
13179 Tampilan
Avatar
Intellect Dev

I have an one2many image field that currently shows images in a tabular style. What I want to do is to show it in a card style like a kanban card or in a thumbnail style view.

 

This is my current code:

    class VariantsLines(models.Model):
    _inherit = 'product.variants.lines'

    product_image_360_ids = fields.One2many('product.image.360', 'product_tmpl_id', string='Images')
    display_360_image = fields.Boolean(string='Display 360 Image')


class ProductImage360(models.Model):
    _name = 'product.image.360'
    _order = 'sequence'

    name = fields.Char(string='Name', readonly=False)
    image = fields.Binary(string='Image', attachment=True, readonly=False)
    product_tmpl_id = fields.Many2one('product.template', string='Related Product', copy=True)
    sequence = fields.Integer(string="Sequence", readonly=False)

view.xml

    <field name="inherit_id" ref="jewellery.view_product_variants_lines_form"/>
            <field name="arch" type="xml">
                <xpath expr="//form" position="inside">
                    <div>
                        <group>
                            <field name="display_360_image"/>
                        </group>

                        <group string="Images for 360 view" attrs="{'invisible': [('display_360_image', '=', False)]}">
                            <field name="product_image_360_ids" nolabel="1"
                                   context="{'default_product_tmpl_id': active_id}">
                                <tree create="true" editable="bottom">
                                    <field name="sequence" widget="handle" readonly="0"/>
                                    <field name="name" readonly="0"/>
                                    <field name="image" widget="image" class="oe_left oe_avatar" readonly="0"/>
                                </tree>
                            </field>
                        </group>
                    </div>
                </xpath>
            </field>
0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,
Just replace the XML with the below code

<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<div>
<group>
<field name="display_360_image"/>
</group>

<group string="Images for 360 view" attrs="{'invisible': [('display_360_image', '=', False)]}">
<field name="product_image_360_ids" nolabel="1"
context="{'default_product_tmpl_id': active_id}">
<kanban>
<field name="id"/>
<field name="sequence"/>
<field name="name"/>
<field name="image"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('product.image.360', 'image', record.id.raw_value)"
alt="Image"/>
</div>
<div class="oe_kanban_details">
<ul>
<li class="mb4">
<h5>
<field name="name"/>
</h5>
</li>
<li>
<div t-if="record.sequence.value">
<field name="sequence"/>
</div>
</li>

</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</group>
</div>
</xpath>
</field>

Regards

5
Avatar
Buang
Intellect Dev
Penulis

@Cybrosys Thanks for your help, it worked but it has created some issues.

1. Now when I am creating a record it shows my many2one field on the view :

product_tmpl_id = fields.Many2one('product.template', string='Related Product', copy=True)

I have tried to make it invisible by the attribute invisible = true in python. Also, that field was not in my view so I explicitly included that field in the view and tried invisible = true in XML as well but it didn't work either and the relational field is visible on creating the record.

2. The other is that when I am selecting the image the image doesn't show up after selecting but it only shows up after I save the record (it was not in the case of tree view)

Intellect Dev
Penulis

However, I have changed the field product_tmpl_id to readonly=True so it can not be edited. But there must be some way to hide it as well.

Avatar
Yannick Oliver
Jawaban Terbai

What works for me:

context="{'default_name': name}" mode="kanban" options="{'create_text':' '}"
nolabel="1" invisible="0" />

0
Avatar
Buang
Avatar
Intellect Dev
Penulis Jawaban Terbai

@Cybrosys Thanks for your help, it worked but it has created some issues.

1. Now when I am creating a record it shows my many2one field on the view : 
product_tmpl_id = fields.Many2one('product.template', string='Related Product', copy=True)

I have tried to make it invisible by the attribute invisible = true in python. Also,  that field was not in my view so I explicitly included that field in the view and tried invisible = true in XML as well but it didn't work either and the relational field is visible on creating the record.

2. The other is that when I am selecting the image the image doesn't show up after selecting but it only shows up after I save the record (it was not in the case in tree view)

3. There is no way to delete a kanban, if I mistakenly save a record there is no way to delete that (like it shows in action or any other option)

0
Avatar
Buang
Intellect Dev
Penulis

resolved delete issue through this: <kanban delete="true"> . . .

.

.

<a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>

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
How to display one2many field in kanban view
one2many kanban
Avatar
Avatar
Avatar
3
Sep 21
11363
Design an Image gallery so that one can see pictures upladed by admin and rsize it as per as wish?
image kanban
Avatar
0
Apr 16
2912
Keep image size inside forms (no resizing!)
image resizing form_view
Avatar
1
Jul 20
5528
how to show image on kanban view in odoo 12cc ? Diselesaikan
image kanban odoo12
Avatar
Avatar
1
Jun 19
6561
Odoo 10: Chatter in PopUp/Dialogs
one2many chatter form_view
Avatar
Avatar
1
Feb 19
6944
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