diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index efb24e7f..c6242d36 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -22,6 +22,7 @@ import werkzeug from markupsafe import Markup from odoo import api, fields, models, tools, Command +from odoo.addons.base.controllers.rpc import OdooMarshaller from odoo.exceptions import AccessError, UserError from odoo.osv import expression from odoo.tools import html_escape, Reverse, mute_logger @@ -34,6 +35,10 @@ _logger = logging.getLogger(__name__) FOOTER = '\nMore info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port\n' +Status = collections.namedtuple('Status', 'repository context state url') +OdooMarshaller.dispatch[Status] = OdooMarshaller.dump_array + + class StatusConfiguration(models.Model): _name = 'runbot_merge.repository.status' _description = "required statuses on repositories" @@ -2171,7 +2176,7 @@ class Stagings(models.Model): commits = st.head_ids.with_prefetch(all_heads._prefetch_ids) st.statuses = [ - ( + Status( heads[commit].name, context, status.get('state') or 'pending',