Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Cannot inherit to model ir.attachment for Module Fleet

Subscribe

Get notified when there's activity on this post

This question has been flagged
fleeterrorir.attachmentodoo11
2 Replies
6686 Views
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
Discard
Avatar
ghiyats
Author Best Answer

@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
Discard
Avatar
subbarao
Best Answer

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
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
"The character encoding of the HTML document was not declared" when connecting to odoo11 server
error odoo11
Avatar
0
Nov 21
3990
Error: The field `effective_date` does not exist - odoo 11
error odoo11
Avatar
Avatar
1
Nov 19
5762
Odoo Server Error "unable to create thread pipe"
error reporting odoo11
Avatar
0
Jan 22
4792
[Odoo11] How to separate vehicles between Companies using Record Rules?
fleet multicompany odoo11
Avatar
Avatar
1
Jul 20
2961
AttributeError: 'list' object has no attribute 'get'
error docker odoo11
Avatar
Avatar
1
Aug 19
13783
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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