Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
7 Risposte
9675 Visualizzazioni

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.




Avatar
Abbandona

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

Autore

Hi Niyas Raphy

init file outside the models folder have following code

import models

Please guide further what i am doing wrong.

Risposta migliore

Upgrade the module

Avatar
Abbandona
Autore

how? can you guide please.

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

Risposta migliore

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


Avatar
Abbandona
Autore

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.

Autore Risposta migliore

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.


Avatar
Abbandona
Risposta migliore

You need to install Fleet module first

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
apr 17
10092
4
ott 20
8699
3
feb 24
10176
1
nov 23
2653
1
giu 23
3446