From d6fe80fdc2e4d6b81a58ea64a71ba4e27ebb1399 Mon Sep 17 00:00:00 2001 From: Robin Baumgartner Date: Sun, 6 Feb 2011 20:42:42 +0100 Subject: [PATCH] Replacement of hard coded field exclusion list in account_invoice (issue1833). --- invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invoice.py b/invoice.py index 1554d6ed90..92820e9b3a 100644 --- a/invoice.py +++ b/invoice.py @@ -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):