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

I have a custom module in which i want to import some of the updated data but getting an error

Unknown error during import: : 'field1' at row 2 Resolve other errors first

I am getting this error in some of the fields not all.


Below are the type and description and parameters of the field in which i am getting this error:-


field1 = fields.Many2one(comodel_name="ab", string="Field1", required=False, )
field2 = fields.Many2one(comodel_name="bc", string="Field2", required=False, )
field3 = fields.Char('Field3', size=30, required=True)
field4 = fields.Char('Field4', size=30)
field5 = fields.Char('Field5', size=30, required=True)
After including these fields in export and import resolves this issue but if i remove any of the fields in export and import of data gives this issue again. Why is this happening?
Is this error related to migration or something else i am missing? Do anyone have any idea how to solve this issue?


Avatar
Abbandona
Risposta migliore

As per you code you have only two required fields field3 and field5 so these fields need to be included in the import file. 

Did you change the module code lately by setting required to False and not upgrade the module?

 You can enable developer mode and go to settings -> Technical -> Fields and search for fields you got them in your error and see if the required is checked. If its checked and in your code set to False, thats mean your module is not upgraded and you need to upgrade it.

Avatar
Abbandona
Autore

Hello Waleed, Thanks for the prompt response. My module is already upgraded and also as per your suggestion, I have checked those fields in which i am getting error while importing but they are not required.

Post correlati Risposte Visualizzazioni Attività
1
mag 21
8378
1
mag 23
1961
0
ago 21
2652
1
mag 24
3133
5
nov 23
2978