Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
viewsv15
2 Replies
17486 Zobrazenia
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šiť
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

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šiť
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
Best Answer

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šiť
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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
How do i add stages for odoo 15 kanban view?
views xml v15
Avatar
Avatar
1
máj 24
3952
Unknown field in domain ...
views models v15
Avatar
Avatar
1
sep 22
4871
Menu Item not showing up under event configuration Solved
views menuitem v15
Avatar
Avatar
1
aug 22
3726
how to add pages to notebook that is being added from another module Odoo15 Solved
views form v15
Avatar
Avatar
Avatar
2
aug 22
6762
Displaying different views in different contexts Solved
views form v15
Avatar
Avatar
1
júl 22
5527
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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