mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[ADD] delivery_partner_purolator: add for 15.0
This commit is contained in:
22
delivery_partner_purolator/README.rst
Normal file
22
delivery_partner_purolator/README.rst
Normal 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
|
||||||
1
delivery_partner_purolator/__init__.py
Normal file
1
delivery_partner_purolator/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
17
delivery_partner_purolator/__manifest__.py
Executable file
17
delivery_partner_purolator/__manifest__.py
Executable 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,
|
||||||
|
}
|
||||||
1
delivery_partner_purolator/models/__init__.py
Normal file
1
delivery_partner_purolator/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import delivery
|
||||||
7
delivery_partner_purolator/models/delivery.py
Normal file
7
delivery_partner_purolator/models/delivery.py
Normal 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'})
|
||||||
1
delivery_partner_purolator/tests/__init__.py
Normal file
1
delivery_partner_purolator/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import test_purolator_account
|
||||||
20
delivery_partner_purolator/tests/test_purolator_account.py
Normal file
20
delivery_partner_purolator/tests/test_purolator_account.py
Normal 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'
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user