[ADD] stock_move_value_report: New module

This commit is contained in:
david
2019-10-28 11:00:28 +01:00
committed by CarlosRoca13
parent a184632ae8
commit 2f264468b0
16 changed files with 1323 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
============================
Stock Move Cost Value Report
============================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fstock--logistics--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-reporting/tree/11.0/stock_move_value_report
:alt: OCA/stock-logistics-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-reporting-11-0/stock-logistics-reporting-11-0-stock_move_value_report
: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/11.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to obtain a report with the cost value of a given
operation set like a picking, a scrap, an inventory or even a selection of
moves or move lines.
**Table of contents**
.. contents::
:local:
Usage
=====
To print the report you can either go to:
- *Inventory > Transfrers*
- *Inventory > Inventory Adjustments*
- *Inventory > Scraps*
- *Inventory > Reporting > Stock Moves*
- *Inventory > Reporting > Product Moves*
And then:
#. Switch to list view.
#. Select records to print.
#. And then *Print > Operations Cost Value Report*
A pdf preport with the operations linked to these records and their cost will
be obtained. Keep in mind that only done operations will have a cost value.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-reporting/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/stock-logistics-reporting/issues/new?body=module:%20stock_move_value_report%0Aversion:%2011.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>`_:
* David Vidal
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/stock-logistics-reporting <https://github.com/OCA/stock-logistics-reporting/tree/11.0/stock_move_value_report>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

View File

@@ -0,0 +1,24 @@
# Copyright 2019 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Stock Move Cost Value Report",
"version": "11.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-reporting",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"stock_account",
],
"data": [
'report/stock_value_report.xml',
'report/stock_move_line_value_report.xml',
'report/stock_move_value_report.xml',
'report/stock_picking_value_report.xml',
'report/stock_scrap_value_report.xml',
'report/stock_inventory_value_report.xml',
],
}

View File

@@ -0,0 +1,154 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_value_report
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-10-30 09:19+0000\n"
"PO-Revision-Date: 2019-10-30 09:19+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_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Customer Address:</strong></span>"
msgstr "<span><strong>Dirección del Cliente:</strong></span>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Delivery Address:</strong></span>"
msgstr "<span><strong>Dirección de Envío:</strong></span>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Partner Address:</strong></span>"
msgstr "<span><strong>Dirección de la empresa:</strong></span>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Warehouse Address:</strong></span>"
msgstr "<span><strong>Dirección de almacén:</strong></span>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Commitment Date</strong>"
msgstr "<strong>Fecha de compromiso</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Date</strong>"
msgstr "<strong>Fecha</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Location</strong>"
msgstr "<strong>Ubicación</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Order (Origin)</strong>"
msgstr "<strong>Pedido (Origen)</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Product</strong>"
msgstr "<strong>Producto</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Quantity</strong>"
msgstr "<strong>Cantidad</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Scheduled Date</strong>"
msgstr "<strong>Fecha planificada</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Source Document</strong>"
msgstr "<strong>Documento de Origen</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>State</strong>"
msgstr "<strong>Estado</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Subtotal</strong>"
msgstr "<strong>Subtotal</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "<strong>Total operations value balance</strong>"
msgstr "<strong>Balance total de operaciones</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value_total
msgid "<strong>Total</strong>"
msgstr "<strong>Total</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Value</strong>"
msgstr "<strong>Valor</strong>"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Inventory"
msgstr "Inventario"
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_inventory_value
msgid "Inventory Operations Cost Value"
msgstr "Valor de Coste de Operaciones de Iventario"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "Lot/Serial Number"
msgstr "Lote/Número de serie"
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_move_line_value
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_move_value
msgid "Operations Cost Value Report"
msgstr "Informe de Valor de Coste de Operaciones"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Picking"
msgstr "Albarán"
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_picking_value
msgid "Picking Operations Cost Value"
msgstr "Valor de Coste de Operaciones de Albarán"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "Scrap"
msgstr "Desecho"
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_scrap_value
msgid "Scrap Operations Cost Value"
msgstr "Valor de Coste de Operaciones de Desecho"
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Selected operations cost value"
msgstr "Valor de Coste de Operaciones Seleccionadas"

View File

@@ -0,0 +1,152 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_value_report
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.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_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Customer Address:</strong></span>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Delivery Address:</strong></span>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Partner Address:</strong></span>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<span><strong>Warehouse Address:</strong></span>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Commitment Date</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Date</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Location</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Order (Origin)</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Product</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Quantity</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
msgid "<strong>Scheduled Date</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>Source Document</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_picking_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "<strong>State</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Subtotal</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "<strong>Total operations value balance</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value_total
msgid "<strong>Total</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "<strong>Value</strong>"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_inventory_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Inventory"
msgstr ""
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_inventory_value
msgid "Inventory Operations Cost Value"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.stock_move_lines_value
msgid "Lot/Serial Number"
msgstr ""
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_move_line_value
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_move_value
msgid "Operations Cost Value Report"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Picking"
msgstr ""
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_picking_value
msgid "Picking Operations Cost Value"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_scrap_value_document
msgid "Scrap"
msgstr ""
#. module: stock_move_value_report
#: model:ir.actions.report,name:stock_move_value_report.action_report_stock_scrap_value
msgid "Scrap Operations Cost Value"
msgstr ""
#. module: stock_move_value_report
#: model:ir.ui.view,arch_db:stock_move_value_report.report_stock_move_value_document
msgid "Selected operations cost value"
msgstr ""

View File

@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* David Vidal

View File

@@ -0,0 +1,3 @@
This module allows to obtain a report with the cost value of a given
operation set like a picking, a scrap, an inventory or even a selection of
moves or move lines.

View File

@@ -0,0 +1,16 @@
To print the report you can either go to:
- *Inventory > Transfrers*
- *Inventory > Inventory Adjustments*
- *Inventory > Scraps*
- *Inventory > Reporting > Stock Moves*
- *Inventory > Reporting > Product Moves*
And then:
#. Switch to list view.
#. Select records to print.
#. And then *Print > Operations Cost Value Report*
A pdf preport with the operations linked to these records and their cost will
be obtained. Keep in mind that only done operations will have a cost value.

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_stock_inventory_value_document">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<h1 class="mt0 pull-left">Inventory <t t-esc="inventory.name"/></h1>
<div class="clearfix"/>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Location</strong></th>
<th><strong>State</strong></th>
<th><strong>Date</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span t-field="inventory.location_id.name"/>
</td>
<td>
<span t-field="inventory.state"/>
</td>
<td name="td_date">
<span t-field="inventory.date"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="inventory.mapped('move_ids.move_line_ids')"/>
<t t-set="currency_id" t-value="inventory.company_id.currency_id"/>
</t>
<br/>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="inventory.mapped('move_ids.move_line_ids')"/>
<t t-set="currency_id" t-value="inventory.company_id.currency_id"/>
</t>
</div>
</t>
</t>
</template>
<template id="report_stock_inventory_value">
<t t-foreach="docs" t-as="inventory">
<t t-call="stock_move_value_report.report_stock_inventory_value_document"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="stock_move_lines_value">
<table class="table table-condensed mt4 mb0">
<t t-set="has_serial_number" t-value="move_lines.mapped('lot_id')" groups="stock.group_production_lot"/>
<thead>
<tr>
<th name="th_product">
<strong>Product</strong>
</th>
<th name="th_lot" t-if="has_serial_number">
Lot/Serial Number
</th>
<th name="th_qty" class="text-center">
<strong>Quantity</strong>
</th>
<th name="th_value" class="text-right">
<strong>Value</strong>
</th>
<th name="th_value_sbtl" class="text-right">
<strong>Subtotal</strong>
</th>
</tr>
</thead>
<tbody>
<tr t-foreach="move_lines" t-as="move_line">
<td>
<span t-field="move_line.product_id"/>
<span t-field="move_line.product_id.sudo().description"/>
</td>
<t t-if="has_serial_number">
<td>
<table width="100%">
<tr>
<td>
<span t-field="move_line.lot_id"/>
<t t-if="not move_line.lot_id">
<span t-field="move_line.lot_name"/>
</t>
</td>
<td name="lot_qty">
<t t-if="move_line.product_qty">
<span t-field="move_line.product_qty"/>
</t>
</td>
</tr>
</table>
</td>
</t>
<td class="text-center">
<span t-field="move_line.qty_done"/>
<span t-field="move_line.product_uom_id"/>
</td>
<td class="text-right">
<span t-field="move_line.move_id.price_unit" t-options="{'widget': 'monetary', 'display_currency': currency_id}"/>
</td>
<td class="text-right">
<span t-esc="move_line.move_id.price_unit * move_line.qty_done" t-options="{'widget': 'monetary', 'display_currency': currency_id}"/>
</td>
</tr>
</tbody>
</table>
</template>
<template id="stock_move_lines_value_total">
<div class="clearfix">
<div id="total" class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed" style="min-width: 250px;max-width: 400px;page-break-inside: avoid;">
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span t-esc="sum([x.move_id.price_unit * x.qty_done for x in move_lines])" t-options="{'widget': 'monetary', 'display_currency': currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</template>
<template id="report_stock_move_value_document">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<h2 class="mb48">Selected operations cost value</h2>
<t t-set="ml_from_pickings" t-value="move_lines_ids.filtered('move_id.picking_id')"/>
<t t-set="ml_from_inventories" t-value="move_lines_ids.filtered('move_id.inventory_id')"/>
<t t-set="ml_from_scraps" t-value="move_lines_ids.filtered('move_id.scrapped')"/>
<!-- ML From Pickings -->
<t t-if="ml_from_pickings">
<t t-set="pickings" t-value="ml_from_pickings.mapped('move_id.picking_id')"/>
<t t-foreach="pickings" t-as="picking">
<t t-set="picking_move_lines" t-value="ml_from_pickings.filtered(lambda x: x.picking_id == picking)"/>
<h4><span>[<t t-esc="picking.date"/>]</span> Picking <t t-esc="picking.name"/>: <t t-esc="picking.location_id.name"/> &#8594; <t t-esc="picking.location_dest_id.name"/></h4>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="picking_move_lines"/>
<t t-set="currency_id" t-value="picking.company_id.currency_id"/>
</t>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="picking_move_lines"/>
<t t-set="currency_id" t-value="picking.company_id.currency_id"/>
</t>
</t>
</t>
<!-- ML From Inventories -->
<t t-if="ml_from_inventories">
<t t-set="inventories" t-value="ml_from_inventories.mapped('move_id.inventory_id')"/>
<t t-foreach="inventories" t-as="inventory">
<t t-set="inventory_move_lines" t-value="ml_from_inventories.filtered(lambda x: x.move_id.inventory_id == inventory)"/>
<h4><span>[<t t-esc="inventory.date"/>]</span> Inventory <t t-esc="inventory.name"/>: <t t-esc="inventory.location_id.name"/></h4>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="inventory_move_lines"/>
<t t-set="currency_id" t-value="inventory.company_id.currency_id"/>
</t>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="inventory_move_lines"/>
<t t-set="currency_id" t-value="inventory.company_id.currency_id"/>
</t>
</t>
</t>
<!-- ML From Scraps -->
<t t-if="ml_from_scraps">
<t t-set="scraps" t-value="move_lines_ids.mapped('move_id.scrap_ids').filtered(lambda x: x.move_id in ml_from_scraps.mapped('move_id'))"/>
<t t-foreach="scraps" t-as="scrap">
<t t-set="scrap_move_lines" t-value="scrap.move_id.move_line_ids"/>
<h4><span>[<t t-esc="scrap.move_id.date"/>]</span> Scrap <t t-esc="scrap.name"/>: <t t-esc="scrap.location_id.name"/> &#8594; <t t-esc="scrap.scrap_location_id.name"/></h4>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="scrap_move_lines"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="scrap_move_lines"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
</t>
</t>
</div>
<!-- Total all moves -->
<div class="clearfix">
<div id="total" class="row">
<div class="col-xs-4 pull-right">
<table class="table table-condensed" style="min-width: 250px;max-width: 400px;page-break-inside: avoid;">
<tr class="border-black">
<td><strong>Total operations value balance</strong></td>
<td class="text-right">
<strong t-esc="sum([x.move_id.price_unit * x.qty_done for x in move_lines_ids])" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
</div>
</t>
</t>
</template>
<template id="report_stock_move_line_value">
<t t-call="stock_move_value_report.report_stock_move_value_document">
<t t-set="move_lines_ids" t-value="docs"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_stock_move_value">
<t t-call="stock_move_value_report.report_stock_move_value_document">
<t t-set="move_lines_ids" t-value="docs.mapped('move_line_ids')"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_stock_picking_value_document">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<div class="row">
<div class="col-xs-6">
<div t-if="picking.move_lines and picking.move_lines[0].partner_id and picking.move_lines[0].partner_id.id != picking.partner_id.id">
<span><strong>Delivery Address:</strong></span>
<div t-field="picking.move_lines[0].partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
</div>
<div t-if="picking.picking_type_id.code != 'internal' and (not picking.move_lines or not picking.move_lines[0].partner_id) and picking.picking_type_id.warehouse_id.partner_id">
<span><strong>Warehouse Address:</strong></span>
<div t-field="picking.picking_type_id.warehouse_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/>
</div>
</div>
<div class="col-xs-5 col-xs-offset-1">
<div t-if="picking.picking_type_id.code=='incoming' and picking.partner_id">
<span><strong>Partner Address:</strong></span>
</div>
<div t-if="picking.picking_type_id.code=='internal' and picking.partner_id">
<span><strong>Warehouse Address:</strong></span>
</div>
<div t-if="picking.picking_type_id.code=='outgoing' and picking.partner_id">
<span><strong>Customer Address:</strong></span>
</div>
<div t-if="picking.partner_id" name="partner_header">
<div t-field="picking.partner_id"
t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True, "phone_icons": True}'/>
<p t-if="picking.sudo().partner_id.vat"><t t-esc="picking.company_id.country_id.vat_label or 'TIN'"/>: <span t-field="picking.sudo().partner_id.vat"/></p>
</div>
</div>
</div>
<br/>
<h1 t-field="picking.name" class="mt0 pull-left"/>
<div class="clearfix"/>
<table class="table table-condensed">
<thead>
<tr>
<th t-if="picking.origin"><strong>Order (Origin)</strong></th>
<th><strong>State</strong></th>
<th><strong>Commitment Date</strong></th>
<th name="td_sched_date_h"><strong>Scheduled Date</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td t-if="picking.origin">
<span t-field="picking.origin"/>
</td>
<td>
<span t-field="picking.state"/>
</td>
<td>
<span t-field="picking.date"/>
</td>
<td name="td_sched_date">
<span t-field="picking.scheduled_date"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<h4>[<t t-esc="picking.location_id.name"/> &#8594; <t t-esc="picking.location_dest_id.name"/>]</h4>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="picking.move_line_ids"/>
<t t-set="currency_id" t-value="picking.company_id.currency_id"/>
</t>
<br/>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="picking.move_line_ids"/>
<t t-set="currency_id" t-value="picking.company_id.currency_id"/>
</t>
<p t-esc="picking.note"/>
</div>
</t>
</t>
</template>
<template id="report_stock_picking_value">
<t t-foreach="docs" t-as="picking">
<t t-call="stock_move_value_report.report_stock_picking_value_document"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_stock_scrap_value_document">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<div class="page">
<h1 class="mt0 pull-left">Scrap <t t-esc="scrap.name"/></h1>
<div class="clearfix"/>
<table class="table table-condensed">
<thead>
<tr>
<th><strong>Location</strong></th>
<th t-if="scrap.origin"><strong>Source Document</strong></th>
<th><strong>State</strong></th>
<th><strong>Date</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span t-field="scrap.location_id.name"/>
</td>
<td t-if="scrap.origin">
<span t-field="scrap.origin"/>
</td>
<td>
<span t-field="scrap.state"/>
</td>
<td name="td_sched_date">
<span t-esc="scrap.move_id and scrap.move_id.date"/>
</td>
</tr>
</tbody>
</table>
<br/>
<br/>
<t t-call="stock_move_value_report.stock_move_lines_value">
<t t-set="move_lines" t-value="scrap.mapped('move_id.move_line_ids')"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
<br/>
<t t-call="stock_move_value_report.stock_move_lines_value_total">
<t t-set="move_lines" t-value="scrap.mapped('move_id.move_line_ids')"/>
<t t-set="currency_id" t-value="res_company.currency_id"/>
</t>
</div>
</t>
</t>
</template>
<template id="report_stock_scrap_value">
<t t-foreach="docs" t-as="scrap">
<t t-call="stock_move_value_report.report_stock_scrap_value_document"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report
string="Operations Cost Value Report"
id="action_report_stock_move_line_value"
model="stock.move.line"
report_type="qweb-pdf"
name="stock_move_value_report.report_stock_move_line_value"
file="stock_move_value_report.report_stock_move_line_value"
/>
<report
string="Operations Cost Value Report"
id="action_report_stock_move_value"
model="stock.move"
report_type="qweb-pdf"
name="stock_move_value_report.report_stock_move_value"
file="stock_move_value_report.report_stock_move_value"
/>
<report
string="Picking Operations Cost Value"
id="action_report_stock_picking_value"
model="stock.picking"
report_type="qweb-pdf"
name="stock_move_value_report.report_stock_picking_value"
file="stock_move_value_report.report_stock_picking_value"
/>
<report
string="Scrap Operations Cost Value"
id="action_report_stock_scrap_value"
model="stock.scrap"
report_type="qweb-pdf"
name="stock_move_value_report.report_stock_scrap_value"
file="stock_move_value_report.report_stock_scrap_value"
/>
<report
string="Inventory Operations Cost Value"
id="action_report_stock_inventory_value"
model="stock.inventory"
report_type="qweb-pdf"
name="stock_move_value_report.report_stock_inventory_value"
file="stock_move_value_report.report_stock_inventory_value"
/>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,444 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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/" />
<title>Stock Move Cost Value Report</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="stock-move-cost-value-report">
<h1 class="title">Stock Move Cost Value Report</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/stock-logistics-reporting/tree/11.0/stock_move_value_report"><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-11-0/stock-logistics-reporting-11-0-stock_move_value_report"><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/11.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 obtain a report with the cost value of a given
operation set like a picking, a scrap, an inventory or even a selection of
moves or move lines.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id1">Usage</a></h1>
<p>To print the report you can either go to:</p>
<ul class="simple">
<li><em>Inventory &gt; Transfrers</em></li>
<li><em>Inventory &gt; Inventory Adjustments</em></li>
<li><em>Inventory &gt; Scraps</em></li>
<li><em>Inventory &gt; Reporting &gt; Stock Moves</em></li>
<li><em>Inventory &gt; Reporting &gt; Product Moves</em></li>
</ul>
<p>And then:</p>
<ol class="arabic simple">
<li>Switch to list view.</li>
<li>Select records to print.</li>
<li>And then <em>Print &gt; Operations Cost Value Report</em></li>
</ol>
<p>A pdf preport with the operations linked to these records and their cost will
be obtained. Keep in mind that only done operations will have a cost value.</p>
</div>
<div class="section" id="bug-tracker">
<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/stock-logistics-reporting/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/stock-logistics-reporting/issues/new?body=module:%20stock_move_value_report%0Aversion:%2011.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">
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>David Vidal</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<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/stock-logistics-reporting/tree/11.0/stock_move_value_report">OCA/stock-logistics-reporting</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>
</div>
</body>
</html>