Skip to Content
Menu
This question has been flagged
1482 Views

Hi,


I need help with the following situation.


I update a carrier by setting 'website_published' = False.

If I search for all carriers with 'website_published' = True, my updated one is also in the result set.


My code:

carrier = self.env['delivery.carrier'].search([('name', 'ilike', 'Free delivery charges')])

if carrier:
carrier.update({'is_published': False, 'website_published': False})

test = self.env['delivery.carrier'].sudo().search([('website_published', '=', True)])
for t in test:
print(t.id, t.name, t.website_published)

The print returns:

1 Free delivery charges False

7 Test DE True

8 TEST USA True


What's wrong here?


Thanks for your help!

Avatar
Discard