Help

0

Getting error "Unknown error during import: <class Keyerror> : 'Field1' at row 2 resolve other errors first" in odoo 14

Avatar
Gautam

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
Discard
1Answer
0
Avatar
Waleed Mohsen
Best Answer

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.

1Comment
Avatar
Discard
Avatar
Gautam
-

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.