[IMP] Add superuser to running attachment queue

pull/2560/head
KevinKhao 2021-07-23 00:52:35 +02:00 committed by Florian da Costa
parent 1f4c38cbf7
commit b2a2e11641
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import logging
from odoo import api, fields, models, registry
from odoo import SUPERUSER_ID, api, fields, models, registry
_logger = logging.getLogger(__name__)
@ -72,7 +72,7 @@ class AttachmentQueue(models.Model):
for attachment in self:
with api.Environment.manage():
with registry(self.env.cr.dbname).cursor() as new_cr:
new_env = api.Environment(new_cr, self.env.uid, self.env.context)
new_env = api.Environment(new_cr, SUPERUSER_ID, self.env.context)
attach = attachment.with_env(new_env)
try:
attach._run()