[FIX] runbot_merge: Odoo 15.0 + Py3.10 compat

Turns out I was running "15.0" except just on the runbot, enterprise
and community were still the 14.0 repos, so some of the changes were
missing.

While at it, bundle fixes for 3.10, as that's what Jammy needs, and
the mergebot/15.0 will be running on that.
This commit is contained in:
Xavier Morel 2022-11-17 10:30:04 +01:00
parent 2ca7a3de6e
commit 57162547e0
5 changed files with 11 additions and 16 deletions

View File

@ -1075,7 +1075,7 @@ class Environment:
for xid in crons:
t0 = time.time()
print('\trunning cron', xid, '...', file=sys.stderr)
_, model, cron_id = self('ir.model.data', 'xmlid_lookup', xid)
model, cron_id = self('ir.model.data', 'check_object_reference', *xid.split('.', 1))
assert model == 'ir.cron', "Expected {} to be a cron, got {}".format(xid, model)
self('ir.cron', 'method_direct_trigger', [cron_id], **kw)
print('\tdone %.3fs' % (time.time() - t0), file=sys.stderr)

View File

@ -15,6 +15,14 @@
'views/templates.xml',
'models/project_freeze/views.xml',
],
'assets': {
'web.assets_frontend': [
'runbot_merge/static/scss/runbot_merge.scss',
],
'web.assets_backend': [
'runbot_merge/static/project_freeze/index.js',
],
},
'post_load': 'enable_sentry',
'pre_init_hook': '_check_citext',
'license': 'LGPL-3',

View File

@ -1,4 +1,4 @@
import collections
import collections.abc
import itertools
import json as json_
import logging
@ -8,7 +8,6 @@ import pathlib
import pprint
import textwrap
import unicodedata
from datetime import datetime, timezone
import requests
import werkzeug.urls
@ -114,7 +113,7 @@ class GH(object):
)
self._log_gh(_gh, method, path, params, json, r)
if check:
if isinstance(check, collections.Mapping):
if isinstance(check, collections.abc.Mapping):
exc = check.get(r.status_code)
if exc:
raise exc(r.text)

View File

@ -1,10 +1,4 @@
<odoo>
<template id="runbot_merge_freeze_assets" inherit_id="web.assets_backend" active="True">
<xpath expr="." position="inside">
<script type="text/javascript" src="/runbot_merge/static/project_freeze/index.js"></script>
</xpath>
</template>
<record id="runbot_merge_project_freeze_form" model="ir.ui.view">
<field name="name">Freeze Wizard Configuration Screen</field>
<field name="model">runbot_merge.project.freeze</field>

View File

@ -4,12 +4,6 @@
<value eval="{'active': False}"/>
</function>
<template id="assets_frontend" inherit_id="web.assets_frontend">
<xpath expr="link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/runbot_merge/static/scss/runbot_merge.scss"/>
</xpath>
</template>
<template id="link-pr" name="create a link to `pr`">
<t t-set="title">
<t t-if="pr.repository.group_id &lt;= env.user.groups_id">