Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Cannot inherit to model ir.attachment for Module Fleet

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
fleeterrorir.attachmentodoo11
2 Besvarelser
6694 Visninger
Avatar
ghiyats

iam use odoo 11 and python 3.5

my py

class LicenseVehicle(models.Model):
_inherit = 'ir.attachment'
_description = 'License Vehicle'

attach_doc_name = fields.Selection([('BPKB','BPKB'),('STNK','STNK'),('KIR/Kartu Uji Berkala Kendaraan Bermotor – Uji Emisi','KIR/Kartu Uji Berkala Kendaraan Bermotor – Uji Emisi'),
('Bukti Pajak Kendaraan','Bukti Pajak Kendaraan'),('KIU/SIPA/KKPKB/Kartu Pengawasan Kendaraan','KIU/SIPA/KKPKB/Kartu Pengawasan Kendaraan'),
('IBM (Izin Bongkar Muat)','IBM (Izin Bongkar Muat)'),('STCK (Surat Tanda Coba Kendaraan)','STCK (Surat Tanda Coba Kendaraan)'),
('TNKB (Tanda Nomor Kendaraan Bermotor)','TNKB (Tanda Nomor Kendaraan Bermotor)')])
doc_number = fields.Char(string='Document Number')
start_date = fields.Date(string='Start Date')
end_date = fields.Date(string='End Date')
description = fields.Text(string='Description')


my xml

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record
model='ir.ui.view' id='ext_fleet_vehicle_log_services_view_attach'>
<field
name="name">ext.fleet.vehicle.log.services_view_attach</field>
<field
name="model">fleet.vehicle.log.services</field>
<field
name="inherit_id" ref="fleet_operations.fleet_vehicle_log_services_view" />
<field
name="arch" type="xml">
<xpath
expr="//field[@name='wrk_attach_ids']/tree/field[@name='datas']" position="after">
<field
name="description"/>
<field
name="doc_number"/>
<field
name="attach_doc_name"/>
<field
name="start_date"/>
<field
name="end_date"/>
 
               </xpath>
<xpath
expr="//field[@name='wrk_attach_ids']/form/group/field[@name='datas']" position="after">
<field
name="description" string="Description"/>
                        <field name="doc_number"/>
<field
name="attach_doc_name"/>
<field
name="start_date"/>

<field name="end_date"/>
</xpath>
</field>
</record>
</odoo>

my error

2019-04-01 03:40:15,925 13300 INFO KMDI-DEV odoo.addons.base.ir.ir_http: Generating routing map
2019-04-01 03:40:16,678 13300 ERROR KMDI-DEV odoo.sql_db: bad query: b'SELECT "ir_attachment"."id" as "id","ir_attachment"."url" as "url","ir_attachment"."file_size" as "file_size","ir_attachment"."description" as "description","ir_attachment"."write_uid" as "write_uid","ir_attachment"."start_date" as "start_date","ir_attachment"."access_token" as "access_token","ir_attachment"."create_uid" as "create_uid","ir_attachment"."type" as "type","ir_attachment"."datas_fname" as "datas_fname","ir_attachment"."doc_number" as "doc_number","ir_attachment"."end_date" as "end_date","ir_attachment"."store_fname" as "store_fname","ir_attachment"."company_id" as "company_id","ir_attachment"."res_name" as "res_name","ir_attachment"."name" as "name","ir_attachment"."res_id" as "res_id","ir_attachment"."checksum" as "checksum","ir_attachment"."attachment_id" as "attachment_id","ir_attachment"."res_model" as "res_model","ir_attachment"."create_date" as "create_date","ir_attachment"."write_date" as "write_date","ir_attachment"."mimetype" as "mimetype","ir_attachment"."attach_doc_name" as "attach_doc_name","ir_attachment"."attachment_id_2" as "attachment_id_2","ir_attachment"."res_field" as "res_field","ir_attachment"."public" as "public","ir_attachment"."wo_attachment_id" as "wo_attachment_id" FROM "ir_attachment" WHERE "ir_attachment".id IN (8248, 257, 259, 270, 3858, 3367, 6190, 3763, 6078, 1087, 318, 5569, 6083, 6084, 6085, 6086, 6087, 329, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 3795, 3796, 3797, 3802, 3806, 236, 237, 238)'
ERROR: column ir_attachment.start_date does not exist
LINE 1: ...ption","ir_attachment"."write_uid" as "write_uid","ir_attach...
                                                             ^

2019-04-01 03:40:17,046 13300 INFO KMDI-DEV werkzeug: 127.0.0.1 - - [01/Apr/2019 03:40:17] "GET /web HTTP/1.1" 500 -
2019-04-01 03:40:17,214 13300 ERROR KMDI-DEV werkzeug: Error on request:
Traceback (most recent call last):
  File "C:\Users\ghiya\AppData\Local\Programs\Python\Python35\lib\site-packages\werkzeug\serving.py", line 205, in run_wsgi
    execute(self.server.app)
  File "C:\Users\ghiya\AppData\Local\Programs\Python\Python35\lib\site-packages\werkzeug\serving.py", line 193, in execute
    application_iter = app(environ, start_response)
  File "E:\odoo\odoo\service\server.py", line 260, in app
    return self.app(e, s)
  File "E:\odoo\odoo\service\wsgi_server.py", line 166, in application
    return application_unproxied(environ, start_response)
  File "E:\odoo\odoo\service\wsgi_server.py", line 154, in application_unproxied
    result = handler(environ, start_response)
  File "E:\odoo\odoo\http.py", line 1319, in __call__
    return self.dispatch(environ, start_response)
  File "E:\odoo\odoo\http.py", line 1293, in __call__
    return self.app(environ, start_wrapped)
  File "C:\Users\ghiya\AppData\Local\Programs\Python\Python35\lib\site-packages\werkzeug\wsgi.py", line 599, in __call__
    return self.app(environ, start_response)
  File "E:\odoo\odoo\http.py", line 1491, in dispatch
    result = ir_http._dispatch()
  File "e:\odoo\addons\auth_signup\models\ir_http.py", line 19, in _dispatch
    return super(Http, cls)._dispatch()
  File "e:\odoo\addons\web_editor\models\ir_http.py", line 22, in _dispatch
    return super(IrHttp, cls)._dispatch()
  File "e:\odoo\addons\http_routing\models\ir_http.py", line 393, in _dispatch
    result = super(IrHttp, cls)._dispatch()
  File "e:\odoo\addons\utm\models\ir_http.py", line 26, in _dispatch
    response = super(IrHttp, cls)._dispatch()
  File "e:\odoo\odoo\addons\base\ir\ir_http.py", line 212, in _dispatch
    return cls._handle_exception(e)
  File "e:\odoo\addons\website\models\ir_http.py", line 169, in _handle_exception
    return super(Http, cls)._handle_exception(exception)
  File "e:\odoo\addons\utm\models\ir_http.py", line 31, in _handle_exception
    response = super(IrHttp, cls)._handle_exception(exc)
  File "e:\odoo\odoo\addons\base\ir\ir_http.py", line 182, in _handle_exception
    return request._handle_exception(exception)
  File "E:\odoo\odoo\http.py", line 771, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "E:\odoo\odoo\http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "E:\odoo\odoo\tools\pycompat.py", line 87, in reraise
    raise value
  File "e:\odoo\odoo\addons\base\ir\ir_http.py", line 208, in _dispatch
    result = request.dispatch()
  File "E:\odoo\odoo\http.py", line 830, in dispatch
    r = self._call_function(**self.params)
  File "E:\odoo\odoo\http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "E:\odoo\odoo\service\model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "E:\odoo\odoo\http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "E:\odoo\odoo\http.py", line 937, in __call__
    return self.method(*args, **kw)
  File "E:\odoo\odoo\http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "e:\odoo\addons\web\controllers\main.py", line 453, in web_client
    context = request.env['ir.http'].webclient_rendering_context()
  File "e:\odoo\addons\web\models\ir_http.py", line 17, in webclient_rendering_context
    'menu_data': request.env['ir.ui.menu'].load_menus(request.debug),
  File "<decorator-gen-24>", line 2, in load_menus
   
  File "E:\odoo\odoo\tools\cache.py", line 89, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "e:\odoo\odoo\addons\base\ir\ir_ui_menu.py", line 232, in load_menus
    menu_roots_data = menu_roots.read(fields) if menu_roots else []
  File "E:\odoo\odoo\models.py", line 2591, in read
    self._read_from_database(stored, inherited)
  File "E:\odoo\odoo\models.py", line 2752, in _read_from_database
    field.read(fetched)
  File "E:\odoo\odoo\fields.py", line 1688, in read
    for att in records.env['ir.attachment'].sudo().search(domain)}
  File "E:\odoo\odoo\fields.py", line 1688, in <dictcomp>
    for att in records.env['ir.attachment'].sudo().search(domain)}
  File "E:\odoo\odoo\fields.py", line 944, in __get__
    self.determine_value(record)
  File "E:\odoo\odoo\fields.py", line 1055, in determine_value
    self.compute_value(recs)
  File "E:\odoo\odoo\fields.py", line 1011, in compute_value
    self._compute_value(records)
  File "E:\odoo\odoo\fields.py", line 1002, in _compute_value
    getattr(records, self.compute)()
  File "e:\odoo\odoo\addons\base\ir\ir_attachment.py", line 189, in _compute_datas
    if attach.store_fname:
  File "E:\odoo\odoo\fields.py", line 944, in __get__
    self.determine_value(record)
  File "E:\odoo\odoo\fields.py", line 1045, in determine_value
    record._prefetch_field(self)
  File "E:\odoo\odoo\models.py", line 2653, in _prefetch_field
    result = records.read([f.name for f in fs], load='_classic_write')
  File "e:\odoo\odoo\addons\base\ir\ir_attachment.py", line 427, in read
    return super(IrAttachment, self).read(fields, load=load)
  File "E:\odoo\odoo\models.py", line 2591, in read
    self._read_from_database(stored, inherited)
  File "E:\odoo\odoo\models.py", line 2718, in _read_from_database
    cr.execute(query_str, params)
  File "E:\odoo\odoo\sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "E:\odoo\odoo\sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: column ir_attachment.start_date does not exist
LINE 1: ...ption","ir_attachment"."write_uid" as "write_uid","ir_attach...
                                                             ^


can anyone help ?

or ir.attachment cant inherit or something wrong with my code ?

0
Avatar
Kassér
Avatar
ghiyats
Forfatter Bedste svar

@subbarao

i sure. i have done add py file in init and xml to manifest

its error appear when i run my odoo at localhost when run the program

0
Avatar
Kassér
Avatar
subbarao
Bedste svar

Have you import the custom python file in __init__.py file?

Have you added the custom xml file in __manifest__.py file?

Have you Upgrade the custom module?

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
"The character encoding of the HTML document was not declared" when connecting to odoo11 server
error odoo11
Avatar
0
nov. 21
3999
Error: The field `effective_date` does not exist - odoo 11
error odoo11
Avatar
Avatar
1
nov. 19
5772
Odoo Server Error "unable to create thread pipe"
error reporting odoo11
Avatar
0
jan. 22
4815
[Odoo11] How to separate vehicles between Companies using Record Rules?
fleet multicompany odoo11
Avatar
Avatar
1
jul. 20
2970
AttributeError: 'list' object has no attribute 'get'
error docker odoo11
Avatar
Avatar
1
aug. 19
13783
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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