diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000000..bb79f9c71c
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,18 @@
+# Config file .coveragerc
+# adapt the include for your project
+
+[report]
+include =
+ */carrier-delivery/*
+
+omit =
+ */tests/*
+ *__init__.py
+
+# Regexes for lines to exclude from consideration
+exclude_lines =
+ # Have to re-enable the standard pragma
+ pragma: no cover
+
+ # Don't complain about null context checking
+ if context is None:
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..1f092e4082
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+language: python
+
+python:
+ - "2.7"
+
+env:
+ - VERSION="8.0" ODOO_REPO="odoo/odoo"
+ - VERSION="8.0" ODOO_REPO="OCA/OCB"
+
+virtualenv:
+ system_site_packages: true
+
+install:
+ - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
+ - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
+ - travis_install_nightly ${VERSION}
+
+script:
+ - travis_run_flake8
+ - travis_run_tests ${VERSION}
+
+after_success:
+ coveralls
diff --git a/README.md b/README.md
index 11acb1654b..aabf2082b3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-[![Build Status](https://travis-ci.org/OCA/carrier-delivery.svg?branch=master)](https://travis-ci.org/OCA/carrier-delivery)
-[![Coverage Status](https://coveralls.io/repos/OCA/carrier-delivery/badge.png?branch=master)](https://coveralls.io/r/OCA/carrier-delivery?branch=master)
+[![Build Status](https://travis-ci.org/OCA/carrier-delivery.svg?branch=8.0)](https://travis-ci.org/OCA/carrier-delivery)
+[![Coverage Status](https://coveralls.io/repos/OCA/carrier-delivery/badge.png?branch=8.0)](https://coveralls.io/r/OCA/carrier-delivery?branch=8.0)
Carriers And Deliveries Management
==================================
diff --git a/__unported__/base_delivery_carrier_files/carrier_file.py b/__unported__/base_delivery_carrier_files/carrier_file.py
index 727971cb4e..34784ef5f9 100644
--- a/__unported__/base_delivery_carrier_files/carrier_file.py
+++ b/__unported__/base_delivery_carrier_files/carrier_file.py
@@ -122,7 +122,7 @@ def _generate_files(self, cr, uid, carrier_file, picking_ids,
picking_obj.write(cr, uid, picking_ids,
{'carrier_file_generated': True},
context=context)
- except Exception, e:
+ except Exception as e:
log.exception("Could not create the picking file "
"for pickings %s: %s",
picking_ids, e)
diff --git a/__unported__/base_delivery_carrier_label/stock.py b/__unported__/base_delivery_carrier_label/stock.py
index 0494c80f33..0f6311b77a 100644
--- a/__unported__/base_delivery_carrier_label/stock.py
+++ b/__unported__/base_delivery_carrier_label/stock.py
@@ -65,8 +65,9 @@ def generate_default_label(self, cr, uid, ids, tracking_ids=None,
"""
raise orm.except_orm(
- 'Error',
- 'No label is configured for selected delivery method.')
+ 'Error',
+ 'No label is configured for selected delivery method.'
+ )
def generate_shipping_labels(self, cr, uid, ids, tracking_ids=None,
context=None):
@@ -183,7 +184,7 @@ def option_ids_change(self, cr, uid, ids, option_ids, carrier_id, context=None):
carrier = carrier_obj.browse(cr, uid, carrier_id, context=context)
for available_option in carrier.available_option_ids:
if (available_option.state == 'mandatory'
- and not available_option.id in option_ids[0][2]):
+ and available_option.id not in option_ids[0][2]):
res['warning'] = {
'title': _('User Error !'),
'message': _("You can not remove a mandatory option."
@@ -228,8 +229,7 @@ def create(self, cr, uid, values, context=None):
"""
values = self._values_with_carrier_options(cr, uid, values,
context=context)
- picking_id = super(stock_picking, self
- ).create(cr, uid, values, context=context)
+ picking_id = super(stock_picking, self).create(cr, uid, values, context=context)
return picking_id
@@ -310,8 +310,7 @@ def create(self, cr, uid, values, context=None):
picking_obj = self.pool['stock.picking']
values = picking_obj._values_with_carrier_options(cr, uid, values,
context=context)
- picking_id = super(stock_picking_in, self
- ).create(cr, uid, values, context=context)
+ picking_id = super(stock_picking_in, self).create(cr, uid, values, context=context)
return picking_id
@@ -407,8 +406,7 @@ def create(self, cr, uid, values, context=None):
picking_obj = self.pool['stock.picking']
values = picking_obj._values_with_carrier_options(cr, uid, values,
context=context)
- picking_id = super(stock_picking_out, self
- ).create(cr, uid, values, context=context)
+ picking_id = super(stock_picking_out, self).create(cr, uid, values, context=context)
return picking_id
diff --git a/__unported__/delivery_carrier_label_dispatch/__openerp__.py b/__unported__/delivery_carrier_label_dispatch/__openerp__.py
index 268d6a993a..9171c325e3 100644
--- a/__unported__/delivery_carrier_label_dispatch/__openerp__.py
+++ b/__unported__/delivery_carrier_label_dispatch/__openerp__.py
@@ -18,14 +18,15 @@
# along with this program. If not, see .
#
##############################################################################
-{'name': 'Carrier labels - Picking dispatch (link)',
- 'version': '1.0',
- 'author': 'Camptocamp',
- 'maintainer': 'Camptocamp',
- 'category': 'version',
- 'complexity': 'normal',
- 'depends': ['base_delivery_carrier_label', 'picking_dispatch'],
- 'description': """
+{
+ 'name': 'Carrier labels - Picking dispatch (link)',
+ 'version': '1.0',
+ 'author': 'Camptocamp',
+ 'maintainer': 'Camptocamp',
+ 'category': 'version',
+ 'complexity': 'normal',
+ 'depends': ['base_delivery_carrier_label', 'picking_dispatch'],
+ 'description': """
[Link module] Carrier labels - Picking dispatch
==============================
@@ -38,17 +39,17 @@
* Yannick Vaucher
""",
- 'website': 'http://www.camptocamp.com/',
- 'data': [
- 'picking_dispatch_view.xml',
- 'wizard/generate_labels_view.xml',
- ],
- 'tests': [],
- 'installable': False,
- 'auto_install': True,
- 'license': 'AGPL-3',
- 'application': False,
- 'external_dependencies': {
- 'python': ['PyPDF2'],
- }
- }
+ 'website': 'http://www.camptocamp.com/',
+ 'data': [
+ 'picking_dispatch_view.xml',
+ 'wizard/generate_labels_view.xml',
+ ],
+ 'tests': [],
+ 'installable': False,
+ 'auto_install': True,
+ 'license': 'AGPL-3',
+ 'application': False,
+ 'external_dependencies': {
+ 'python': ['PyPDF2'],
+ }
+}