From 93e875ed20576e9f6b98b00e5b981d4c1a66c14e Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Fri, 4 Jul 2014 13:51:14 +0200 Subject: [PATCH] [FIX] make the 'rebuild' functionality work if it is a skipped build, it will be put back in pending state, with a high sequence number. if it is a complete build, it will be duplicated --- runbot/runbot.py | 6 +++--- runbot/runbot.xml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 243c1185..2fb18125 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -388,7 +388,7 @@ class runbot_branch(osv.osv): class runbot_build(osv.osv): _name = "runbot.build" - _order = 'sequence desc' + _order = 'id desc' def _get_dest(self, cr, uid, ids, field_name, arg, context=None): r = {} @@ -705,8 +705,8 @@ class runbot_build(osv.osv): for build in self.browse(cr, uid, ids, context=context): max_id = self.search(cr, uid, [('repo_id','=',build.repo_id.id)], order='id desc', limit=1)[0] # Force it now - if build.state in ['pending']: - build.write({ 'sequence':max_id }) + if build.state == 'done' and build.result == 'skipped': + build.write({'state': 'pending', 'sequence':max_id, 'result': '' }) # or duplicate it elif build.state in ['running','done']: d = { diff --git a/runbot/runbot.xml b/runbot/runbot.xml index 555cd54c..a0f67ceb 100644 --- a/runbot/runbot.xml +++ b/runbot/runbot.xml @@ -222,8 +222,8 @@