mirror of
https://github.com/odoo/runbot.git
synced 2025-03-25 20:35:52 +07:00

Setting the PR state directly really doesn't work as it doesn't correctly save (and can get overwritten by any dependency of which there are many). This caused setting odoo/odoo#165777 in error to fail, leading to it being re-staged (and failing) repeatedly, and the PR being spammed with comments. - create a more formal helper for preventing directly setting computed functions (without an actual inverse) - replace direct state setting by setting the corresponding dependency e.g. `error` for error and `skipchecks` to force a PR to ready - add a `skipchecks` inverse to the PR so it can also set itself as reviewed, and is convenient, might be worth also adding stuff to `Batch.write`
11 lines
206 B
Python
11 lines
206 B
Python
from typing import Tuple
|
|
|
|
|
|
def enum(model: str, field: str) -> Tuple[str, str]:
|
|
n = f'{model.replace(".", "_")}_{field}_type'
|
|
return n, n
|
|
|
|
|
|
def readonly(_):
|
|
raise TypeError("Field is readonly")
|