[IMP] runbot_merge: add json & requests to server actions context

This commit is contained in:
Xavier Morel 2023-02-20 10:13:05 +01:00
parent 23e1b93465
commit 6e1fc61781
3 changed files with 14 additions and 1 deletions

View File

@ -721,7 +721,7 @@ class Repo:
s = self._get_session(token)
r = s.post('https://api.github.com/repos/{}/forks'.format(self.name))
assert 200 <= r.status_code < 300, r.json()
assert 200 <= r.status_code < 300, r.text
repo_name = r.json()['full_name']
repo_url = 'https://api.github.com/repos/' + repo_name

View File

@ -1,3 +1,4 @@
from . import ir_actions
from . import res_partner
from . import project
from . import pull_requests

View File

@ -0,0 +1,12 @@
import requests
import json
from odoo import models
class ExtendedServerActionContext(models.Model):
_inherit = 'ir.actions.server'
def _get_eval_context(self, action=None):
ctx = super()._get_eval_context(action=action)
ctx.update(requests=requests.Session(), loads=json.loads, dumps=json.dumps)
return ctx