mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] delivery_partner_dhl: migrate to odoo 14.0
This commit is contained in:
committed by
Leo Pinedo
parent
1587b5a056
commit
a45fac68dc
@@ -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',
|
||||
|
||||
@@ -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.')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user