Ensure client account columns before upgrade fetch
This commit is contained in:
parent
c05c521e5a
commit
e9df75ab1d
@ -67,6 +67,26 @@ class ResPartner(models.Model):
|
||||
"project.project", "partner_id", string="MCS Workstreams"
|
||||
)
|
||||
|
||||
def init(self):
|
||||
columns = {
|
||||
"mcs_is_client_account": "boolean",
|
||||
"mcs_account_status": "varchar",
|
||||
"mcs_account_health": "varchar",
|
||||
"mcs_currency_id": "integer",
|
||||
"mcs_monthly_revenue": "numeric",
|
||||
"mcs_contracted_value": "numeric",
|
||||
"mcs_monthly_hours": "double precision",
|
||||
"mcs_effective_hourly_revenue": "numeric",
|
||||
"mcs_account_owner_id": "integer",
|
||||
"mcs_next_account_action": "varchar",
|
||||
"mcs_account_risk_reason": "text",
|
||||
}
|
||||
for column, column_type in columns.items():
|
||||
self.env.cr.execute(
|
||||
'ALTER TABLE res_partner ADD COLUMN IF NOT EXISTS "%s" %s'
|
||||
% (column, column_type)
|
||||
)
|
||||
|
||||
@api.depends(
|
||||
"mcs_project_ids.mcs_monthly_revenue_target",
|
||||
"mcs_project_ids.mcs_contracted_revenue",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user