Skip to content

Commit

Permalink
fixup! fixup! [FIX] base_delivery_carrier_files: more fixes on migrat…
Browse files Browse the repository at this point in the history
…ion to 10.0
  • Loading branch information
thomaspaulb committed Jul 18, 2019
1 parent 947cf64 commit 4e42c31
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 87 deletions.
6 changes: 5 additions & 1 deletion base_delivery_carrier_label/tests/test_get_weight.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger


class TestGetWeight(TransactionCase):
Expand Down Expand Up @@ -212,7 +213,10 @@ def test_get_weight_with_uom(self):
# end of prepare data

# because uom conversion is not implemented
self.assertEqual(package.weight, False)
_module = 'odoo.addons.base_delivery_carrier_label'\
'.models.stock_pack_operation'
with mute_logger(_module):
self.assertEqual(package.weight, False)

# if one day, uom conversion is implemented:
# self.assertEqual(package.get_weight(), products_weight)
Expand Down
24 changes: 4 additions & 20 deletions delivery_carrier_file_tnt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2012 Camptocamp SA
# Author: Guewen Baconnier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import generator
from . import carrier_file
from . import models
32 changes: 6 additions & 26 deletions delivery_carrier_file_tnt/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
'name': 'Delivery Carrier File: TNT',
'version': '10.0.1.0.0',
Expand All @@ -31,12 +11,12 @@
'author': "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'http://www.camptocamp.com',
'depends': ['base_delivery_carrier_files'],
'init_xml': [],
'update_xml': ['carrier_file_view.xml'],
'demo_xml': [],
'test': [],
'images': [],
'depends': [
'base_delivery_carrier_files'
],
'data': [
'views/delivery_carrier_file.xml'
],
'installable': True,
'auto_install': False,
}
40 changes: 0 additions & 40 deletions delivery_carrier_file_tnt/carrier_file.py

This file was deleted.

20 changes: 20 additions & 0 deletions delivery_carrier_file_tnt/models/delivery_carrier_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Camptocamp SA
# Author: Guewen Baconnier
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class DeliveryCarrierFile(models.Model):
_inherit = 'delivery.carrier.file'

@api.model
def get_type_selection(self):
result = super(DeliveryCarrierFile, self).get_type_selection()
if 'tnt_express_shipper' not in result:
result.append(('tnt_express_shipper', 'TNT Express Shipper'))
return result

type = fields.Selection(get_type_selection, 'Type', required=True)
tnt_account = fields.Char('TNT Account', size=9)

0 comments on commit 4e42c31

Please sign in to comment.