mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: reduce serialization failures (TransactionRollbackError)
Both the cron and the tests themselves need to write to the builds, which triggers the update of the `repo_id` field, as it is a stored related.
This commit is contained in:
parent
431a3f6d5b
commit
be34ac72c9
@ -512,7 +512,18 @@ class runbot_build(osv.osv):
|
|||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'branch_id': fields.many2one('runbot.branch', 'Branch', required=True, ondelete='cascade', select=1),
|
'branch_id': fields.many2one('runbot.branch', 'Branch', required=True, ondelete='cascade', select=1),
|
||||||
'repo_id': fields.related('branch_id', 'repo_id', type="many2one", relation="runbot.repo", string="Repository", readonly=True, store=True, ondelete='cascade', select=1),
|
'repo_id': fields.related(
|
||||||
|
'branch_id', 'repo_id', type="many2one", relation="runbot.repo",
|
||||||
|
string="Repository", readonly=True, ondelete='cascade', select=1,
|
||||||
|
store={
|
||||||
|
'runbot.build': (lambda s, c, u, ids, ctx: ids, ['branch_id'], 20),
|
||||||
|
'runbot.branch': (
|
||||||
|
lambda self, cr, uid, ids, ctx: self.pool['runbot.build'].search(
|
||||||
|
cr, uid, [('branch_id', 'in', ids)]),
|
||||||
|
['repo_id'],
|
||||||
|
10,
|
||||||
|
),
|
||||||
|
}),
|
||||||
'name': fields.char('Revno', required=True, select=1),
|
'name': fields.char('Revno', required=True, select=1),
|
||||||
'host': fields.char('Host'),
|
'host': fields.char('Host'),
|
||||||
'port': fields.integer('Port'),
|
'port': fields.integer('Port'),
|
||||||
|
Loading…
Reference in New Issue
Block a user