diff --git a/account_cost_center/models/account_invoice.py b/account_cost_center/models/account_invoice.py index fa86d4d25..770ad79ff 100644 --- a/account_cost_center/models/account_invoice.py +++ b/account_cost_center/models/account_invoice.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2018 Onestein () +# Copyright 2015-2019 Onestein () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models @@ -11,7 +11,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