Community mailing list archives
Re: ProgrammingError: can't adapt type 'NewId'by
Can you please try -
'models.NewId.id' and see if that resolves the issue.
Hi Peter,What happens, is that your onchangeQuantity() method is called with a pseudo recordset. This means that odoo creates an in-memory representation of your data, without it actually being stored in the database. This is because onchange can be called for records that the user is inputting in the form, but these are not yet saved. The user might actually change his mind, and click "discard" instead of saving his data in the database.With this pseudo recordset, you can modify recordset fields, and the updated fields will be updated in the UI, and will be saved on when the users saves his input. If i recall correctly, the onchange is also triggered on a write() to the model.You might want to call your bom_Calc() method from the write() method instead of from an onchange method, if this matches your requirements.Regards,Jos2016-02-29 7:07 GMT+01:00 Peter Mudoko <email@example.com>:
Guys this errors frustrating me: This is my code:
_name = 'mrp.bom'
_inherit = 'mrp.bom'
for rec in self:
if isinstance(self.id, models.NewId):
for record in bom_obj_ids:
bom_line = bom_obj.browse(record.id)
I have tried even commented part same error. ANY HELP PLEASE......
Nairobi:gate 256, Nairobi.
P.O.Box - 45855 -00100, Nairobi.
Mobile: +254 721449067