Improve readonly states for currency

Set readonly only if there is a currency set
This commit is contained in:
Cédric Krier committed 2008-09-18 12:23:50 +02:00
1 parent 4e519ae197
commit f3d641cb3c
1 file changed
+1 -1
+1 -1
View File
@@ -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'])