-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0] [MIG] delivery_carrier_label_default: Migrate to 14.0
- Loading branch information
sonhd
committed
Jan 12, 2022
1 parent
a09e1eb
commit 95305b1
Showing
11 changed files
with
145 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,13 @@ Default label 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/delivery_carrier_label_default | ||
:target: https://github.com/OCA/delivery-carrier/tree/14.0/delivery_carrier_label_default | ||
: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-delivery_carrier_label_default | ||
:target: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_carrier_label_default | ||
: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/14.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
@@ -43,7 +43,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:%20delivery_carrier_label_default%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:%20delivery_carrier_label_default%0Aversion:%2014.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. | ||
|
||
|
@@ -58,18 +58,19 @@ Authors | |
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Yannick Vaucher <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Sergio Teruel <[email protected]> | ||
* Iryna Vyshnevska <[email protected]> | ||
* `Camptocamp <https://camptocamp.com>`_: | ||
* Yannick Vaucher <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Iryna Vyshnevska <[email protected]> | ||
* `Tecnativa <https://tecnativa.com/>`_: | ||
* Sergio Teruel <[email protected]> | ||
* `Trobz <https://trobz.com>`_: | ||
* Son Ho <[email protected]> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
The migration of this module from 12.0 to 14.0 was financially supported by Camptocamp | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
@@ -84,6 +85,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/delivery_carrier_label_default>`_ project on GitHub. | ||
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/14.0/delivery_carrier_label_default>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import stock_picking | ||
from . import delivery_carrier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright 2012 Akretion <http://www.akretion.com>. | ||
# Copyright 2013-2016 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class DeliveryCarrier(models.Model): | ||
_inherit = "delivery.carrier" | ||
|
||
def alternative_send_shipping(self, pickings): | ||
default_label = pickings.generate_default_label() | ||
labels = [] | ||
for package in pickings._get_packages_from_picking(): | ||
pack_label = default_label.copy() | ||
pack_label["tracking_number"] = package.id | ||
labels.append(pack_label) | ||
return [ | ||
{ | ||
"exact_price": pickings.carrier_price, | ||
"tracking_number": pickings.package_ids, | ||
"labels": labels, | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
* Yannick Vaucher <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Sergio Teruel <[email protected]> | ||
* Iryna Vyshnevska <[email protected]> | ||
* `Camptocamp <https://camptocamp.com>`_: | ||
* Yannick Vaucher <[email protected]> | ||
* Sébastien Alix <[email protected]> | ||
* Iryna Vyshnevska <[email protected]> | ||
* `Tecnativa <https://tecnativa.com/>`_: | ||
* Sergio Teruel <[email protected]> | ||
* `Trobz <https://trobz.com>`_: | ||
* Son Ho <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
Images | ||
------ | ||
|
||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. | ||
The migration of this module from 12.0 to 14.0 was financially supported by Camptocamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
delivery_carrier_label_default/views/report_default_label.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<odoo> | ||
<template id="report_default_label"> | ||
<t t-foreach="docs" t-as="o"> | ||
<t t-call="web.basic_layout"> | ||
<div class="page"> | ||
<div class="address"> | ||
<div class="recipient"> | ||
<address | ||
<template id="report_default_label"> | ||
<t t-foreach="docs" t-as="o"> | ||
<t t-call="web.basic_layout"> | ||
<div class="page"> | ||
<div class="address"> | ||
<div class="recipient"> | ||
<address | ||
t-field="o.partner_id" | ||
t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</t> | ||
</t> | ||
</t> | ||
</template> | ||
</template> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="report.paperformat" id="paperformat_a7_label"> | ||
<field name="name">Label A7 format</field> | ||
<field name="format">A7</field> | ||
<field name="orientation">Landscape</field> | ||
<field name="margin_top">20</field> | ||
<field name="margin_bottom">20</field> | ||
<field name="margin_left">7</field> | ||
</record> | ||
|
||
<record model="report.paperformat" id="paperformat_a7_label"> | ||
<field name="name">Label A7 format</field> | ||
<field name="format">A7</field> | ||
<field name="orientation">Landscape</field> | ||
<field name="margin_top">20</field> | ||
<field name="margin_bottom">20</field> | ||
<field name="margin_left">7</field> | ||
</record> | ||
|
||
<report | ||
id="default_label" | ||
model="stock.picking" | ||
string="Shipping Label" | ||
name="delivery_carrier_label_default.report_default_label" | ||
file="delivery_carrier_label_default.report_default_label" | ||
report_type="qweb-pdf" | ||
attachment_use="True" | ||
multi="False" | ||
paperformat="paperformat_a7_label" | ||
/> | ||
/> | ||
|
||
<record id="default_label" model="ir.actions.report"> | ||
<field name="name">Shipping Label</field> | ||
<field name="model">stock.picking</field> | ||
<field name="report_type">qweb-pdf</field> | ||
<field | ||
name="report_name" | ||
>delivery_carrier_label_default.report_default_label</field> | ||
<field | ||
name="report_file" | ||
>delivery_carrier_label_default.report_default_label</field> | ||
<field | ||
name="paperformat_id" | ||
ref="delivery_carrier_label_default.paperformat_a7_label" | ||
/> | ||
</record> | ||
</odoo> |