[MIG] delivery_partner_dhl: migrate to odoo 14.0

This commit is contained in:
Leighton Pennicott
2020-11-09 09:38:10 -05:00
committed by Leo Pinedo
parent 1587b5a056
commit a45fac68dc
2 changed files with 4 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
{
'name': 'DHL 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': 'DHL Partner Shipping Accounts',

View File

@@ -6,12 +6,10 @@ from odoo.exceptions import ValidationError
class PartnerShippingAccount(models.Model):
_inherit = 'partner.shipping.account'
delivery_type = fields.Selection(selection_add=[('dhl', 'DHL')])
delivery_type = fields.Selection(selection_add=[('dhl', 'DHL')], ondelete={'dhl': 'set default'})
def dhl_check_validity(self):
m = re.search(r'^(\d{8}|\d{9}|\d{10})$', self.name or '')
if not m:
raise ValidationError('DHL Account numbers must be 8-10 decimal numbers.')