diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index a0a0874367d..b987bce5386 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -174,10 +174,10 @@ class Lead2OpportunityMassConvert(models.TransientModel): user_ids = fields.Many2many('res.users', string='Salesmen') team_id = fields.Many2one('crm.team', 'Sales Team', index=True) deduplicate = fields.Boolean('Apply deduplication', default=True, help='Merge with existing leads/opportunities of each partner') - action = fields.Selection([ + action = fields.Selection(selection_add=[ ('each_exist_or_create', 'Use existing partner or create'), ('nothing', 'Do not link to a customer') - ], 'Related Customer', required=True) + ], string='Related Customer', required=True) force_assignation = fields.Boolean('Force assignation', help='If unchecked, this will leave the salesman of duplicated opportunities') @api.onchange('action') diff --git a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py index 3f932838183..01ffed669d3 100644 --- a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py +++ b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py @@ -14,12 +14,9 @@ class PaymentWizard(models.TransientModel): def _get_default_payment_method(self): return self.env.company.sale_onboarding_payment_method or 'digital_signature' - payment_method = fields.Selection([ + payment_method = fields.Selection(selection_add=[ ('digital_signature', 'Online signature'), - ('paypal', "Pay with PayPal"), - ('stripe', "Pay with credit card (via Stripe)"), - ('other', "Pay with another payment acquirer"), - ('manual', "Custom payment instructions"), + ('paypal',), ], default=_get_default_payment_method) # diff --git a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py index 6a4dabb151b..5bb95af10b7 100644 --- a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py +++ b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py @@ -24,10 +24,7 @@ class Opportunity2Quotation(models.TransientModel): result['lead_id'] = active_id return result - action = fields.Selection([ - ('create', 'Create a new customer'), - ('exist', 'Use an existing customer') - ], 'Quotation Customer', required=True) + action = fields.Selection(string='Quotation Customer') lead_id = fields.Many2one('crm.lead', "Associated Lead", required=True) def action_apply(self): diff --git a/odoo/fields.py b/odoo/fields.py index 44cbc97d9d4..3a6824433cc 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -2048,6 +2048,11 @@ class Selection(Field): if 'selection' in field.args: selection = field.args['selection'] if isinstance(selection, list): + if ( + values is not None + and values != [kv[0] for kv in selection] + ): + _logger.warning("%s: selection=%r overrides existing selection; use selection_add instead", self, selection) values = [kv[0] for kv in selection] labels.update(selection) else: @@ -2055,8 +2060,10 @@ class Selection(Field): if 'selection_add' in field.args: selection_add = field.args['selection_add'] - assert isinstance(selection_add, list) - assert values is not None + assert isinstance(selection_add, list), \ + "%s: selection_add=%r must be a list" % (self, selection_add) + assert values is not None, \ + "%s: selection_add=%r on non-list selection %r" % (self, selection_add, self.selection) values = merge_sequences(values, [kv[0] for kv in selection_add]) labels.update(kv for kv in selection_add if len(kv) == 2)