For example, I have a custom module:
class CustomModule(models.Model):
_name = 'custom module'
custom_char = fields.Char(string="Custom Char")
product_tmpl_id = fields.Many2one('product.template', string="Product Template", required=True )
product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string="Extra Product Media")
My view for the product_template_image_ids field in my custom module:
field name="product_template_image_ids" mode="kanban" context="{'default_product_tmpl_id': product_tmpl_id}"
File "C:\Odoo\odoo\models.py", line 5250, in _update_cache raise ValueError("Invalid field %r on model %r" % (e.args[0], self._name)) ValueError: Invalid field 'custom_char' on model 'product.template'
It looks like it wants to inherit the fields from my custom model, not take the value from the context.
Is there any solution?
you may forget add dependency in manifest
Probably not. This is what it looks like:
'depends': ['product', 'website_sale']