Community mailing list archives

community@mail.odoo.com

cache gone with sudo()

by
Andre Kurniawan
- 05/18/2016 03:19:52

Hello Community,

I have a case when I use .sudo() on compute method (with @api.depends), any related fields doesn’t have any record on it.

For example:

@api.depends("field")
def compute_method(self):
    for record in self:
        print record.relation_id
        print record.sudo().relation_id

resulting:

model.name(1,)
model.name()

This is happened when I change field value on client side (browser). Why sudo() cleared the cache?

-- 
Regards,
Andre