I'm using compute method to add records to the one2many field and it's working fine in form view but not in tree view. Can anyone help?
@api.depends("odoo_product_id")
def _compute_offers(self):
for rec in self:
if rec.odoo_product_id:
offers = self.env['demo.offers'].search
([('product_id','=',rec.odoo_product_id.id)])
for offer in offers:
rec.shop_offer_ids = rec.shop_offer_ids + offer
It's throwing Compute method failed to assign Error in tree view only