From 9b997e42e8de3f1ab240a284335763526c6fc17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 14 Dec 2014 14:51:28 +0100 Subject: [PATCH 1/2] [IMP] sepa: make it easier to extend structured communication types --- account_banking_pain_base/models/payment_line.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 0598710e1..8e2cb5ec4 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -42,7 +42,9 @@ class PaymentLine(orm.Model): "company. Depicts 'What do you want to say to the recipient " "about this order ?'"), 'struct_communication_type': fields.selection( - _get_struct_communication_types, 'Structured Communication Type'), + lambda self, *args, **kwargs: + self._get_struct_communication_types(*args, **kwargs), + 'Structured Communication Type'), } _defaults = { From a4e50d008e58d8b938781e334f522a665a7b739a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 14 Dec 2014 19:44:50 +0100 Subject: [PATCH 2/2] [IMP] use new style to make selection extendable --- account_banking_pain_base/models/payment_line.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account_banking_pain_base/models/payment_line.py b/account_banking_pain_base/models/payment_line.py index 8e2cb5ec4..872827b7b 100644 --- a/account_banking_pain_base/models/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -42,8 +42,7 @@ class PaymentLine(orm.Model): "company. Depicts 'What do you want to say to the recipient " "about this order ?'"), 'struct_communication_type': fields.selection( - lambda self, *args, **kwargs: - self._get_struct_communication_types(*args, **kwargs), + '_get_struct_communication_types', 'Structured Communication Type'), }