From 155d69e807d15668c41a3bb7502f39ebd52f048d Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 22 May 2019 12:24:54 +0200 Subject: [PATCH] [FIX] Invoice cost center readonly if not draft --- account_cost_center/models/account_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_cost_center/models/account_invoice.py b/account_cost_center/models/account_invoice.py index e00f23913..ceb410f16 100644 --- a/account_cost_center/models/account_invoice.py +++ b/account_cost_center/models/account_invoice.py @@ -10,7 +10,9 @@ class AccountInvoice(models.Model): cost_center_id = fields.Many2one( 'account.cost.center', string='Cost Center', - help='Default Cost Center' + readonly=True, + states={'draft': [('readonly', False)]}, + help='Default Cost Center', ) @api.model