Skip to content

Commit 4e42c31

Browse files
author
Tom Blauwendraat
committed
fixup! fixup! [FIX] base_delivery_carrier_files: more fixes on migration to 10.0
1 parent 947cf64 commit 4e42c31

File tree

6 files changed

+35
-87
lines changed

6 files changed

+35
-87
lines changed

base_delivery_carrier_label/tests/test_get_weight.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
from odoo.tests.common import TransactionCase
4+
from odoo.tools import mute_logger
45

56

67
class TestGetWeight(TransactionCase):
@@ -212,7 +213,10 @@ def test_get_weight_with_uom(self):
212213
# end of prepare data
213214

214215
# because uom conversion is not implemented
215-
self.assertEqual(package.weight, False)
216+
_module = 'odoo.addons.base_delivery_carrier_label'\
217+
'.models.stock_pack_operation'
218+
with mute_logger(_module):
219+
self.assertEqual(package.weight, False)
216220

217221
# if one day, uom conversion is implemented:
218222
# self.assertEqual(package.get_weight(), products_weight)

delivery_carrier_file_tnt/__init__.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Author: Guewen Baconnier
5-
# Copyright 2012 Camptocamp SA
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as
9-
# published by the Free Software Foundation, either version 3 of the
10-
# License, or (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
2+
# Copyright 2012 Camptocamp SA
3+
# Author: Guewen Baconnier
4+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
215

226
from . import generator
23-
from . import carrier_file
7+
from . import models
Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# Author: Guewen Baconnier
5-
# Copyright 2012 Camptocamp SA
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as
9-
# published by the Free Software Foundation, either version 3 of the
10-
# License, or (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
21-
222
{
233
'name': 'Delivery Carrier File: TNT',
244
'version': '10.0.1.0.0',
@@ -31,12 +11,12 @@
3111
'author': "Camptocamp,Odoo Community Association (OCA)",
3212
'license': 'AGPL-3',
3313
'website': 'http://www.camptocamp.com',
34-
'depends': ['base_delivery_carrier_files'],
35-
'init_xml': [],
36-
'update_xml': ['carrier_file_view.xml'],
37-
'demo_xml': [],
38-
'test': [],
39-
'images': [],
14+
'depends': [
15+
'base_delivery_carrier_files'
16+
],
17+
'data': [
18+
'views/delivery_carrier_file.xml'
19+
],
4020
'installable': True,
4121
'auto_install': False,
4222
}

delivery_carrier_file_tnt/carrier_file.py

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2012 Camptocamp SA
3+
# Author: Guewen Baconnier
4+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5+
6+
from odoo import api, fields, models
7+
8+
9+
class DeliveryCarrierFile(models.Model):
10+
_inherit = 'delivery.carrier.file'
11+
12+
@api.model
13+
def get_type_selection(self):
14+
result = super(DeliveryCarrierFile, self).get_type_selection()
15+
if 'tnt_express_shipper' not in result:
16+
result.append(('tnt_express_shipper', 'TNT Express Shipper'))
17+
return result
18+
19+
type = fields.Selection(get_type_selection, 'Type', required=True)
20+
tnt_account = fields.Char('TNT Account', size=9)
File renamed without changes.

0 commit comments

Comments
 (0)