mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] delivery_partner_fedex: migrate to odoo 14.0
Added 'ondelete' option. It's now required when the selection_add parameter is used.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
'name': 'Fedex Partner Shipping Accounts',
|
||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||
'version': '13.0.1.0.0',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Stock',
|
||||
'sequence': 95,
|
||||
'summary': 'Fedex Partner Shipping Accounts',
|
||||
|
||||
@@ -6,12 +6,10 @@ from odoo.exceptions import ValidationError
|
||||
|
||||
class PartnerShippingAccount(models.Model):
|
||||
_inherit = 'partner.shipping.account'
|
||||
|
||||
delivery_type = fields.Selection(selection_add=[('fedex', 'FedEx')])
|
||||
|
||||
|
||||
delivery_type = fields.Selection(selection_add=[('fedex', 'FedEx')], ondelete={'fedex': 'set default'})
|
||||
|
||||
def fedex_check_validity(self):
|
||||
m = re.search(r'^\d{9}$', self.name or '')
|
||||
if not m:
|
||||
raise ValidationError('FedEx Account numbers must be 9 decimal numbers.')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user