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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • 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
    • Služby pro partnery
    • 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

How to make a <tree> view that is editable="bottom" but also has a clickable link to the object?

Odebírat

Get notified when there's activity on this post

This question has been flagged
viewsv15
2 Odpovědi
17489 Zobrazení
Avatar
Josef Schmid

I want to have a tree view within my form that is editable="bottom" because this option enables a really quick way to add and edit the corresponding models but that also has a clickable link to the model. I have demonstrated it in this image :

As you can see I added the arrows on the right with photoshop to show you what I need. Clicking on the arrow should open the form view of that model, just like it does normally.

How can I add such an arrow to the tree view or achieve something similar?


This is what the tree view currently looks like

```

<page string="Stände">
<field name="staende">
<tree editable="bottom">
<field name="draw"/>
<
field name="name" />
<
field name="aussteller"/>
<
field name="start_number" />
<
field name="end_number" />
<
field name="type" />
<
field name="depth" />
<
field name="walls" />
<
field name="carpet"/>
tree>
field>page>

```

0
Avatar
Zrušit
Avatar
Jainesh Shah(Aktiv Software)
Nejlepší odpověď

Hello Josef Schmid,

Please find Code in Comment. 

hope may this helpful for you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

0
Avatar
Zrušit
Jainesh Shah(Aktiv Software)

Add the attribute in tree tag like below:
<tree editable="top" create="1" edit="1">

Josef Schmid
Autor

Thank you for your answer. I edited the tree tag to look like this:

<tree editable="bottom" create="1" edit="1">
<field name="draw"/>
<field name="name" />
<field name="aussteller"/>
<field name="start_number" />
<field name="end_number" />
<field name="type" />
<field name="depth" />
<field name="walls" />
<field name="carpet"/>
</tree>

(I also tried editable="top")

Unfortunately, the tree still looks like this and I have no way of opening the model in the form view.

https://i.imgur.com/3WQFUkf.png

Avatar
usvameria
Nejlepší odpověď

Hi, you can add a (object) button after your last field in tree tags.

<button class="oe_stat_button"
icon="fa-pencil-square-o"
name="open_budget_form_view"
type="object"/>


name attribute is should be name of the action function at behind.



0
Avatar
Zrušit
Josef Schmid
Autor

Hey, I dont quite understand, where to put to button and what the function has to look like. Can you help by explaining it a bit further?

From what I understand, it looks like you want me to put the button here

<tree editable="bottom" create="1" edit="1">
<field name="draw"/>
<field name="name" />
<field name="aussteller"/>
<field name="start_number" />
<field name="end_number" />
<field name="type" />
<field name="depth" />
<field name="walls" />
<field name="carpet"/>
<button class="oe_stat_button"
icon="fa-pencil-square-o"
name="open_form_view_from_that_model"
type="object"/>
</tree>

Hover I do not know how to write a method or action that opens that form. Would you mind helping?

Thank you very much.

usvameria

With pleasure,

Here is complete sample:

My tree view's model is "project.budget.item" and i should write my button's action function in this model but firstly let's add our button to view:

<record id="project_budget_tree" model="ir.ui.view">
<field name="name">project.budget.tree</field>
<field name="model">project.budget.item</field>
<field name="arch" type="xml">
<tree editable="bottom" create="1" edit="1">
<field name="sequence"/>
<field name="name" />
<field name="date"/>
<button class="oe_stat_button"
icon="fa-pencil-square-o"
name="open_budget_form_view"
type="object" />
</tree>
</field>
</record>

Now it's time to write a action function to call it from button:

class ProjectBudgetItem(models.Model):
_name = "project.budget.item"

#I should write this function name to my button's name attribute in tree view
def open_budget_form_view(self):
return {
'name': 'Budget Edit',
'domain': [],
'res_model': 'project.budget.item',
'type': 'ir.actions.act_window',
'view_mode': 'form',
'view_type': 'form',
'res_id': self.id,
'target': 'new',
}

or you should write something like this:

def action_account_bank_statement(self):
self.ensure_one()
action = self.env.ref('account_cheque.action_account_bank_statement').read()[0]
action['context'] = {'default_account_cheque_transaction_id': self.id}
return action

if i understood your question correctly the above example will give you what you want.

Thanks.

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
How do i add stages for odoo 15 kanban view?
views xml v15
Avatar
Avatar
1
kvě 24
3952
Unknown field in domain ...
views models v15
Avatar
Avatar
1
zář 22
4871
Menu Item not showing up under event configuration Vyřešeno
views menuitem v15
Avatar
Avatar
1
srp 22
3726
how to add pages to notebook that is being added from another module Odoo15 Vyřešeno
views form v15
Avatar
Avatar
Avatar
2
srp 22
6764
Displaying different views in different contexts Vyřešeno
views form v15
Avatar
Avatar
1
čvc 22
5527
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