[FIX] stock_*: use sudo log activity

Problem:
In some places I think it is necessary to use sudo to avoid permission
errors when creating actions or something else from a other model.

For example, I have a picking created from PO attached to MO. When
receiving inventory in a smaller quantity than actual quantity, will
create activity schedule on MO. But if you don't have the rights, you
will get an error

closes odoo/odoo#150697

X-original-commit: ac1862ddc2dec0269a156d5470b940a7d85cc078
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
Dang Van Loc
2024-01-24 10:44:44 +00:00
parent 69d292fa2e
commit bfbc959d18
+1 -1
View File
@@ -1365,7 +1365,7 @@ class Picking(models.Model):
"""
for (parent, responsible), rendering_context in documents.items():
note = render_method(rendering_context)
parent.activity_schedule(
parent.sudo().activity_schedule(
'mail.mail_activity_data_warning',
date.today(),
note=note,