mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] runbot_merge: add json & requests to server actions context
This commit is contained in:
parent
23e1b93465
commit
6e1fc61781
@ -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
|
||||
|
@ -1,3 +1,4 @@
|
||||
from . import ir_actions
|
||||
from . import res_partner
|
||||
from . import project
|
||||
from . import pull_requests
|
||||
|
12
runbot_merge/models/ir_actions.py
Normal file
12
runbot_merge/models/ir_actions.py
Normal 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
|
Loading…
Reference in New Issue
Block a user