Merge PR #252 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-12-19 00:46:20 +00:00
10 changed files with 99 additions and 15 deletions

View File

@@ -19,13 +19,14 @@ Stock Picking Report Custom Description
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-14-0/stock-logistics-reporting-14-0-stock_picking_report_custom_description
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/151/14.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-reporting&target_branch=14.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to print moves description in picking reports.
This module transfers the sales order line description to the picking, and
allows to print such text on the picking reports.
**Table of contents**
@@ -38,8 +39,13 @@ Usage
To use this module, you need to:
#. Create a sale order and set manual description in sale order lines.
#. Go to *Inventory > Deliveries* and you can print the reports with move name
instead product name.
#. Confirm the order.
#. Navigate to the delivery through the smart-button.
#. You can print the reports with move name instead product name on the specific
reports:
* Delivery Slip (Description).
* Picking Operations (Description).
Bug Tracker
===========

View File

@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

View File

@@ -14,7 +14,7 @@
"maintainers": ["carlosdauden"],
"license": "AGPL-3",
"depends": [
"stock",
"sale_stock",
],
"data": [
"views/report_deliveryslip.xml",

View File

@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import stock_rule

View File

@@ -0,0 +1,35 @@
# Copyright 2022 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class StockRule(models.Model):
_inherit = "stock.rule"
def _get_stock_move_values(
self,
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
):
"""Transfer the SO line description to the move name."""
res = super()._get_stock_move_values(
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
)
if values.get("sale_line_id"):
line = self.env["sale.order.line"].browse(values["sale_line_id"])
res["name"] = line.name
return res

View File

@@ -1 +1,2 @@
This module allows to print moves description in picking reports.
This module transfers the sales order line description to the picking, and
allows to print such text on the picking reports.

View File

@@ -1,5 +1,10 @@
To use this module, you need to:
#. Create a sale order and set manual description in sale order lines.
#. Go to *Inventory > Deliveries* and you can print the reports with move name
instead product name.
#. Confirm the order.
#. Navigate to the delivery through the smart-button.
#. You can print the reports with move name instead product name on the specific
reports:
* Delivery Slip (Description).
* Picking Operations (Description).

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Stock Picking Report Custom Description</title>
<style type="text/css">
@@ -367,8 +367,9 @@ ul.auto-toc {
!! 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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/stock-logistics-reporting/tree/14.0/stock_picking_report_custom_description"><img alt="OCA/stock-logistics-reporting" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-reporting-14-0/stock-logistics-reporting-14-0-stock_picking_report_custom_description"><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/151/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to print moves description in picking reports.</p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/stock-logistics-reporting/tree/14.0/stock_picking_report_custom_description"><img alt="OCA/stock-logistics-reporting" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-reporting-14-0/stock-logistics-reporting-14-0-stock_picking_report_custom_description"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/stock-logistics-reporting&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module transfers the sales order line description to the picking, and
allows to print such text on the picking reports.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -387,8 +388,14 @@ ul.auto-toc {
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Create a sale order and set manual description in sale order lines.</li>
<li>Go to <em>Inventory &gt; Deliveries</em> and you can print the reports with move name
instead product name.</li>
<li>Confirm the order.</li>
<li>Navigate to the delivery through the smart-button.</li>
<li>You can print the reports with move name instead product name on the specific
reports:<ul>
<li>Delivery Slip (Description).</li>
<li>Picking Operations (Description).</li>
</ul>
</li>
</ol>
</div>
<div class="section" id="bug-tracker">

View File

@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_stock_picking_report_custom_description

View File

@@ -0,0 +1,24 @@
# Copyright 2022 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class TestStockPickingReportCustomDescription(common.SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.customer = cls.env["res.partner"].create({"name": "Test customer"})
cls.product = cls.env["product.product"].create(
{"name": "Test product", "type": "product"}
)
order_form = common.Form(cls.env["sale.order"])
order_form.partner_id = cls.customer
with order_form.order_line.new() as line_form:
line_form.product_id = cls.product
line_form.name = "Custom description"
cls.order = order_form.save()
def test_so_custom_description_transfer_to_picking(self):
self.order.action_confirm()
self.assertEqual(self.order.order_line.move_ids.name, "Custom description")