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

ERROR: object has no attribute

Abonare

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

Această întrebare a fost marcată
attendanceinherithr_employeeattribute_error
1 Răspunde
16485 Vizualizări
Imagine profil
JeroenB

Hello,

I am trying to run this code:

models.execute_kw(DB, uid, PASS, 'hr.employee', 'attendance_action_change_jer', [state['id']], {})

I made a new class which inherits hr.employee from the hr_attendance.py
see: https://github.com/odoo/odoo/blob/8.0/addons/hr_attendance/hr_attendance.py

my new class:

class hr_employee(models.Model):

            _inherit = "hr.employee"

            # _name = "hr.employee"

            rfid_tag = fields.Char(string="RF ID tag for the user")

            def attendance_action_change_jer(self, cr, uid, ids, context=None):

                            _logger = logging.getLogger(__name__)

                            _logger.error('msg error')


but I got this error:

2015-07-10 10:30:26,989 11875 ERROR jeroen004 openerp.http: 'hr.employee' object has no attribute 'attendance_action_change_jer'

Traceback (most recent call last):

File "/home/luc/odoo/odoo/openerp/http.py", line 115, in dispatch_rpc

result = dispatch(method, params)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 37, in dispatch

res = fn(db, uid, *params)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 162, in execute_kw

return execute(db, uid, obj, method, *args, **kw or {})

File "/home/luc/odoo/odoo/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 170, in execute

res = execute_cr(cr, uid, obj, method, *args, **kw)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 159, in execute_cr

return getattr(object, method)(cr, uid, *args, **kw)

AttributeError: 'hr.employee' object has no attribute 'attendance_action_change_jer'

I have no idea what goes wrong. Why isnt my new attribute recognised? Even when I copy paste 'attendance_action_change_jer' in hr_attendance.py I get the same error.
Please help me.
Thanks in advance.

0
Imagine profil
Abandonează
Emipro Technologies Pvt. Ltd.

I think you have not given defination with new API that might be an issue. Because execute_kw is working with new model structure. So, please just give @api.multi decorator to your method. I hope it will resolve your issue.

Imagine profil
Bole
Cel mai bun răspuns

Well, your class uses new api style ( models.Model) , while your method uses old style...

so, you have two possible solutions for your problem...

1. old style : you need to add on_change action in xml vew definition

2. new style : use @on_change decorator before actual method.. .

for both you can fin a lot of examples within the source code

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
Can I create one cron job and perform two actions through that ?
attendance hr_employee odooV12
Imagine profil
Imagine profil
2
sept. 19
7776
How to link Odoo module with attandence [odoo 12 CE]
attendance relation hr_employee
Imagine profil
Imagine profil
1
iul. 19
4560
hr attendance app, customize
custom attendance inherit js v15
Imagine profil
0
oct. 22
2565
Call a field value from hr_employee to hr_attendance?
hr employee attendance inherit odoo8.0
Imagine profil
0
oct. 17
7953
Auto logout not working properly for all employees in odoo18ce
attendance
Imagine profil
Imagine profil
Imagine profil
2
oct. 25
513
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