mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: adapt for 16.0
This commit is contained in:
parent
6107c0aefb
commit
ebb531f4a4
@ -15,7 +15,7 @@ from . import dockerfile
|
||||
from . import event
|
||||
from . import host
|
||||
from . import ir_cron
|
||||
from . import ir_ui_view
|
||||
from . import ir_qweb
|
||||
from . import project
|
||||
from . import repo
|
||||
from . import res_config_settings
|
||||
|
@ -991,6 +991,9 @@ class BuildResult(models.Model):
|
||||
child._ask_kill(lock=False)
|
||||
|
||||
def _wake_up(self):
|
||||
|
||||
user = request.env.user if request else self.env.user
|
||||
self._log('wake_up', f'Wake up initiated by {user.name}')
|
||||
if self.local_state != 'done':
|
||||
self._log('wake_up', 'Impossibe to wake up, state is not done')
|
||||
else:
|
||||
|
13
runbot/models/ir_qweb.py
Normal file
13
runbot/models/ir_qweb.py
Normal file
@ -0,0 +1,13 @@
|
||||
from ..common import s2human, s2human_long
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class IrQweb(models.AbstractModel):
|
||||
_inherit = ["ir.qweb"]
|
||||
|
||||
def _prepare_frontend_environment(self, values):
|
||||
response = super()._prepare_frontend_environment(values)
|
||||
values['s2human'] = s2human
|
||||
values['s2human_long'] = s2human_long
|
||||
return response
|
@ -1,15 +0,0 @@
|
||||
from ..common import s2human, s2human_long
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class IrUiView(models.Model):
|
||||
_inherit = ["ir.ui.view"]
|
||||
|
||||
def _prepare_qcontext(self):
|
||||
qcontext = super(IrUiView, self)._prepare_qcontext()
|
||||
|
||||
if request and getattr(request, 'is_frontend', False):
|
||||
qcontext['s2human'] = s2human
|
||||
qcontext['s2human_long'] = s2human_long
|
||||
return qcontext
|
Loading…
Reference in New Issue
Block a user