Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Odoo 8 -Browse a model in Object Class

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
modelobjectclassbrowse
1 Răspunde
7984 Vizualizări
Imagine profil
Kabeer KB

I have Object class and i need to browse the model document.directory in this class. I tried this.


class node_database(object):

   obj=openerp.registry(cr.dbname).get('document.directory')
   print'obj',obj # it ptints document.directory
   datas=obj.browse(cr,uid,ids)
   print'datas',datas # Here nothing print

and also tried this:

  osv_pool = pooler.get_pool(dbname)
  dir_obj=osv_pool.get('document.directory')
0
Imagine profil
Abandonează
Kabeer KB
Autor

Thnks Ajeng for your reply. I tried this :

dir_obj = pooler.get_pool(dbname).get('document.directory')

document_id=dir_obj.search(cr,uid,[('id','=',ids[0])])

print'document_id',document_id #It prints correct value

document_data=dir_obj.browse(cr,uid,document_id) #not get into browse function

print'document_data',document_data #not print

Kabeer KB
Autor

Getting this Error:

2016-06-24 06:41:52,690 9427 ERROR dms1 openerp.addons.document_ftp.ftpserver: Traceback (most recent call last):

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document_ftp/ftpserver/ftpserver.py", line 1806, in try_as_current_user

re=self.run_as_current_user(function, *args, **kwargs)

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document_ftp/ftpserver/ftpserver.py", line 1779, in run_as_current_user

return function(*args, **kwargs)

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document_ftp/ftpserver/abstracted_fs.py", line 509, in get_list_dir

listing = self.listdir(datacr)

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document_ftp/ftpserver/abstracted_fs.py", line 377, in listdir

res = node.children(cr)

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document/document.py", line 981, in children

res = self._child_get(cr, domain=domain) + self._file_get(cr)

File "/home/kabeer/odoo-8.0-20151229/openerp/addons/document/document.py", line 1022, in _child_get

print'cntobj_search_read',cntobj.search_read(cr, uid,[('id','=',1)],['name'],context=ctx)

File "/home/kabeer/odoo-8.0-20151229/openerp/api.py", line 256, in wrapper

return old_api(self, *args, **kwargs)

File "/home/kabeer/odoo-8.0-20151229/openerp/models.py", line 5186, in search_read

result = self.read(cr, uid, record_ids, fields, context=read_ctx)

File "/home/kabeer/odoo-8.0-20151229/openerp/api.py", line 256, in wrapper

return old_api(self, *args, **kwargs)

File "/home/kabeer/odoo-8.0-20151229/openerp/models.py", line 3144, in read

records = self.browse(cr, user, ids, context)

File "/home/kabeer/odoo-8.0-20151229/openerp/api.py", line 256, in wrapper

return old_api(self, *args, **kwargs)

File "/home/kabeer/odoo-8.0-20151229/openerp/models.py", line 5266, in browse

return self._browse(Environment(cr, uid, context or {}), ids)

File "/home/kabeer/odoo-8.0-20151229/openerp/api.py", line 740, in __new__

env, envs = None, cls.envs

File "/home/kabeer/odoo-8.0-20151229/openerp/tools/func.py", line 109, in __get__

return self.fget.__get__(None, owner)()

File "/home/kabeer/odoo-8.0-20151229/openerp/api.py", line 713, in envs

return cls._local.environments

File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 71, in __getattr__

raise AttributeError(name)

AttributeError: environments

Imagine profil
Ajeng Shilvie
Cel mai bun răspuns

Before u browse the other model, u have to make sure if there is some parameter that have to be search before u browse the model. such as :

document_search = self.pool.get('document.directory').search(cr,uid,[('field_name','=',condition)])

#after that u can browse like this
document_browse = self.pool.get('document.directory').browse(cr,uid,document_search)

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Is there any object attribute called _description? Rezolvat
model object attributes
Imagine profil
Imagine profil
2
mai 20
7267
readonly access to specific fields
field model object
Imagine profil
Imagine profil
1
mar. 15
8945
How can i browse this m2m record? Rezolvat
object browse_record browse
Imagine profil
Imagine profil
2
mar. 15
5191
osv.Model field that could store Python objects?
python model object
Imagine profil
0
mar. 15
5616
How to get the id from a browse_record?
id object browse_record browse
Imagine profil
Imagine profil
1
mar. 15
8401
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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