From f3d641cb3c13cf0b6fa24cfe04ab8d1d0ce0b575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Sep 2008 12:23:50 +0200 Subject: [PATCH] Improve readonly states for currency Set readonly only if there is a currency set --- invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index eb9ec45d37..db850eebe5 100644 --- a/invoice.py +++ b/invoice.py @@ -258,7 +258,7 @@ class Invoice(OSV): required=True, states=_STATES, domain="[('party', '=', party)]") currency = fields.Many2One('currency.currency', 'Currency', required=True, states={ - 'readonly': "state != 'draft' or bool(lines)", + 'readonly': "state != 'draft' or (bool(lines) and bool(currency))", }) currency_digits = fields.Function('get_currency_digits', type='integer', string='Currency Digits', on_change_with=['currency'])