콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
7 답글
9707 화면

Hi Experts

Its my first time to add a custom field in the form through the custom module. and i am facing this error

Field `custfield` does not exist

can you please guide me what i am doing wrong

here is my models directory codes

models\__init__.py  code

import custfield

models\custfield.py

from .import models, fields

class custfieldInherited(models.Model):

_inherit = 'fleet.vehicle'

custfield = fields.Char(string='Custom Field')


many thanks in advance.




아바타
취소

Hi, There is init file outside the models folder, check whether model is called in that init file

작성자

Hi Niyas Raphy

init file outside the models folder have following code

import models

Please guide further what i am doing wrong.

베스트 답변

Upgrade the module

아바타
취소
작성자

how? can you guide please.

Add -u all to the command used to run the project

베스트 답변

Try this :

change the line 'from .import models, fields' to

>> from odoo import  fields, models

Always Restart the server if you made a database change


아바타
취소
작성자

thanks for the response. i have tried changing the code as you suggest but still there is no field added in the fleet.vehicle model. please note that i am working on windows. i have tried restarting services of odoo as well as operating system.

작성자 베스트 답변

Hi Niyas Raphy

init file outside the models folder have following code

import models

Please guide further what i am doing wrong. 

@ Daniel John

Thanks for the reply. fleet module is already installed. In the manifest file it is also mentioned in the depends area that this custom module depends on the fleet module.


아바타
취소
베스트 답변

You need to install Fleet module first

아바타
취소
관련 게시물 답글 화면 활동
2
4월 17
10148
4
10월 20
8811
3
2월 24
10258
1
11월 23
2715
1
6월 23
3482