Skip to content

Commit

Permalink
[ADD] stock_report_delivery_document_lot_id: Add lot in all pickings
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Jan 21, 2025
1 parent 0c8a2f8 commit 7625508
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_report_delivery_document_lot_id/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
78 changes: 78 additions & 0 deletions stock_report_delivery_document_lot_id/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
:target: https://opensource.org/licenses/LGPL-3.0
:alt: License: LGPL-3

==============================================================
Stock Report Delivery Document Lot ID
==============================================================

Overview
========

The **Stock Report Delivery Document Lot ID** module enhances the **Delivery Document Report** by adding the ability to display lot or serial numbers for stock moves. This provides more detailed traceability for your delivery operations.

Features
========

- **Display Lot/Serial Numbers**:

- Adds a new column to the **Delivery Document Report** to show the lot or serial number of stock moves.

- **Barcode Support**:

- Displays barcodes for the lot/serial numbers, improving operational efficiency.

- **Dynamic Visibility**:

- Automatically shows the column only when lot or serial numbers are present in the stock move lines.

Usage
=====

1. **Install the Module**:

- Install the **Stock Report Delivery Document Lot ID** module via the Apps menu.

2. **Check Delivery Documents**:

- Open any delivery document and verify the presence of the `Lot/Serial Number` column.

3. **Barcodes for Lot/Serial Numbers**:

- Confirm that barcodes for lot or serial numbers appear in the new column.

Configuration
=============

No additional configuration is needed. The module works out of the box once installed.

Testing
=======

Perform the following tests to ensure the module is working correctly:

- Verify that the `Lot/Serial Number` column appears in the **Delivery Document Report** only when there are lot or serial numbers.

- Confirm that the barcodes are correctly generated and displayed in the column.

Bug Tracker
===========

If you encounter any issues, please report them on the GitHub repository at `GitHub Issues <https://github.com/avanzosc/odoo-addons/issues>`_.

Credits
=======

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

* Ana Juaristi <[email protected]>

* Unai Beristain <[email protected]>

For specific questions or support, please contact the contributors.

License
=======

This project is licensed under the LGPL-3 License. For more details, refer to the LICENSE file or visit <https://opensource.org/licenses/LGPL-3.0>.
Empty file.
14 changes: 14 additions & 0 deletions stock_report_delivery_document_lot_id/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Stock Report Delivery Document Lot ID",
"version": "16.0.1.0.0",
"category": "Stock",
"author": "Avanzosc",
"license": "LGPL-3",
"depends": ["stock"],
"data": [
"views/stock_report_delivery_document_lot_id_view.xml",
],
"installable": True,
"application": False,
"website": "https://github.com/avanzosc/odoo-addons",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template
id="stock_report_delivery_document_lot_id_inherit"
inherit_id="stock.report_delivery_document"
>
<xpath expr="//th[@name='th_sm_quantity']" position="after">
<th name="lot_serial" t-if="has_serial_number">
<strong>Lot/Serial Number</strong>
</th>
</xpath>

<xpath expr="//table[@name='stock_move_table']" position="after">
<t
t-set="has_serial_number"
t-value="any(move_line.lot_id or move_line.lot_name for move_line in o.move_line_ids)"
/>
</xpath>

<xpath expr="//table[@name='stock_move_table']/tbody/tr/td[3]" position="after">
<td t-if="has_serial_number">
<t t-foreach="move.move_line_ids" t-as="line">
<div
t-if="line.lot_id or line.lot_name"
t-esc="line.lot_id.name or line.lot_name"
t-options="{'widget': 'barcode', 'humanreadable': 1, 'width': 400, 'height': 100, 'img_style': 'width:100%;height:35px;'}"
/>
</t>
</td>
</xpath>
</template>
</odoo>

0 comments on commit 7625508

Please sign in to comment.