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í
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • 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
    • Services for Partners
    • 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

one2many problem: How to fix this?Button become readonly when it's shown on wizard object's one2many??

Odebírat

Get notified when there's activity on this post

This question has been flagged
4 Odpovědi
8861 Zobrazení
Avatar
Alcaline

Problem with this button GET TOTAL:  I got a form that has a one2many relationship with the other class, when I  go to  the tree view of this one2many the button  GET TOTAL is disabled but when in the original form view it is enbled, I think the cuase of this is the widget  one2many because i tried it to many2many it works but i need it in one2many relationship. any idea please or have you encountered this kind of problem?? how can i fix this problem??

the form that has a one2many relationship and the button disabled:

 

 

 

 

 

 

2
Avatar
Zrušit
klacus

Please post your Code! xml and py.

Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Nejlepší odpověď

Hello Lee,

The button will always be disabled for one2many field if record is not saved.

Try it after saving the record. It will work once it is saved.

1
Avatar
Zrušit
Alcaline
Autor

thank you Sudhir Arya, thanks for the information i did that already. but one question why is it the button inside the one2many list is disabled? any explanation for this.

Sudhir Arya (ERP Harbor Consulting Services)

Its a default behavior of the Odoo. We cannot change it.

Alcaline
Autor

thanks Mr. Arya this is really a big help in task:)

Pawan Kumar Sharma

Hello Sudhir, I have similar problem. Is there any way to enable this button in wizard for one2many field?

Avatar
klacus
Nejlepší odpověď

Sorry but didn't clear me for the relation with one2many and the button.

Your form view has a button. it is clear.

Your model has a one2many relation this is also clear.

How you definie the button in xml? Do you have any extra atrributes? Do you have a acces rights? A lot of thinks is possible to miss, and the effect is the trouble. As I wrote down to you your prev. post, please post the xml, for the better understanding.

 

Please try this:

    <xpath expr="//field[@name='amount']" position="after">
                    <button name="get_total_bom_commit_button" string="Get Total" type="object" icon="gtk-o"/>
                </xpath>

 

I thin kyour problem is here:

states="" or atribute="" or readonly="False" >> just clear out
 

0
Avatar
Zrušit
Alcaline
Autor

hi sir, this is my code in PY for button: (This button is belong to the class of "account.analytic.line.commit" ) and i want the whole form of this button will display in my project.project class. So, I did a one2many relationship between the two class ("account.analytic.line.commit" and "project.project") to call the form in project.project. The codes that i did is totally working without errors except for one problem the button GET TOTAL is disable. I don't understand why it is disabled. Can you please help me i don't know what to do? class account_analytic_line_commit(osv.osv): _inherit = "account.analytic.line.commit" def get_total_bom_commit_button(self, cr, uid, ids, context=None): bom_total_new = {} bom_prod_com_pool = self.pool.get('bom.product.components') for bom_total_ids in self.browse(cr,uid,ids): new_price = 0 bom_total_line = bom_prod_com_pool.search(cr,uid,[('commit_id','=',bom_total_ids.id)]) netsvc.Logger().notifyChannel("\n for bom_total_new in bom_prod_com_pool.browse(cr,uid,bom_total_line): new_price = new_price + bom_total_new.total_price self.write(cr,uid,bom_total_ids.id,{'amount': new_price}, context=context) return True and this is my code in XML: <xpath expr="//field[@name='amount']" position="after">

Alcaline
Autor

I'm sorry sir for what I've been said a while ago.. I'm just only newbie here in ODOO.

klacus

Ok. No problem.

klacus

I refresh my ansver. Let's try.

Alcaline
Autor

sir I've already try that one but it's not working.. I think the problem is the ONE2MANY relationship because when I tried to changes it to MANY2MANY the button GET TOTAL inside it works perfectly. but I need it to stay ONE2MANY. I also have this kind of problem with the other modules. how can i fix that one? :(

klacus

Hi. Please send the complett modul for me. at kozmalg@gmail.com

Alcaline
Autor

sorry sir but i can't do that

Avatar
Alcaline
Autor Nejlepší odpověď

hi sir, this is my code in PY for button: (This button is belong to the class of "account.analytic.line.commit" ) and i want the whole form of this button will display in my project.project class. So, I did a one2many relationship between the two class ("account.analytic.line.commit" and "project.project") to call the form in project.project. The codes that i did is totally working without errors except for one problem the button GET TOTAL is disable. I don't understand why it is disabled. Can you please help me i don't know what to do?

 

class account_analytic_line_commit(osv.osv):

_inherit = "account.analytic.line.commit"

 def get_total_bom_commit_button(self, cr, uid, ids, context=None):
        
        
        bom_total_new = {}
        
        bom_prod_com_pool = self.pool.get('bom.product.components')
        
        for bom_total_ids in self.browse(cr,uid,ids):

            new_price = 0
            
            bom_total_line = bom_prod_com_pool.search(cr,uid,[('commit_id','=',bom_total_ids.id)])
            
            for bom_total_new in bom_prod_com_pool.browse(cr,uid,bom_total_line):
               
                new_price = new_price + bom_total_new.total_price
            
            self.write(cr,uid,bom_total_ids.id,{'amount': new_price}, context=context)
            
                
        return True    

 

And this is my code in XML:

    <xpath expr="//field[@name='amount']" position="after">
                    <button type="object"
                            icon="gtk-ok"
                            name="get_total_bom_commit_button"
                            string="Get Total" groups="" readonly="False" attrs="" states="" disable="False" button="True"/>
                </xpath>

0
Avatar
Zrušit
Avatar
Adil Akbar
Nejlepší odpověď

Hi, you can follow following link for this:

https://youtu.be/oMnHpHH54QU

Thanks

0
Avatar
Zrušit
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
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