Skip to content

Commit

Permalink
[MIG] base_delivery_carier_label: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-tubtim committed Oct 21, 2020
1 parent 9b2cc2c commit c8c50e7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 26 deletions.
13 changes: 7 additions & 6 deletions base_delivery_carrier_label/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Base module for carrier labels
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github
:target: https://github.com/OCA/delivery-carrier/tree/12.0/base_delivery_carrier_label
:target: https://github.com/OCA/delivery-carrier/tree/13.0/base_delivery_carrier_label
:alt: OCA/delivery-carrier
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/delivery-carrier-12-0/delivery-carrier-12-0-base_delivery_carrier_label
:target: https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-base_delivery_carrier_label
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/99/12.0
:target: https://runbot.odoo-community.org/runbot/99/13.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -40,7 +40,7 @@ Usage
** How does it works ? **


In picking UI a button "Shipping label" trigger label generation
In picking UI a button "Shipping label" trigger label generation
calling `action_generate_carrier_label()` in models/stock.picking.py


Expand All @@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20base_delivery_carrier_label%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20base_delivery_carrier_label%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -80,6 +80,7 @@ Contributors
* Ismael Calvo <ismael.calvo@factorlibre.com>
* Dave Lasley <dave@laslabs.com>
* Timothée Ringeard <timothee.ringeard@camptocamp.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

Maintainers
~~~~~~~~~~~
Expand All @@ -94,6 +95,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/12.0/base_delivery_carrier_label>`_ project on GitHub.
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/13.0/base_delivery_carrier_label>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 2 additions & 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,13 @@
# 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")
delivery_type = fields.Selection()
code = fields.Char(help="Delivery Method Code (according to carrier)")
description = fields.Text()
available_option_ids = fields.One2many(
Expand All @@ -17,7 +17,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>
7 changes: 4 additions & 3 deletions base_delivery_carrier_label/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Base module for carrier labels</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/12.0/base_delivery_carrier_label"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-12-0/delivery-carrier-12-0-base_delivery_carrier_label"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/99/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/13.0/base_delivery_carrier_label"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-13-0/delivery-carrier-13-0-base_delivery_carrier_label"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/99/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds a button on delivery orders to generate a label as an
attachement. This module doesn’t do anything by itself, it serves as a
base module for other carrier-specific modules.</p>
Expand Down Expand Up @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/delivery-carrier/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/delivery-carrier/issues/new?body=module:%20base_delivery_carrier_label%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/delivery-carrier/issues/new?body=module:%20base_delivery_carrier_label%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -421,6 +421,7 @@ <h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<li>Ismael Calvo &lt;<a class="reference external" href="mailto:ismael.calvo&#64;factorlibre.com">ismael.calvo&#64;factorlibre.com</a>&gt;</li>
<li>Dave Lasley &lt;<a class="reference external" href="mailto:dave&#64;laslabs.com">dave&#64;laslabs.com</a>&gt;</li>
<li>Timothée Ringeard &lt;<a class="reference external" href="mailto:timothee.ringeard&#64;camptocamp.com">timothee.ringeard&#64;camptocamp.com</a>&gt;</li>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -430,7 +431,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/12.0/base_delivery_carrier_label">OCA/delivery-carrier</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/13.0/base_delivery_carrier_label">OCA/delivery-carrier</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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 c8c50e7

Please sign in to comment.