Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

Cannot inherit to model ir.attachment for Module Fleet

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
fleeterrorir.attachmentodoo11
2 Trả lời
6712 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
ghiyats
Tác giả Câu trả lời hay nhất

@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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
subbarao
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
"The character encoding of the HTML document was not declared" when connecting to odoo11 server
error odoo11
Ảnh đại diện
0
thg 11 21
4002
Error: The field `effective_date` does not exist - odoo 11
error odoo11
Ảnh đại diện
Ảnh đại diện
1
thg 11 19
5775
Odoo Server Error "unable to create thread pipe"
error reporting odoo11
Ảnh đại diện
0
thg 1 22
4823
[Odoo11] How to separate vehicles between Companies using Record Rules?
fleet multicompany odoo11
Ảnh đại diện
Ảnh đại diện
1
thg 7 20
2975
AttributeError: 'list' object has no attribute 'get'
error docker odoo11
Ảnh đại diện
Ảnh đại diện
1
thg 8 19
13783
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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