Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] stock_picking_report_delivery_cost: Migration to 17.0 #956

Open
wants to merge 20 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a991b0c
[ADD] stock_picking_report_delivery_cost: Delivery cost in Stock Pick…
pedrobaeza Dec 18, 2019
2569fe3
[MIG] stock_picking_report_delivery_cost: Migration to 12.0
pedrobaeza Jan 3, 2020
da746f5
Update translation files
oca-transbot Jan 22, 2020
f794f83
[IMP] stock_picking_report_delivery_cost: black, isort, prettier
victoralmau Oct 27, 2020
bd680a0
[MIG] stock_picking_report_delivery_cost: Migration to 13.0
victoralmau Oct 27, 2020
d092553
[MIG] stock_picking_report_delivery_cost: Migration to version 15.0
pilarvargas-tecnativa Jan 9, 2023
3c3ba2c
[MIG] stock_picking_report_delivery_cost: Migration to 16.0
victoralmau Sep 26, 2023
36cebc1
[UPD] Update stock_picking_report_delivery_cost.pot
Sep 26, 2023
fa738de
[BOT] post-merge updates
OCA-git-bot Sep 26, 2023
089bcf4
Added translation using Weblate (French)
kbentaleb Jan 8, 2024
df76cc9
Translated using Weblate (French)
kbentaleb Jan 8, 2024
b918c66
Added translation using Weblate (Italian)
mymage May 7, 2024
ea87a11
Translated using Weblate (Italian)
mymage May 8, 2024
53c01c2
[FIX] stock_picking_report_delivery_cost: add the same class style as…
RodrigoBM Jul 11, 2024
eee2719
[UPD] Update stock_picking_report_delivery_cost.pot
Jul 11, 2024
e1b0bc1
[BOT] post-merge updates
OCA-git-bot Jul 11, 2024
e8fb5a6
Update translation files
weblate Jul 11, 2024
8d3b8da
Translated using Weblate (Italian)
mymage Jul 15, 2024
00d8560
[IMP] stock_picking_report_delivery_cost: pre-commit auto fixes
BhaveshHeliconia Feb 6, 2025
dce16ac
[MIG] stock_picking_report_delivery_cost: Migration to 17.0
BhaveshHeliconia Feb 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions stock_picking_report_delivery_cost/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
================================
Delivery cost in Picking Reports
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1d2873443b3a00a6e9e763590bc455aa6372d8a5003964e17262840db92f0e9c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/17.0/stock_picking_report_delivery_cost
: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-17-0/delivery-carrier-17-0-stock_picking_report_delivery_cost
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/delivery-carrier&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module shows in the delivery slip and picking operations reports
the cost of the delivery method according the rate computed on the fly
according same conditions as standard delivery module would do.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Go to *Inventory > Operations > Transfers* and pick one not in state
*Done* or *Cancelled*.
2. Click on *Print > Delivery Slip* or *Print > Picking Operations*.
3. You will see in the report the computed delivery cost.

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20stock_picking_report_delivery_cost%0Aversion:%2017.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.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Víctor Martínez
- Pilar Vargas

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/17.0/stock_picking_report_delivery_cost>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions stock_picking_report_delivery_cost/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
15 changes: 15 additions & 0 deletions stock_picking_report_delivery_cost/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Delivery cost in Picking Reports",
"summary": "Show delivery cost in delivery slip and picking operations " " reports",
"version": "17.0.1.0.0",
"category": "Stock",
"website": "https://github.com/OCA/delivery-carrier",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["stock_delivery"],
"data": ["report/report_shipping.xml", "report/report_deliveryslip.xml"],
}
42 changes: 42 additions & 0 deletions stock_picking_report_delivery_cost/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_delivery_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-10-28 12:52+0000\n"
"PO-Revision-Date: 2020-10-28 12:52+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_picking
msgid "<strong>Delivery cost:</strong>"
msgstr "<strong>Coste de envío:</strong>"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_delivery_document
msgid "<strong>Delivery cost</strong>"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__carrier_price_for_report
msgid "Carrier Price For Report"
msgstr "Precio del envío para el informe"

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__currency_id
msgid "Currency"
msgstr "Moneda"

#. module: stock_picking_report_delivery_cost
#: model:ir.model,name:stock_picking_report_delivery_cost.model_stock_picking
msgid "Transfer"
msgstr "Albarán"
42 changes: 42 additions & 0 deletions stock_picking_report_delivery_cost/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_delivery_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-08 21:33+0000\n"
"Last-Translator: kbentaleb <k.bentaleb@gmail.com>\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_picking
msgid "<strong>Delivery cost:</strong>"
msgstr "<strong>Prix de livraison:</strong>"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_delivery_document
msgid "<strong>Delivery cost</strong>"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__carrier_price_for_report
msgid "Carrier Price For Report"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__currency_id
msgid "Currency"
msgstr "Devise"

#. module: stock_picking_report_delivery_cost
#: model:ir.model,name:stock_picking_report_delivery_cost.model_stock_picking
msgid "Transfer"
msgstr "Transfert"
42 changes: 42 additions & 0 deletions stock_picking_report_delivery_cost/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_delivery_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-07-15 09:58+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_picking
msgid "<strong>Delivery cost:</strong>"
msgstr "<strong>Costo di consegna:</strong>"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_delivery_document
msgid "<strong>Delivery cost</strong>"
msgstr "<strong>Costo di consegna</strong>"

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__carrier_price_for_report
msgid "Carrier Price For Report"
msgstr "Prezzo vettore per resoconto"

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__currency_id
msgid "Currency"
msgstr "Valuta"

#. module: stock_picking_report_delivery_cost
#: model:ir.model,name:stock_picking_report_delivery_cost.model_stock_picking
msgid "Transfer"
msgstr "Trasferimento"
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_delivery_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_picking
msgid "<strong>Delivery cost:</strong>"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model_terms:ir.ui.view,arch_db:stock_picking_report_delivery_cost.report_delivery_document
msgid "<strong>Delivery cost</strong>"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__carrier_price_for_report
msgid "Carrier Price For Report"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model.fields,field_description:stock_picking_report_delivery_cost.field_stock_picking__currency_id
msgid "Currency"
msgstr ""

#. module: stock_picking_report_delivery_cost
#: model:ir.model,name:stock_picking_report_delivery_cost.model_stock_picking
msgid "Transfer"
msgstr ""
2 changes: 2 additions & 0 deletions stock_picking_report_delivery_cost/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import stock_picking
27 changes: 27 additions & 0 deletions stock_picking_report_delivery_cost/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models


class StockPicking(models.Model):
_inherit = "stock.picking"

# Needed for fields.Monetary
currency_id = fields.Many2one(
related="sale_id.currency_id",
readonly=True,
string="Currency",
related_sudo=True, # for avoiding access problems
)
carrier_price_for_report = fields.Monetary(
compute="_compute_carrier_price_for_report",
)

@api.depends("sale_id", "carrier_price")
def _compute_carrier_price_for_report(self):
for picking in self:
so_lines = picking.sale_id.order_line.filtered("is_delivery")
if so_lines:
picking.carrier_price_for_report = sum(so_lines.mapped("price_unit"))
else:
picking.carrier_price_for_report = picking.carrier_price
3 changes: 3 additions & 0 deletions stock_picking_report_delivery_cost/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions stock_picking_report_delivery_cost/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [Tecnativa](https://www.tecnativa.com):
- Pedro M. Baeza
- Víctor Martínez
- Pilar Vargas
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
3 changes: 3 additions & 0 deletions stock_picking_report_delivery_cost/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module shows in the delivery slip and picking operations reports
the cost of the delivery method according the rate computed on the fly
according same conditions as standard delivery module would do.
6 changes: 6 additions & 0 deletions stock_picking_report_delivery_cost/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:

1. Go to *Inventory \> Operations \> Transfers* and pick one not in
state *Done* or *Cancelled*.
2. Click on *Print \> Delivery Slip* or *Print \> Picking Operations*.
3. You will see in the report the computed delivery cost.
18 changes: 18 additions & 0 deletions stock_picking_report_delivery_cost/report/report_deliveryslip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Tecnativa - Pedro M. Baeza
Copyright 2020 Tecnativa - Víctor Martínez
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="report_delivery_document" inherit_id="stock.report_delivery_document">
<xpath expr="//div[@name='div_sched_date']" position="after">
<div
t-if="o.carrier_price_for_report"
class="col-auto col-3 mw-100 mb-2"
name="div_carrier_price_for_report"
>
<strong>Delivery cost:</strong>
<p t-field="o.carrier_price_for_report" class="m-0" />
</div>
</xpath>
</template>
</odoo>
17 changes: 17 additions & 0 deletions stock_picking_report_delivery_cost/report/report_shipping.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Tecnativa - Pedro M. Baeza
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="report_picking" inherit_id="stock.report_picking">
<xpath expr="//div[@name='div_sched_date']" position="after">
<div
t-if="o.carrier_price_for_report"
class="col-auto"
name="div_carrier_price_for_report"
>
<strong>Delivery cost:</strong>
<p t-field="o.carrier_price_for_report" />
</div>
</xpath>
</template>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading