mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Add delivery_partner, delivery_partner_dhl, delivery_partner_fedex, delivery_partner_ups
This commit is contained in:
1
delivery_partner_fedex/__init__.py
Normal file
1
delivery_partner_fedex/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
18
delivery_partner_fedex/__manifest__.py
Executable file
18
delivery_partner_fedex/__manifest__.py
Executable file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
'name': 'Fedex Partner Shipping Accounts',
|
||||
'author': 'Hibou Corp. <hello@hibou.io>',
|
||||
'version': '11.0.1.0.0',
|
||||
'category': 'Stock',
|
||||
'sequence': 95,
|
||||
'summary': 'Fedex Partner Shipping Accounts',
|
||||
'description': """
|
||||
""",
|
||||
'website': 'https://hibou.io/',
|
||||
'depends': [
|
||||
'delivery_partner',
|
||||
],
|
||||
'data': [
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
}
|
||||
1
delivery_partner_fedex/models/__init__.py
Normal file
1
delivery_partner_fedex/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import delivery
|
||||
17
delivery_partner_fedex/models/delivery.py
Normal file
17
delivery_partner_fedex/models/delivery.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import re
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class PartnerShippingAccount(models.Model):
|
||||
_inherit = 'partner.shipping.account'
|
||||
|
||||
delivery_type = fields.Selection(selection_add=[('fedex', 'FedEx')])
|
||||
|
||||
def fedex_check_validity(self):
|
||||
m = re.search('^\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