Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to display kanban style tile in form view?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
imageone2manykanbanform_view
3 Antwoorden
13206 Weergaven
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
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

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
Annuleer
Intellect Dev
Auteur

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

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
Beste antwoord

What works for me:

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

0
Avatar
Annuleer
Avatar
Intellect Dev
Auteur Beste antwoord

@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
Annuleer
Intellect Dev
Auteur

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>

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to display one2many field in kanban view
one2many kanban
Avatar
Avatar
Avatar
3
sep. 21
11383
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
2916
Keep image size inside forms (no resizing!)
image resizing form_view
Avatar
1
jul. 20
5552
how to show image on kanban view in odoo 12cc ? Opgelost
image kanban odoo12
Avatar
Avatar
1
jun. 19
6567
Odoo 10: Chatter in PopUp/Dialogs
one2many chatter form_view
Avatar
Avatar
1
feb. 19
6959
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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