[ADD] delivery_partner_purolator: add for 15.0

This commit is contained in:
Jared Kipe
2022-09-19 23:16:06 +00:00
parent 8e7f7ef04b
commit 4ed68bbf7f
7 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
*******************************************
Hibou - Purolator Partner Shipping Accounts
*******************************************
Adds Purolator shipping accounts.
For more information and add-ons, visit `Hibou.io <https://hibou.io/>`_.
=============
Main Features
=============
* Adds Purolator to the delivery type selection field.
=======
License
=======
Please see `LICENSE <https://github.com/hibou-io/hibou-odoo-suite/blob/15.0/LICENSE>`_.
Copyright Hibou Corp. 2022

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,17 @@
{
'name': 'Purolator Partner Shipping Accounts',
'author': 'Hibou Corp. <hello@hibou.io>',
'version': '15.0.1.0.0',
'license': 'LGPL-3',
'category': 'Stock',
'sequence': 95,
'summary': 'Purolator Partner Shipping Accounts',
'website': 'https://hibou.io/',
'depends': [
'delivery_partner',
],
'data': [
],
'installable': True,
'application': False,
}

View File

@@ -0,0 +1 @@
from . import delivery

View File

@@ -0,0 +1,7 @@
from odoo import fields, models
class PartnerShippingAccount(models.Model):
_inherit = 'partner.shipping.account'
delivery_type = fields.Selection(selection_add=[('purolator', 'Purolator')], ondelete={'purolator': 'set default'})

View File

@@ -0,0 +1 @@
from . import test_purolator_account

View File

@@ -0,0 +1,20 @@
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestAccount(TransactionCase):
def setUp(self):
super(TestAccount, self).setUp()
self.PartnerShippingAccount = self.env['partner.shipping.account']
self.partner = self.env.ref('base.res_partner_12')
def test_purolator_account_information(self):
# Create object and confirm that validation error raises if fedex account is blank or not 8 digits
_ = self.PartnerShippingAccount.create({
'name': '123456789',
'description': 'Test Account',
'partner_id': self.partner.id,
'delivery_type': 'purolator',
'note': 'This is a note'
})