Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

How to display kanban style tile in form view?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
imageone2manykanbanform_view
3 Replies
13120 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Intellect Dev
Autorius

@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
Autorius

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.

Portretas
Yannick Oliver
Best Answer

What works for me:

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

0
Portretas
Atmesti
Portretas
Intellect Dev
Autorius Best Answer

@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
Portretas
Atmesti
Intellect Dev
Autorius

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>

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

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

Registracija
Related Posts Replies Rodiniai Veikla
How to display one2many field in kanban view
one2many kanban
Portretas
Portretas
Portretas
3
rugs. 21
11341
Design an Image gallery so that one can see pictures upladed by admin and rsize it as per as wish?
image kanban
Portretas
0
bal. 16
2878
Keep image size inside forms (no resizing!)
image resizing form_view
Portretas
1
liep. 20
5498
how to show image on kanban view in odoo 12cc ? Solved
image kanban odoo12
Portretas
Portretas
1
birž. 19
6530
Odoo 10: Chatter in PopUp/Dialogs
one2many chatter form_view
Portretas
Portretas
1
vas. 19
6920
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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