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

[Solved] [Odoo 11] How to add an editable field in a treeview.

Odoberať

Get notified when there's activity on this post

This question has been flagged
treevieweditablefieldodoo11
3 Replies
23849 Zobrazenia
Avatar
Valentin

Hello,

I try to add a new editable column on tree view of payments in POS Orders to add the date of receipt of check method payments.

I already add the column, but I can't edit it.

This is my xml :

<record id="date_receipt_check" model="ir.ui.view">

<field name="name">pos.order.form.view.inherit</field>

<field name="model">pos.order</field>

<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"></field>

<field name="arch" type="xml">

<xpath expr="//tree" position="attributes">

<attribute name="editable">tpo</attribute>

</xpath>

<xpath expr="//field[@name='amount']" position="after">

<field name="date_receipt" readonly="False" />

</xpath>

</field>

</record>


Currently, when I click on the "date_receipt" field in tree, it opens a popup "Open: Payments" and therefore, I can not edit my date.

What I need to do to make it editable ?

1
Avatar
Zrušiť
Dipak Shah

Seems like Typo/Spell mistake while making editable treeview .

<attribute name="editable">tpo</attribute>

It should be like <attribute name="editable">top</attribute>

Valentin
Autor

This is an error made when I created this post. My xml does not have this error.

Avatar
Valentin
Autor Best Answer

I have resolved my problème.

First I have overrided field "statement_ids" to make readonly at false

class PosOrder(models.Model):

_inherit = 'pos.order'

# Override the statement_ids field to make readonly at false

    statement_ids = fields.One2many('account.bank.statement.line', 'pos_statement_id', string='Payments', readonly=False)

And in my view :

  1. I have disable creation and deletion to the treeview,

  2. Enable readonly for all fields of the treeview,

  3. And add my new field with readonly at "False".

<record id="receipt_checks_date" model="ir.ui.view">
      <field name="name">pos.order.form.view.inherit</field>
      <field name="model">pos.order</field>
      <field name="inherit_id" ref="point_of_sale.view_pos_pos_form"></field>
      <field name="arch" type="xml">        
        <!--Disable creation and deletion to the treeview of the statement ordres-->
        <xpath expr="//field[@name='statement_ids']/tree" position="attributes">
          <attribute name="create">false</attribute>
          <attribute name="delete">false</attribute>
        </xpath>        
        <!--Make all fields readonly except receipt_date-->
        <xpath expr="//field[@name='journal_id']" position="attributes">
          <attribute name="readonly">1</attribute>
        </xpath>
        <xpath expr="//field[@name='statement_id']" position="attributes">
          <attribute name="readonly">1</attribute>
        </xpath>
        <xpath expr="//field[@name='amount']" position="attributes">
          <attribute name="readonly">1</attribute>
        </xpath>        
        <!--Add column "Receipt date" in the treeview of payment lines-->
        <xpath expr="//field[@name='amount']" position="after">
          <field name="receipt_date" readonly="0" />
        </xpath>        
      </field>
 </record>

I don't no if it's the best solution, but it work.

2
Avatar
Zrušiť
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 can I make only one column of a tree view editable and open the form view when click other columns?
treeview editable
Avatar
Avatar
1
sep 21
6328
Select multiple rows and perform one action - Odoo 11 Solved
treeview odoo11
Avatar
Avatar
Avatar
2
máj 21
20345
Sticky Field Solved
treeview field
Avatar
Avatar
1
nov 19
4218
Make a custom dropdown field with create and edit Solved
field odoo11
Avatar
Avatar
1
mar 18
7765
Can I add text field above tree view?
treeview field text
Avatar
0
jan 25
1
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