[FIX] Invoice cost center readonly if not draft

This commit is contained in:
Andrea
2019-05-22 13:14:34 +02:00
parent ab595fbc93
commit 336b1a8202

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2015-2018 Onestein (<http://www.onestein.eu>)
# Copyright 2015-2019 Onestein (<http://www.onestein.eu>)
# 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