mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] forwardport: fix sourcing on reparenting
When reparenting a commit (mostly when inserting a new forwardport in an existing chain after a freeze / branch insertion), the new source should be the source of the new parent (which is likely a not-change of the source). This was miscomputed to the root of the new parent, which often matches but breaks if there was a conflict or a mid-port update, leading to inconsistent presentation. Nothing critical, just somewhat annoying.
This commit is contained in:
parent
f44b0c018e
commit
134ce03053
@ -348,7 +348,8 @@ class PullRequests(models.Model):
|
|||||||
})
|
})
|
||||||
|
|
||||||
if vals.get('parent_id') and 'source_id' not in vals:
|
if vals.get('parent_id') and 'source_id' not in vals:
|
||||||
vals['source_id'] = self.browse(vals['parent_id']).root_id.id
|
parent = self.browse(vals['parent_id'])
|
||||||
|
vals['source_id'] = (parent.source_id or parent).id
|
||||||
if vals.get('state') == 'merged':
|
if vals.get('state') == 'merged':
|
||||||
vals['merge_date'] = fields.Datetime.now()
|
vals['merge_date'] = fields.Datetime.now()
|
||||||
r = super().write(vals)
|
r = super().write(vals)
|
||||||
|
Loading…
Reference in New Issue
Block a user