mirror of
https://github.com/odoo/runbot.git
synced 2025-03-17 00:15:47 +07:00

As the odds of having more projects or more repos with different requirements in the same project, the need to have different sets of reviewers for different repositories increases. As a result, rather than be trivial boolean flags the review info should probably depend on the user / partner and the repo. Turns out the permission checks had already been extracted into their own function so most of the mess comes from testing utilities which went and configured their review rights as needed. Incidentally it might be that the test suite could just use something like a sequence of commoditized accounts which get configured as needed and not even looked at unless they're used.
17 lines
569 B
Python
17 lines
569 B
Python
def migrate(cr, version):
|
|
cr.execute("""
|
|
create table res_partner_review (
|
|
id serial primary key,
|
|
partner_id integer not null references res_partner (id),
|
|
repository_id integer not null references runbot_merge_repository (id),
|
|
review bool,
|
|
self_review bool
|
|
)
|
|
""")
|
|
cr.execute("""
|
|
insert into res_partner_review (partner_id, repository_id, review, self_review)
|
|
select p.id, r.id, reviewer, self_reviewer
|
|
from res_partner p, runbot_merge_repository r
|
|
where p.reviewer or p.self_reviewer
|
|
""")
|