Replacement of hard coded field exclusion list in account_invoice (issue1833).

This commit is contained in:
Robin Baumgartner
2011-02-06 20:42:42 +01:00
parent 3414337a6e
commit d6fe80fdc2
+3 -2
View File
@@ -119,6 +119,8 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView):
def __init__(self):
super(Invoice, self).__init__()
self._check_modify_exclude = ['state', 'payment_lines',
'invoice_report', 'invoice_report_format']
self._rpc.update({
'button_draft': True,
})
@@ -869,8 +871,7 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView):
if isinstance(ids, (int, long)):
ids = [ids]
keys = vals.keys()
for key in ('state', 'payment_lines',
'invoice_report', 'invoice_report_format'):
for key in self._check_modify_exclude:
if key in keys:
keys.remove(key)
if len(keys):