Selaa lähdekoodia

Módulo para la carga de orden de servicio, tipo obra.

SEBAS 1 vuosi sitten
vanhempi
commit
c0cbc44bc1

+ 2 - 5
__init__.py

@@ -1,6 +1,3 @@
 # -*- coding: utf-8 -*-
-# License, author and contributors information in:
-# __openerp__.py file at the root folder of this module.
-
-from . import models
-# from . import reports
+import models
+import reports

BIN
__init__.pyc


+ 3 - 0
__openerp__.py

@@ -33,11 +33,14 @@
         'account',
         'sale',
         'base',
+        'hr',
     ],
     'data': [
         'data/report_paperformat_servicio.xml',
         'data/sequence_servicio.xml',
         'security/ir.model.access.csv',
+        # 'reports/orden_servicio_report_xlsx.xml',
+        'reports/orden_servicio_report.xml',
         'views/orden_servicio.xml',
         'views/sale_order.xml'
     ],

+ 49 - 16
models/orden_servicio.py

@@ -72,7 +72,7 @@ class OrdenServicio(models.Model):
         string='Distancia en km'
     )
     croquis = fields.Char(
-        string='Croquis de la obra'
+        string='Croquis de la obra/Ubicación'
     )
     hrs_total = fields.Char(
         string='Hora total del trabajo'
@@ -173,6 +173,7 @@ class OrdenServicio(models.Model):
                 # Esto puede requerir personalización adicional dependiendo de tu requisito exacto
                 url = record.ubicacion_google_link
 
+
 class ProductoServicio(models.Model):
     _name = 'servicio.producto'
 
@@ -181,8 +182,8 @@ class ProductoServicio(models.Model):
         string='Orden de servicio'
     )
 
-    product_id = fields.Many2one('product.product', 'Producto')
-    categ_id = fields.Many2one('product.category', 'Categoría de producto')
+    product_id = fields.Many2one('product.product', 'Producto', domain=[('type', '=', 'product')])
+    categ_id = fields.Char('Categoría de producto')
     quantity = fields.Float(
         string='Cantidad',
         default=1,
@@ -196,6 +197,17 @@ class ProductoServicio(models.Model):
     def compute_subtotal(self):
         self.subtotal = self.quantity * self.price_unit
 
+    @api.onchange('product_id')
+    def onchange_product_id(self):
+        if self.product_id:
+            self.description = self.product_id.name
+            self.categ_id = self.product_id.categ_id.name
+            self.type = 'product' if self.product_id.type == 'product' \
+                else 'service'
+
+            # @ TODO impuestos??
+            # Obtener el precio del producto a partir de la tarifa del cliente
+            self.price_unit = self.product_id.list_price
 
 class ServicioInsumo(models.Model):
     _name = 'servicio.insumo'
@@ -206,10 +218,7 @@ class ServicioInsumo(models.Model):
         comodel_name='orden.servicio',
         string='Orden de servicio'
     )
-    product_id = fields.Many2one(
-        comodel_name='product.product',
-        string='Insumos'
-    )
+    product_id = fields.Many2one('product.product', 'Producto', domain=[('type', '=', 'product')])
     descripcion = fields.Char(
         string='Descripcion',
         required=True
@@ -238,6 +247,7 @@ class ServicioInsumo(models.Model):
     def onchange_product_id(self):
         if self.product_id:
             self.description = self.product_id.name
+            self.price_unit = self.product_id.list_price
 
 class ServicioLogistica(models.Model):
     _name = 'servicio.logistica'
@@ -248,16 +258,17 @@ class ServicioLogistica(models.Model):
         comodel_name='orden.servicio',
         string='Orden de servicio'
     )
-    product_id = fields.Many2one(
-        comodel_name='product.product',
-        string='Servicios'
+    fecha = fields.Date(
+        string='Fecha',
+        required=True
     )
+    product_id = fields.Many2one('product.product', 'Servicio', domain=[('type', '=', 'service'), ('categ_id', '=', 'Gastos')])
     descripcion = fields.Char(
         string='Descripcion',
         required=True
     )
     quantity = fields.Float(
-        string='Cantidad',
+        string='Km recorrido',
         default=1
     )
     price_unit = fields.Float(
@@ -274,6 +285,13 @@ class ServicioLogistica(models.Model):
     def compute_subtotal(self):
         self.subtotal = self.quantity * self.price_unit
 
+    @api.onchange('product_id')
+    def onchange_product_id(self):
+        if self.product_id:
+            self.description = self.product_id.name
+            self.price_unit = self.product_id.list_price
+
+
 class DevolucionInsumo(models.Model):
     _name = 'devolucion.insumo'
     _description = 'Devolución de productos e insumos'
@@ -283,10 +301,7 @@ class DevolucionInsumo(models.Model):
         comodel_name='orden.servicio',
         string='Orden de servicio'
     )
-    product_id = fields.Many2one(
-        comodel_name='product.product',
-        string='Productos e insumos'
-    )
+    product_id = fields.Many2one('product.product', 'Producto', domain=[('type', '=', 'product')])
     descripcion = fields.Char(
         string='Descripcion',
         required=True
@@ -311,6 +326,12 @@ class DevolucionInsumo(models.Model):
     def compute_subtotal(self):
         self.subtotal = self.quantity * self.price_unit
 
+    @api.onchange('product_id')
+    def onchange_product_id(self):
+        if self.product_id:
+            self.description = self.product_id.name
+            self.price_unit = self.product_id.list_price
+
 
 class RecepcionFabrica(models.Model):
     _name = 'recepcion.fabrica'
@@ -321,6 +342,10 @@ class RecepcionFabrica(models.Model):
         comodel_name='orden.servicio',
         string='Orden de servicio'
     )
+    fecha = fields.Date(
+        string='Fecha',
+        required=True
+    )
     product_id = fields.Many2one(
         comodel_name='product.product',
         string='Productos'
@@ -341,13 +366,21 @@ class RecepcionFabrica(models.Model):
         compute='compute_subtotal',
         digits=(10, 0)
     )
+    employee_id = fields.Many2one(
+    'hr.employee',
+    string='Empleado'
+    )
 
     @api.one
     @api.depends('quantity', 'price_unit')
     def compute_subtotal(self):
         self.subtotal = self.quantity * self.price_unit
 
-
+    @api.onchange('product_id')
+    def onchange_product_id(self):
+        if self.product_id:
+            self.description = self.product_id.name
+            self.price_unit = self.product_id.list_price
 
 class AccountInvoice(models.Model):
     _inherit = 'account.invoice'

BIN
models/orden_servicio.pyc


+ 1 - 4
reports/__init__.py

@@ -1,5 +1,2 @@
 # -*- coding: utf-8 -*-
-# License, author and contributors information in:
-# __openerp__.py file at the root folder of this module.
-
-from . import parser
+# import orden_servicio_report

BIN
reports/__init__.pyc


BIN
reports/orden_servicio_report.pyc


+ 46 - 0
reports/orden_servicio_report.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- Vista del informe -->
+        <report
+            id="report_orden_servicio"
+            model="orden.servicio"
+            string="Orden de Servicio Report"
+            report_type="qweb-pdf"
+            name="orden_servicio.report_orden_servicio1"
+            file="orden_servicio.report_orden_servicio1"
+            attachment_use="False"
+        />
+
+        <!-- Plantilla del informe en formato PDF -->
+        <template id="report_orden_servicio1">
+            <t t-call="report.html_container">
+                <t t-foreach="docs" t-as="o">
+                    <t t-call="report.external_layout">
+                        <div class="page">
+                            <h2>Orden de Servicio</h2>
+                            <table class="table table-condensed">
+                                <thead>
+                                    <tr>
+                                        <th>Referencia</th>
+                                        <th>Cliente</th>
+                                        <th>Fecha de Orden</th>
+                                        <th>Estado</th>
+                                    </tr>
+                                </thead>
+                                <tbody>
+                                    <tr>
+                                        <td><span t-field="o.name"/></td>
+                                        <td><span t-field="o.partner_id.name"/></td>
+                                        <td><span t-field="o.order_date"/></td>
+                                        <td><span t-field="o.state"/></td>
+                                    </tr>
+                                </tbody>
+                            </table>
+                        </div>
+                    </t>
+                </t>
+            </t>
+        </template>
+    </data>
+</openerp>

+ 0 - 95
reports/parser.py

@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-# License, author and contributors information in:
-# __openerp__.py file at the root folder of this module.
-
-from functools import partial
-from openerp.osv import osv
-from openerp import exceptions, _
-from reportlab.graphics.barcode import createBarcodeDrawing
-
-
-class PartnerReport(osv.AbstractModel):
-    _name = 'report.repair_workorder_mejorado.partner_report'
-
-    def get_total(self, cr, uid, workorder, context=None):
-        total = 0
-        for line_consumed in workorder.consumed_ids:
-            total += line_consumed.quantity * line_consumed.price_unit
-        return total
-
-    def render_html(self, cr, uid, ids, data=None, context=None):
-        report_obj = self.pool['report']
-        repair_workorder_obj = self.pool['repair.workorderimproved']
-        report = report_obj._get_report_from_name(
-            cr, uid, 'repair_workorder_mejorado.partner_report')
-        selected_orders = repair_workorder_obj.browse(
-            cr, uid, ids, context=context)
-
-        docargs = {
-            'doc_ids': ids,
-            'doc_model': report.model,
-            'docs': selected_orders,
-            'get_total': partial(
-                self.get_total, cr, uid, context=context),
-            'printBarcode': partial(
-                self.printBarcode, cr, uid, context=context),
-        }
-
-        return report_obj.render(
-            cr, uid, ids, 'repair_workorder_mejorado.partner_report',
-            docargs, context=context)
-
-    def printBarcode(self, cr, uid, value, width, height, context=None):
-        try:
-            width, height = int(width), int(height)
-            barcode = createBarcodeDrawing(
-                'EAN13', value=value, format='png', width=width, height=height)
-            barcode = barcode.asString('png')
-            barcode = barcode.encode('base64', 'strict')
-        except (ValueError, AttributeError):
-            raise exceptions.Warning(_('Cannot convert into barcode.'))
-
-        return barcode
-
-
-class CompanyReport(osv.AbstractModel):
-    _name = 'report.repair_workorder_mejorado.company_report'
-
-    def get_total(self, cr, uid, workorder, context=None):
-        total = 0
-        for line_consumed in workorder.consumed_ids:
-            total += line_consumed.quantity * line_consumed.price_unit
-        return total
-
-    def render_html(self, cr, uid, ids, data=None, context=None):
-        report_obj = self.pool['report']
-        repair_workorder_obj = self.pool['repair.workorderimproved']
-        report = report_obj._get_report_from_name(
-            cr, uid, 'repair_workorder_mejorado.company_report')
-        selected_orders = repair_workorder_obj.browse(
-            cr, uid, ids, context=context)
-
-        docargs = {
-            'doc_ids': ids,
-            'doc_model': report.model,
-            'docs': selected_orders,
-            'get_total': partial(
-                self.get_total, cr, uid, context=context),
-            'printBarcode': partial(
-                self.printBarcode, cr, uid, context=context),
-        }
-        return report_obj.render(
-            cr, uid, ids, 'repair_workorder_mejorado.company_report',
-            docargs, context=context)
-
-    def printBarcode(self, cr, uid, value, width, height, context=None):
-        try:
-            width, height = int(width), int(height)
-            barcode = createBarcodeDrawing(
-                'EAN13', value=value, format='png', width=width, height=height)
-            barcode = barcode.asString('png')
-            barcode = barcode.encode('base64', 'strict')
-        except (ValueError, AttributeError):
-            raise exceptions.Warning(_('Cannot convert into barcode.'))
-
-        return barcode

BIN
reports/parser.pyc


+ 0 - 181
reports/work_order_company.xml

@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-
-        <!-- Declarar el informe -->
-        <report
-            id="action_orden_servicio_company_report"
-            string="Orden de servicio"
-            model="orden.servicio"
-            report_type="qweb-pdf"
-            name="orden_servicio.company_report"
-            file="servicio_company"
-         />
-
-        <record id="action_orden_servicio_report" model="ir.actions.report.xml">
-            <field name="paperformat_id" ref="orden_servicio.paperformat_orden_servicio"/>
-        </record>
-
-        <!-- Informe -->
-        <template id="company_report">
-            <t t-call="report.html_container">
-                <t t-foreach="doc_ids" t-as="doc_id">
-                    <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'orden_servicio.company_report_document')"/>
-                </t>
-            </t>
-        </template>
-
-        <template id="servicio_company">
-            <div class="page">
-                <style>
-                    body {
-                        color: #000;
-                        font-family: Arial, Helvetica, sans-serif;
-                        font-size: 14px;
-                        letter-spacing: 0.0px;
-                        line-height: 20px;
-                        margin:0;
-                        padding:0;
-                        word-spacing:1px;
-                    }
-                    .text-lg {
-                        font-size: 18px;
-                        font-weight: bold;
-                    }
-                    .text-md {
-                        display: inline-block;
-                        font-size: 18px;
-                        font-weight: bold;
-                    }
-                    .bordered {
-                        border: 1px solid #000;
-                        padding: 10px;
-                    }
-                    /* http://www.squareonemd.co.uk/how-to-crop-an-image-with-a-css-class/ */
-                    .image-container {
-                        width: 366px;
-                        text-align: center;
-                    }
-                    .image-cropper {
-                        position: relative;
-                        height: 45px;
-                        overflow: hidden;
-                    }
-                    .centered {
-                        position: absolute;
-                        left: -50%;
-                        top: -50%;
-                        max-width: 100%;
-                    }
-                    .bottom {
-                        position: absolute;
-                        bottom: 0px;
-                        max-width: 100%;
-                    }
-                    .top {
-                        position: absolute;
-                        top: 0px;
-                        max-width: 100%;
-                    }
-                    .separator {
-                        border-top: 1px solid #000;
-                        margin-top: 20px;
-                        margin-bottom: 20px;
-                    }
-                </style>
-                <section class="header">
-                    <div class="row">
-                        <div class="col-xs-12">
-                        <p class="text-center" style="margin-top: 10px; margin-bottom: 10px;"><span class="text-lg">PARTE TRABAJO <span t-if="o.name" t-field="o.name"/></span></p>
-                        <div class="image-container">
-                            <div class="image-cropper">
-                                <img class="top" t-att-src="'data:image/png;base64,%s' % printBarcode(o.id, 732, 472)"/>
-                            </div>
-                        </div>
-                        </div>
-                    </div>
-                </section>
-                <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                <div class="row">
-                    <div class="col-xs-12">
-                        MATERIAL A RECOGER<br/>
-                        <t t-if="o.line_ids">
-                            <table class="order_lines" style="width: 100%;">
-                                <thead>
-                                    <tr>
-                                        <th style="width: 75%;">Concepto</th>
-                                        <th style="width: 25%;" class="text-right">Uds.</th>
-                                    </tr>
-                                </thead>
-                                <tbody>
-                                    <t t-foreach="o.line_ids" t-as="line">
-                                        <tr>
-                                            <td><span t-if="line.description" t-field="line.description"></span></td>
-                                            <td class="text-right"><span t-if="line.quantity" t-field="line.quantity"></span></td>
-                                        </tr>
-                                    </t>
-                                </tbody>
-                            </table>
-                        </t>
-                        <br/>
-                        <span class="text-md">Fecha Recogida: <span t-if="o.planned_end_date" t-field="o.planned_end_date"/></span><br/>
-                        Cliente: <span t-if="o.partner_id.name" t-field="o.partner_id.name"/><br/>
-                        Teléfono: <span t-if="o.partner_id.phone" t-field="o.partner_id.phone"/><t t-if="o.partner_id.mobile"> - <span t-field="o.partner_id.mobile"/></t><br/>
-                        Fecha Entrada: <span t-if="o.order_date" t-field="o.order_date"/>
-                    </div>
-                </div>
-                <t t-if="o.consumed_ids">
-                    <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                    <table class="consumed_lines" style="width: 100%;">
-                        <thead>
-                            <tr>
-                                <th style="width: 45%;">Concepto</th>
-                                <th style="width: 15%;" class="text-right">Uds.</th>
-                                <th style="width: 20%;" class="text-right">Precio</th>
-                                <th style="width: 20%;" class="text-right">Subtotal</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            <t t-foreach="o.consumed_ids" t-as="consumed">
-                                <tr>
-                                    <td><span t-if="consumed.description" t-field="consumed.description"/></td>
-                                    <td class="text-right"><span t-if="consumed.quantity" t-field="consumed.quantity"/></td>
-                                    <td class="text-right"><span t-if="consumed.price_unit" t-field="consumed.price_unit"/></td>
-                                    <td class="text-right"><span t-if="consumed.subtotal and consumed.price_unit" t-raw="consumed.quantity * consumed.price_unit"/></td>
-                                </tr>
-                            </t>
-                        </tbody>
-                    </table>
-                    <t t-set="total" t-value="get_total(o)"/>
-                    <p class="text-right" style="margin-top: 10px; margin-bottom: 0px;">Total <span class="text-md" t-esc="total"></span></p>
-                </t>
-                <t t-if="o.causes">
-                    <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                    <div class="row">
-                        <div class="col-xs-12">
-                            <div t-field="o.causes"/>
-                        </div>
-                    </div>
-                </t>
-                <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                <div class="row">
-                    <div class="col-xs-6">
-                        <p class="text-center bordered sign"><br/><br/><br/><br/>Firma cliente</p>
-                    </div>
-                    <div class="col-xs-6">
-                        <p class="agreement">Doy mi consentimiento para la realización de las operaciones y montaje del material aquí descritos.</p>
-                    </div>
-                </div>
-            </div>
-        </template>
-
-        <!-- Contenido del informe -->
-        <template id="company_report_document">
-            <t t-call="report.html_container">
-                <t t-call="repair_workorder_mejorado.workorder_company"/>
-            </t>
-        </template>
-
-
-    </data>
-</openerp>

+ 0 - 191
reports/work_order_partner.xml

@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-
-        <!-- Declarar el informe -->
-        <report
-            id="action_work_order_partner_mejorado_report"
-            string="Work order (partner copy)"
-            model="repair.workorderimproved"
-            report_type="qweb-pdf"
-            name="repair_workorder_mejorado.partner_report"
-            file="workorder_partner"
-         />
-
-        <record id="action_work_order_partner_mejorado_report" model="ir.actions.report.xml">
-            <field name="paperformat_id" ref="repair_workorder_mejorado.paperformat_repair_workorder"/>
-        </record>
-
-        <!-- Informe -->
-        <template id="partner_report">
-            <t t-call="report.html_container">
-                <t t-foreach="doc_ids" t-as="doc_id">
-                    <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'repair_workorder_mejorado.partner_report_document')"/>
-                </t>
-            </t>
-        </template>
-
-        <template id="workorder_partner">
-            <div class="page">
-                <style>
-                    body {
-                        color: #000;
-                        font-family: Arial, Helvetica, sans-serif;
-                        font-size: 14px;
-                        letter-spacing: 0.0px;
-                        line-height: 20px;
-                        margin:0;
-                        padding:0;
-                        word-spacing:1px;
-                    }
-                    .text-lg {
-                        font-size: 18px;
-                        font-weight: bold;
-                    }
-                    .text-md {
-                        display: inline-block;
-                        font-size: 18px;
-                        font-weight: bold;
-                    }
-                    .bordered {
-                        border: 1px solid #000;
-                        padding: 10px;
-                    }
-                    /* http://www.squareonemd.co.uk/how-to-crop-an-image-with-a-css-class/ */
-                    .image-container {
-                        width: 366px;
-                        text-align: center;
-                    }
-                    .image-cropper {
-                        position: relative;
-                        height: 45px;
-                        overflow: hidden;
-                    }
-                    .centered {
-                        position: absolute;
-                        left: -50%;
-                        top: -50%;
-                        max-width: 100%;
-                    }
-                    .bottom {
-                        position: absolute;
-                        bottom: 0px;
-                        max-width: 100%;
-                    }
-                    .top {
-                        position: absolute;
-                        top: 0px;
-                        max-width: 100%;
-                    }
-                    .separator {
-                        border-top: 1px solid #000;
-                        margin-top: 20px;
-                        margin-bottom: 20px;
-                    }
-                </style>
-                <section class="header">
-                    <div class="row">
-                        <div class="col-xs-12">
-                            <p class="text-center" style="margin-top: 10px; margin-bottom: 10px;"><span class="text-lg">COMPROBANTE SAT <span t-if="o.name" t-field="o.name"/></span></p>
-                            <div class="image-container">
-                                <div class="image-cropper">
-                                    <img class="top" t-att-src="'data:image/png;base64,%s' % printBarcode(o.id, 732, 472)"/>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </section>
-                <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                <div class="row">
-                    <div class="col-xs-12">
-                        MATERIAL A RECOGER<br/>
-                        <t t-if="o.line_ids">
-                            <table class="order_lines" style="width: 100%;">
-                                <thead>
-                                    <tr>
-                                        <th style="width: 75%;">Concepto</th>
-                                        <th style="width: 25%;" class="text-right">Uds.</th>
-                                    </tr>
-                                </thead>
-                                <tbody>
-                                    <t t-foreach="o.line_ids" t-as="line">
-                                        <tr>
-                                            <td><span t-if="line.description" t-field="line.description"></span></td>
-                                            <td class="text-right"><span t-if="line.quantity" t-field="line.quantity"></span></td>
-                                        </tr>
-                                    </t>
-                                </tbody>
-                            </table>
-                        </t>
-                        <br/>
-                        Cliente: <span t-if="o.partner_id.name" t-field="o.partner_id.name"/><br/>
-                        Teléfono: <span t-if="o.partner_id.phone" t-field="o.partner_id.phone"/><t t-if="o.partner_id.mobile"> - <span t-field="o.partner_id.mobile"/></t><br/>
-                        Fecha Entrada: <span t-if="o.order_date" t-field="o.order_date"/><br/>
-                        Fecha Recogida: <span t-if="o.planned_end_date" t-field="o.planned_end_date"/>
-                    </div>
-                </div>
-                <t t-if="o.consumed_ids">
-                    <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                    <table class="consumed_lines" style="width: 100%;">
-                        <thead>
-                            <tr>
-                                <th style="width: 45%;">Concepto</th>
-                                <th style="width: 15%;" class="text-right">Uds.</th>
-                                <th style="width: 20%;" class="text-right">Precio</th>
-                                <th style="width: 20%;" class="text-right">Subtotal</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            <t t-foreach="o.consumed_ids" t-as="consumed">
-                                <tr>
-                                    <td><span t-if="consumed.description" t-field="consumed.description"/></td>
-                                    <td class="text-right"><span t-if="consumed.quantity" t-field="consumed.quantity"/></td>
-                                    <td class="text-right"><span t-if="consumed.price_unit" t-field="consumed.price_unit"/></td>
-                                    <td class="text-right"><span t-if="consumed.subtotal and consumed.price_unit" t-raw="consumed.quantity * consumed.price_unit"/></td>
-                                </tr>
-                            </t>
-                        </tbody>
-                    </table>
-                    <t t-set="total" t-value="get_total(o)"/>
-                    <p class="text-right" style="margin-top: 10px; margin-bottom: 0px;">Total <span class="text-md" t-esc="total"></span> EUR</p>
-
-                </t>
-                <section class="warning">
-                    <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                    <div class="row">
-                        <div class="col-xs-12">
-                            <p style="text-align: justify; margin-bottom: 0px;">
-                                <small class="warning-text">Presupuesto estimado, si durante la reparación el importe se modificara sustancialmente se consultará al cliente para su aprobación.</small>
-                            </p>
-                        </div>
-                    </div>
-                </section>
-                <t t-if="o.partner_id.company_id">
-                    <div class="row"><div class="col-xs-12"><div class="separator"/></div></div>
-                    <div class="row">
-                        <div class="col-xs-12">
-                            <p class="company-info text-center">
-                                <t t-if="o.partner_id.company_id.name"><span t-field="o.partner_id.company_id.name"/></t>
-                                <t t-if="o.partner_id.company_id.street">- <span t-field="o.partner_id.company_id.street"/>,</t>
-                                <t t-if="o.partner_id.company_id.zip"> <span t-field="o.partner_id.company_id.zip"/></t>
-                                <t t-if="o.partner_id.company_id.city">- <span t-field="o.partner_id.company_id.city"/></t>
-                                <t t-if="o.partner_id.company_id.state_id">(<span t-field="o.partner_id.company_id.state_id.name"/>)</t>
-                                <t t-if="o.partner_id.company_id.phone">- <span t-field="o.partner_id.company_id.phone"/></t>
-                                <t t-if="o.partner_id.company_id.email">- <span t-field="o.partner_id.company_id.email"/></t>
-                                <t t-if="o.partner_id.company_id.website">- <span t-field="o.partner_id.company_id.website"/></t>
-                            </p>
-                        </div>
-                    </div>
-                </t>
-            </div>
-        </template>
-
-        <!-- Contenido del informe -->
-        <template id="partner_report_document">
-            <t t-call="report.html_container">
-                <t t-call="repair_workorder_mejorado.workorder_partner"/>
-            </t>
-        </template>
-
-    </data>
-</openerp>

+ 16 - 8
views/orden_servicio.xml

@@ -143,12 +143,7 @@
                                 <field name="fotos_obras" widget="many2many_binary"/>
                             </page>
                         </notebook>
-                        <notebook>
-                            <page>
-                                <span style="font-weight:bold;">Facturas relacionadas a esta Orden de Servicio</span>
-                                <field name="invoice_ids"/>
-                            </page>
-                        </notebook>
+
                         <notebook>
                             <page>
                                 <span style="font-weight:bold;">Productos a utilizar</span>
@@ -180,6 +175,12 @@
                                 <field name="recepcion_ids" attrs="{'readonly': [('state','=','done')]}"/>
                             </page>
                         </notebook>
+                        <notebook>
+                            <page>
+                                <span style="font-weight:bold;">Facturas relacionadas a esta Orden de Servicio</span>
+                                <field name="invoice_ids"/>
+                            </page>
+                        </notebook>
                         <group>
                                 <field name="obs_obra"/>
                         </group>
@@ -349,11 +350,12 @@
              <field name="model">servicio.logistica</field>
              <field name="arch" type="xml">
                  <tree string="Gastos de logística" editable="bottom">
+                     <field name="fecha"/>
                      <field name="product_id"/>
                      <field name="descripcion"/>
                      <field name="quantity"/>
                      <field name="price_unit"/>
-                     <field name="subtotal"/>
+                     <field name="subtotal" sum="total"/>
                  </tree>
              </field>
            </record>
@@ -379,11 +381,12 @@
                       <form string="Gastos de logística">
                           <sheet>
                               <group>
+                                  <field name="fecha"/>
                                   <field name="product_id"/>
                                   <field name="descripcion"/>
                                   <field name="quantity"/>
                                   <field name="price_unit"/>
-                                  <field name="subtotal"/>
+                                  <field name="subtotal" sum="total"/>
                               </group>
                           </sheet>
                       </form>
@@ -460,11 +463,13 @@
                                  <field name="model">recepcion.fabrica</field>
                                  <field name="arch" type="xml">
                                      <tree string="Recepción en fábrica" editable="bottom">
+                                       <field name="fecha"/>
                                        <field name="product_id"/>
                                        <field name="descripcion"/>
                                        <field name="quantity"/>
                                        <field name="price_unit"/>
                                        <field name="subtotal"/>
+                                       <field name="employee_id"/>
                                      </tree>
                                  </field>
                                </record>
@@ -479,6 +484,7 @@
                                             <field name="quantity"/>
                                             <field name="price_unit"/>
                                             <field name="subtotal"/>
+                                            <field name="employee_id"/>
                                           </search>
                                       </field>
                                   </record>
@@ -490,11 +496,13 @@
                                           <form string="Recepción en fábrica">
                                               <sheet>
                                                   <group>
+                                                     <field name="fecha"/>
                                                      <field name="product_id"/>
                                                      <field name="descripcion"/>
                                                      <field name="quantity"/>
                                                      <field name="price_unit"/>
                                                      <field name="subtotal"/>
+                                                     <field name="employee_id"/>
                                                   </group>
                                               </sheet>
                                           </form>