mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] forwardport: avoid a full scan when we just want a boolean
There should only be 1 PR with a given parent at most anyway, but still if it's a boolean we can stop at the first occurrence if any. pg might even be able to do something more efficient in that case.
This commit is contained in:
parent
981760430c
commit
12ac32e169
@ -248,7 +248,7 @@ class PullRequests(models.Model):
|
||||
vals['detach_reason'] = f"Head updated from {self.head} to {newhead}"
|
||||
# if any children, this is an FP PR being updated, enqueue
|
||||
# updating children
|
||||
if self.search_count([('parent_id', '=', self.id)]):
|
||||
if self.search_count([('parent_id', '=', self.id)], limit=1):
|
||||
self.env['forwardport.updates'].create({
|
||||
'original_root': self.root_id.id,
|
||||
'new_root': self.id
|
||||
|
Loading…
Reference in New Issue
Block a user