Browse Source

[IMP] use selection_add attribute instead of overriding the whole list

pull/11/head
houssine 5 years ago
parent
commit
2938e23a8a
  1. 6
      easy_my_coop_be/models/coop.py
  2. 8
      easy_my_coop_ch/models/coop.py
  3. 5
      easy_my_coop_fr/models/coop.py

6
easy_my_coop_be/models/coop.py

@ -5,7 +5,9 @@ from openerp import fields, models
class subscription_request(models.Model): class subscription_request(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([('scrl', 'SCRL'),
company_type = fields.Selection(selection_add=[
('scrl', 'SCRL'),
('asbl', 'ASBL'), ('asbl', 'ASBL'),
('sprl', 'SPRL'), ('sprl', 'SPRL'),
('sa', 'SA')])
('sa', 'SA')
])

8
easy_my_coop_ch/models/coop.py

@ -5,14 +5,16 @@ from openerp import fields, models
class subscription_request(models.Model): class subscription_request(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([('ei', 'Individual company'),
company_type = fields.Selection(selection_add=[
('ei', 'Individual company'),
('snc', 'Partnership'), ('snc', 'Partnership'),
('sa', 'Limited company (SA)'), ('sa', 'Limited company (SA)'),
('sarl', 'Limited liability company (Ltd)'), #noqa
('sarl', 'Limited liability company (Ltd)'),
('sc', 'Cooperative'), ('sc', 'Cooperative'),
('asso', 'Association'), ('asso', 'Association'),
('fond', 'Foundation'), ('fond', 'Foundation'),
('edp', 'Company under public law')])
('edp', 'Company under public law')
])
def get_required_field(self): def get_required_field(self):
req_fields = super(subscription_request, self).get_required_field() req_fields = super(subscription_request, self).get_required_field()

5
easy_my_coop_fr/models/coop.py

@ -5,11 +5,12 @@ from openerp import fields, models
class SubscriptionRequest(models.Model): class SubscriptionRequest(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([
company_type = fields.Selection(selection_add=[
('asso', 'Association'), ('asso', 'Association'),
('eurl', 'EURL / Entreprise individuelle'), ('eurl', 'EURL / Entreprise individuelle'),
('sarl', 'SARL'), ('sarl', 'SARL'),
('sa', 'SA / SAS')])
('sa', 'SA / SAS')
])
def get_required_field(self): def get_required_field(self):
req_fields = super(SubscriptionRequest, self).get_required_field() req_fields = super(SubscriptionRequest, self).get_required_field()

Loading…
Cancel
Save