From 2938e23a8a37284f746b88619b58a21f58499ac9 Mon Sep 17 00:00:00 2001 From: houssine Date: Fri, 2 Aug 2019 20:05:07 +0200 Subject: [PATCH] [IMP] use selection_add attribute instead of overriding the whole list --- easy_my_coop_be/models/coop.py | 10 ++++++---- easy_my_coop_ch/models/coop.py | 18 ++++++++++-------- easy_my_coop_fr/models/coop.py | 5 +++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/easy_my_coop_be/models/coop.py b/easy_my_coop_be/models/coop.py index c490fda..0f4afd1 100644 --- a/easy_my_coop_be/models/coop.py +++ b/easy_my_coop_be/models/coop.py @@ -5,7 +5,9 @@ from openerp import fields, models class subscription_request(models.Model): _inherit = 'subscription.request' - company_type = fields.Selection([('scrl', 'SCRL'), - ('asbl', 'ASBL'), - ('sprl', 'SPRL'), - ('sa', 'SA')]) + company_type = fields.Selection(selection_add=[ + ('scrl', 'SCRL'), + ('asbl', 'ASBL'), + ('sprl', 'SPRL'), + ('sa', 'SA') + ]) diff --git a/easy_my_coop_ch/models/coop.py b/easy_my_coop_ch/models/coop.py index 0a2e104..4b91e98 100644 --- a/easy_my_coop_ch/models/coop.py +++ b/easy_my_coop_ch/models/coop.py @@ -5,14 +5,16 @@ from openerp import fields, models class subscription_request(models.Model): _inherit = 'subscription.request' - company_type = fields.Selection([('ei', 'Individual company'), - ('snc', 'Partnership'), - ('sa', 'Limited company (SA)'), - ('sarl', 'Limited liability company (Ltd)'), #noqa - ('sc', 'Cooperative'), - ('asso', 'Association'), - ('fond', 'Foundation'), - ('edp', 'Company under public law')]) + company_type = fields.Selection(selection_add=[ + ('ei', 'Individual company'), + ('snc', 'Partnership'), + ('sa', 'Limited company (SA)'), + ('sarl', 'Limited liability company (Ltd)'), + ('sc', 'Cooperative'), + ('asso', 'Association'), + ('fond', 'Foundation'), + ('edp', 'Company under public law') + ]) def get_required_field(self): req_fields = super(subscription_request, self).get_required_field() diff --git a/easy_my_coop_fr/models/coop.py b/easy_my_coop_fr/models/coop.py index 58879e3..bfbd32b 100644 --- a/easy_my_coop_fr/models/coop.py +++ b/easy_my_coop_fr/models/coop.py @@ -5,11 +5,12 @@ from openerp import fields, models class SubscriptionRequest(models.Model): _inherit = 'subscription.request' - company_type = fields.Selection([ + company_type = fields.Selection(selection_add=[ ('asso', 'Association'), ('eurl', 'EURL / Entreprise individuelle'), ('sarl', 'SARL'), - ('sa', 'SA / SAS')]) + ('sa', 'SA / SAS') + ]) def get_required_field(self): req_fields = super(SubscriptionRequest, self).get_required_field()