[9.0][IMP] stock_picking_report_custom_description: Change name

This commit is contained in:
Carlos Dauden
2017-02-03 11:30:58 +01:00
committed by Ernesto Tejeda
parent 34ae5f9a18
commit f47695a8a7
9 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Stock Picking Report Custom Description",
"summary": "Show moves description in picking reports",
"version": "9.0.1.0.0",
"category": "Warehouse",
"website": "http://www.tecnativa.com",
"author": "Tecnativa, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"stock",
],
"data": [
"views/report_deliveryslip.xml",
"views/report_stockpicking_operations.xml",
"views/stock_report.xml",
],
}

View File

@@ -0,0 +1,48 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_report_custom_description
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-23 17:42+0100\n"
"PO-Revision-Date: 2017-02-23 17:55+0100\n"
"Last-Translator: Carlos Dauden <carlos.dauden@tecnativa.com>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: stock_picking_report_custom_description
#: model:ir.ui.view,arch_db:stock_picking_report_custom_description.pack_operation_product_description
msgid "<small>Description</small>"
msgstr "<small>Descripción</small>"
#. module: stock_picking_report_custom_description
#: model:ir.ui.view,arch_db:stock_picking_report_custom_description.pack_operation_product_description
msgid "<small>Qty</small>"
msgstr "<small>Ctd.</small>"
#. module: stock_picking_report_custom_description
#: model:ir.actions.report.xml,name:stock_picking_report_custom_description.action_report_delivery_description
msgid "Delivery Slip (Description)"
msgstr "Vale de entrega (descripción)"
#. module: stock_picking_report_custom_description
#: model:ir.model,name:stock_picking_report_custom_description.model_stock_pack_operation
msgid "Packing Operation"
msgstr "Operación de empaquetado"
#. module: stock_picking_report_custom_description
#: model:ir.actions.report.xml,name:stock_picking_report_custom_description.action_report_picking_description
msgid "Picking Operations (Description)"
msgstr "Operaciones de picking (descripción)"
#. module: stock_picking_report_custom_description
#: model:ir.model.fields,field_description:stock_picking_report_custom_description.field_stock_pack_operation_several_product_description
msgid "Several product description"
msgstr "Varias descripciones de producto"

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import stock

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
several_product_description = fields.Boolean(
compute='_compute_several_product_description',
)
@api.multi
def _compute_several_product_description(self):
for operation in self:
names = operation.linked_move_operation_ids.mapped('move_id.name')
operation.several_product_description = (
not all(x == names[0] for x in names))

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_delivery_document_description" inherit_id="stock.report_delivery_document" priority="99" primary="True">
<xpath expr="//tbody/tr/td/span[@t-field='pack_operation.product_id']" position="replace">
<t t-call="stock_picking_report_custom_description.pack_operation_product_description"/>
</xpath>
<xpath expr="//tr/td/span[@t-field='move.product_id']" position="attributes">
<attribute name="t-field">move.name</attribute>
</xpath>
</template>
<template id="report_deliveryslip_description">
<t t-foreach="docs" t-as="o">
<t t-call="stock_picking_report_custom_description.report_delivery_document_description"
t-lang="o.partner_id.lang"/>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_picking_description" inherit_id="stock.report_picking" priority="99" primary="True">
<xpath expr="//tbody/tr/td/span[@t-field='pack_operation.product_id']" position="replace">
<t t-call="stock_picking_report_custom_description.pack_operation_product_description"/>
</xpath>
</template>
<template id="pack_operation_product_description">
<t t-if="pack_operation.product_id">
<t t-set="distinct_description" t-value="pack_operation.several_product_description"/>
<t t-if="not distinct_description">
<span t-field="pack_operation.linked_move_operation_ids[:1].move_id.name"/>
</t>
<t t-if="distinct_description">
<span t-field="pack_operation.product_id"/>
<table class="table table-condensed">
<thead>
<tr>
<th><small>Description</small></th>
<th><small>Qty</small></th>
</tr>
</thead>
<tr t-foreach="pack_operation.linked_move_operation_ids" t-as="linked_move">
<td><small t-field="linked_move.move_id.name"/></td>
<td><small t-field="linked_move.qty"/></td>
</tr>
</table>
</t>
</t>
</template>
</odoo>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report
string="Picking Operations (Description)"
id="action_report_picking_description"
model="stock.picking"
report_type="qweb-pdf"
name="stock_picking_report_custom_description.report_picking_description"
file="stock_picking_report_custom_description.report_picking_operations_description"
/>
<report
string="Delivery Slip (Description)"
id="action_report_delivery_description"
model="stock.picking"
report_type="qweb-pdf"
name="stock_picking_report_custom_description.report_deliveryslip_description"
file="stock_picking_report_custom_description.report_deliveryslip_description"
/>
</odoo>