Skip to content

Commit

Permalink
[MIG] base_delivery_carrier_label: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-tubtim committed Feb 6, 2020
1 parent 5797800 commit 56b6e27
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 19 deletions.
4 changes: 1 addition & 3 deletions base_delivery_carrier_label/models/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# Copyright 2013-2016 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
from odoo import fields, models


class DeliveryCarrier(models.Model):
_inherit = "delivery.carrier"

delivery_type = fields.Selection(oldname="carrier_type")
code = fields.Char(help="Delivery Method Code (according to carrier)")
description = fields.Text()
available_option_ids = fields.One2many(
Expand All @@ -17,7 +16,6 @@ class DeliveryCarrier(models.Model):
string="Option",
)

@api.multi
def default_options(self):
""" Returns default and available options for a carrier """
options = self.env["delivery.carrier.option"].browse()
Expand Down
9 changes: 2 additions & 7 deletions base_delivery_carrier_label/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@

import logging

from odoo import api, fields, models

import odoo.addons.decimal_precision as dp
from odoo import fields, models

_logger = logging.getLogger(__name__)


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

weight = fields.Float(
digits=dp.get_precision("Stock Weight"), help="Weight of the pack_operation"
)
weight = fields.Float(digits="Stock Weight", help="Weight of the pack_operation")

@api.multi
def get_weight(self):
"""Calc and save weight of pack.operations.
Expand Down
2 changes: 0 additions & 2 deletions base_delivery_carrier_label/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def _values_with_carrier_options(self, values):
values.update(option_ids=[(6, 0, default_options.ids)])
return values

@api.multi
@api.returns("stock.quant.package")
def _get_packages_from_picking(self):
""" Get all the packages from the picking """
Expand All @@ -197,7 +196,6 @@ def _get_packages_from_picking(self):
packages |= operation.result_package_id or operation.package_id
return packages

@api.multi
def write(self, vals):
""" Set the default options when the delivery method is changed.
Expand Down
5 changes: 1 addition & 4 deletions base_delivery_carrier_label/models/stock_quant_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from odoo import api, fields, models

import odoo.addons.decimal_precision as dp


class StockQuantPackage(models.Model):
_inherit = "stock.quant.package"
Expand All @@ -15,7 +13,7 @@ class StockQuantPackage(models.Model):
help="Link to the carrier's tracking page for this package."
)
total_weight = fields.Float(
digits=dp.get_precision("Stock Weight"),
digits="Stock Weight",
help="Total weight of the package in kg, including the "
"weight of the logistic unit.",
)
Expand Down Expand Up @@ -49,7 +47,6 @@ def _compute_weight(self):
if to_do:
super(StockQuantPackage, to_do)._compute_weight()

@api.multi
def _complete_name(self, name, args):
res = super()._complete_name(name, args)
for pack in self:
Expand Down
1 change: 1 addition & 0 deletions base_delivery_carrier_label/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
* Ismael Calvo <ismael.calvo@factorlibre.com>
* Dave Lasley <dave@laslabs.com>
* Timothée Ringeard <timothee.ringeard@camptocamp.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
3 changes: 1 addition & 2 deletions base_delivery_carrier_label/wizard/manifest_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Ismael Calvo <ismael.calvo@factorlibre.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import _, api, fields, models
from odoo import _, fields, models


class ManifestWizard(models.TransientModel):
Expand All @@ -26,7 +26,6 @@ class ManifestWizard(models.TransientModel):
default="init",
)

@api.one
def get_manifest_file(self):
raise NotImplementedError(
_("Manifest not implemented for '%s' carrier.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<field name="name">Manifest</field>
<field name="res_model">manifest.wizard</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="manifest_wizard_form"/>
<field name="target">new</field>
Expand Down

0 comments on commit 56b6e27

Please sign in to comment.