Przeglądaj źródła

Nota de remisión desde pedidos de ventas también impresión.

Sebas 5 lat temu
commit
183e50a976

+ 27 - 0
__init__.py

@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_brand for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product Brand is an Openobject module wich enable Brand management for products #
+###################################################################################
+from . import nota_remision

BIN
__init__.pyc


+ 47 - 0
__openerp__.py

@@ -0,0 +1,47 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_features for OpenERP                                               #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Victor Obrist                                                     #
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module wich enable features management for products #
+###################################################################################
+{
+    'name': 'Nota de Remisión ',
+    'version': '0.1',
+    'category': 'Sales',
+    'description': """
+Nota de Remisión
+==========================
+
+Permite crear una nota de remisión a partir del pedido de venta.
+
+    """,
+    'author': 'Eiru Software',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['sale'],
+    'data': [
+        'nota_remision_view.xml',
+        'nota_remision_workflow.xml',
+        'nota_remision_sequence.xml',
+        'nota_remision_print.xml',
+        'security/ir.model.access.csv',
+    ],
+    'installable': True,
+}

+ 267 - 0
nota_remision.py

@@ -0,0 +1,267 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_features for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+#################################################################################
+
+from openerp import models, fields, api, _
+import openerp.addons.decimal_precision as dp
+
+class sale_nota_remision(models.Model):
+    _name = "sale.nota.remision"
+    _description = "Nota de referencia de orden de venta"
+
+    def validar(self):
+        print 'Confirmar'
+        self.state = 'progress'
+        return True
+
+    #data fields for partner
+    @api.multi
+    @api.depends('partner_id')
+    def _partner_data(self):
+        self.partner_ruc = self.partner_id.ruc
+        self.partner_phone = self.partner_id.phone
+        self.partner_mobile = self.partner_id.mobile
+        self.partner_company = self.partner_id.company_id.id
+
+    #data fields for salesman
+    @api.multi
+    @api.depends('user_id')
+    def _user_data(self):
+        self.user_ruc = self.user_id.ruc
+        self.user_phone = self.user_id.phone
+        self.user_mobile = self.user_id.mobile
+
+     #data fields for vehicle
+    # @api.multi
+    # @api.depends('vehicle_id')
+    # def _vehicle_data(self):
+    #     self.vehicle_plate = self.vehicle_id.license_plate
+    #     self.driver_id = self.vehicle_id.driver_id
+
+    #data fields for driver
+    @api.multi
+    @api.depends('driver_id')
+    def _driver_data(self):
+        self.driver_ruc = self.driver_id.ruc
+        self.driver_phone = self.driver_id.phone
+        self.driver_mobile = self.driver_id.mobile
+
+    #data fields for logistic
+    @api.multi
+    @api.depends('logistic_company_id')
+    def _logistic_data(self):
+        self.logistic_ruc = self.logistic_company_id.ruc
+        self.logistic_phone = self.logistic_company_id.phone
+        self.logistic_mobile = self.logistic_company_id.mobile
+
+    @api.model
+    def create(self, vals):
+        nota_id = super(sale_nota_remision,self).create(vals)
+        # vals['name']=self.pool.get('ir.sequence').get(cr, uid, 'sale.order') or '/'
+        nota_id.name=self.pool.get('ir.sequence').get(self.env.cr, self.env.uid, 'sale.nota.remision') or '/'
+        return nota_id
+
+
+    # fields
+    name = fields.Char(string='Referencia/Descripción', index=True, readonly=True)
+    origin = fields.Char(string='Documento Origen ', help="Referencia del documento que produjo esta nota.", readonly=True)
+
+    #partner data
+    partner_id = fields.Many2one('res.partner', string='Cliente', required=True)
+    partner_ruc = fields.Char(string='R.U.C./C.I.',compute='_partner_data')
+    partner_phone = fields.Char(string='Teléfono',compute='_partner_data')
+    partner_mobile = fields.Char(string='Telef. Móvil',compute='_partner_data')
+    #company address
+    partner_company = fields.Many2one('res.company', string='Empresa')
+
+    #commercial data
+    user_id = fields.Many2one('res.users', 'Vendedor', select=True)
+    user_ruc = fields.Char(string='R.U.C./C.I. Vendedor',compute='_user_data')
+    user_phone = fields.Char(string='Teléfono',compute='_user_data')
+    user_mobile = fields.Char(string='Telef. Móvil',compute='_user_data')
+
+    #logistic data
+    logistic_company_id = fields.Many2one('res.partner', 'Compañia Logística', select=True)
+    logistic_ruc = fields.Char(string='R.U.C./C.I. Compañia Logística',compute='_logistic_data')
+    logistic_phone = fields.Char(string='Teléfono',compute='_logistic_data')
+    logistic_mobile = fields.Char(string='Telef. Móvil',compute='_logistic_data')
+
+    state = fields.Selection(
+                [('cancel', 'Cancelado'),('draft', 'Borrador'),('progress', 'En progreso'),('done', 'Realizado')],
+                'Status', required=True, readonly=True, copy=False,
+                help='* El estado de \'Borrador\' se establece cuando la nota relacionada se ordena en estado de borrador. \
+                    \n* El estado de \'Progreso\' se establece cuando el orden de las notas relacionadas está en curso. \
+                    \n* El estado de \'Realizado\' se establece cuando se selecciona la línea de orden de nota.\
+                    \n* El estado \'Cancelado\' se establece cuando un usuario cancela el pedido de notas relacionado')
+
+    #Transfer details
+    initial_transfer_date = fields.Datetime('Fecha de transferencia inicial')
+    finish_transfer_date = fields.Datetime('Fecha de transferencia finalizada')
+
+    #Vehicle and Logistic details
+    vehicle_name = fields.Char('Vehículo')
+    vehicle_plate = fields.Char('Nro. de la Chapa')
+
+    #Driver details
+    driver_id = fields.Many2one('res.partner','Chófer')
+    driver_ruc = fields.Char(string='R.U.C./C.I. Chófer',compute='_driver_data')
+    driver_phone = fields.Char(string='Teléfono',compute='_driver_data')
+    driver_mobile = fields.Char(string='Telef. Móvil',compute='_driver_data')
+
+    #Transfer motives
+    is_sale = fields.Boolean('Venta:')
+    is_purchase = fields.Boolean('Compra:')
+    is_export = fields.Boolean('Exportación:')
+    is_import= fields.Boolean('Importación:')
+    is_consignment = fields.Boolean('Consignación:')
+    is_return = fields.Boolean('Devolución:')
+    is_intertal_transfer = fields.Boolean('Transferencia interna entre almacenes:')
+    is_transformation_transfer = fields.Boolean('Transferencia de transformación:')
+    is_repair_transfer = fields.Boolean('Transferencia de reparación:')
+    is_movil_transfer = fields.Boolean('Transferencia Movil:')
+    is_exhibition = fields.Boolean('Exhibición/Demostración:')
+    is_fair = fields.Boolean('Participación justa:')
+
+    another_transfer = fields.Text('Otro motivo de transferencia')
+    sale_voucher = fields.Char('Recibo de venta')
+    obs_remision = fields.Text('Observación')
+
+    nota_line = fields.One2many('sale.nota.remision.line', 'nota_remision_id', 'Líneas de nota de remisión', readonly=True, states={'draft': [('readonly', False)]}, copy=True)
+    amount_total = fields.Float('Monto Total',readonly=True)
+
+    _defaults = {
+        'state': 'draft',
+        'is_consignment': True,
+        'name': lambda obj, cr, uid, context: '/',
+    }
+
+class sale_nota_remision_line(models.Model):
+    _name = 'sale.nota.remision.line'
+    _description = "Referencia de orden de venta"
+
+    @api.one
+    @api.model
+    def _amount_line(self):
+        for line in self.ids:
+            line_obj = self.env['sale.nota.remision.line'].search([('id','=',line)])
+            price = line_obj.price_unit*(1 - (line_obj.discount or 0.0) / 100.0)
+            self.price_subtotal = price*line_obj.product_uom_qty
+
+    #fields
+    nota_remision_id = fields.Many2one('sale.nota.remision', 'Nota Referencia', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]})
+    name = fields.Text('Descripción', required=True, readonly=True, states={'draft': [('readonly', False)]})
+    product_id = fields.Many2one('product.product', 'Producto', domain=[('sale_ok', '=', True)], change_default=True, readonly=True, states={'draft': [('readonly', False)]}, ondelete='restrict')
+    product_uom_qty = fields.Float('Cantidad', digits_compute= dp.get_precision('Product UoS'), required=True, readonly=True, states={'draft': [('readonly', False)]})
+    price_unit = fields.Float('Precio Unit.', required=True, digits_compute= dp.get_precision('Product Price'), readonly=True, states={'draft': [('readonly', False)]})
+    discount = fields.Float('Descuento (%)', digits_compute= dp.get_precision('Discount'), readonly=True, states={'draft': [('readonly', False)]})
+    price_subtotal = fields.Float(compute='_amount_line', string='Subtotal')
+    # price_subtotal = fields.Float(compute='_amount_line', string='Subtotal', digits_compute= dp.get_precision('Account'))
+    state = fields.Selection(
+               [('cancel', 'Cancelado'),('draft', 'Borrador'),('progress', 'En progreso'),('done', 'Realizado')],
+                'Status', required=True, readonly=True, copy=False,
+                help='* The \'Draft\' status is set when the related note order in draft status. \
+                    \n* The \'Progress\' status is set when the related note order is in progress. \
+                    \n* The \'Done\' status is set when the note order line has been picked. \
+                    \n* The \'Cancelled\' status is set when a user cancel the note order related.')
+
+    _order = 'nota_remision_id desc, id'
+    _defaults = {
+        'state': 'draft',
+    }
+
+class sale_order(models.Model):
+    _name = 'sale.order'
+    _inherit = 'sale.order'
+
+    @api.multi
+    def _note_reference_exists(self):
+        print self.note_reference_ids
+        if self.note_reference_ids:
+            self.note_reference_exists=True
+        else:
+            self.note_reference_exists=False
+
+    note_reference_exists = fields.Boolean(string="Nota existe", compute='_note_reference_exists', store="True")
+    note_reference_ids = fields.Many2one('sale.nota.remision', 'Referencia Nota')
+
+    @api.multi
+    def action_button_view_note(self):
+        # print 'Ver Nota'
+        return {
+            'type': 'ir.actions.act_window',
+            'res_model': 'sale.nota.remision',
+            'view_type': 'form',
+            'view_mode': 'form',
+            'target': 'current',
+            'res_id':self.note_reference_ids.id,
+        }
+
+    @api.multi
+    def action_button_create_note(self):
+        # print "Crear Nota de Remision"
+        # print self.partner_id.id
+
+        # print self
+
+        nsr = self.env['sale.nota.remision'].search([('origin','=',self.name)])
+        if not nsr:
+            valores = {'partner_id':self.partner_id.id,
+                       'origin':self.name,
+                       'initial_transfer_date':self.date_order,
+                       'user_id':self.user_id.id,
+                       'amount_total':self.amount_total,
+                       'partner_company':self.partner_id.company_id.id,
+                      }
+
+            #crear la nota de remision
+
+            # print 'Nota creada'
+            nr = self.env['sale.nota.remision'].create(valores)
+            # print nr
+            if nr:
+                self.note_reference_ids=nr
+                self._note_reference_exists()
+                #copiar las lineas del pedido
+                for line in self.order_line:
+                    # print line
+                    # print line.product_id
+                    line_order = self.env['sale.order.line'].search([('id','=',line.id)])
+                    if line_order:
+                        valores = {'nota_remision_id':nr[0].id,
+                                   'product_id':line_order[0].product_id.id,
+                                   'name':line_order[0].name,
+                                   'product_uom_qty':line_order[0].product_uom_qty,
+                                   'price_unit':line_order[0].price_unit,
+                                   'discount':line_order[0].discount,
+                                  }
+
+                        nrl = self.env['sale.nota.remision.line'].create(valores)
+
+        # else:
+        #     print 'La Nota ya existe'
+
+        return True
+
+    _defaults = {
+        'note_reference_exists':False,
+    }

BIN
nota_remision.pyc


+ 417 - 0
nota_remision_print.xml

@@ -0,0 +1,417 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+    <report id="nota_remision"
+            model="sale.nota.remision"
+            string="Nota Remision"
+            report_type="qweb-pdf"
+            name="nota_remision_standard.report_nota_remision"
+            file="nota_remision_standard.report_nota_remision"
+    />
+
+    <template id="new_external_layout">
+        <!-- Multicompany -->
+        <t t-if="o and 'company_id' in o">
+            <t t-set="company" t-value="o.company_id"></t>
+        </t>
+        <t t-if="not o or not 'company_id' in o">
+            <t t-set="company" t-value="res_company"></t>
+        </t>
+
+        <t t-call="nota_remision_standard.new_external_layout_header" />
+        <t t-raw="0" />
+
+    </template>
+
+    <template id="new_external_layout_header">
+        <div class="header">
+            <div class="row">
+
+              <div class="col-xs-8">
+                <div>
+                  <strong><span t-field="company.partner_id" style="font-size:20px"/></strong>
+                </div>
+                <div t-field="company.rml_header1"/>
+                <div>
+                  <span>R.U.C:</span>
+                  <span t-field="company.partner_id.ruc"/>
+                </div>
+
+                <div t-field="company.street"/>
+                <div t-field="company.street2"/>
+                <div t-field="company.state_id"/>
+                <div t-field="company.country_id"/>
+
+              </div>
+
+                  <div class="col-xs-4">
+                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 100px; float:right"/>
+                  </div>
+                </div>
+            <div class="row zero_min_height">
+                <div class="col-xs-12">
+                    <div style="border-bottom: 1px solid black;"></div>
+                </div>
+            </div>
+
+        </div>
+    </template>
+
+
+    <template id="report_nota_remision">
+    <t t-call="report.html_container">
+        <t t-call="nota_remision_standard.new_external_layout">
+            <t t-foreach="docs" t-as="o">
+                <div class="page">
+                    <style>
+                        h5{
+                            font-weight: bold;
+                        }
+
+                        .div_border{
+                            border: 1px solid black;
+                            padding:10px
+                        }
+
+                        .blank_space{
+                        height:5px;
+                        }
+                        .cli_nombre_label{
+                            width:4.5cm;
+                        }
+                        .cli_nombre{
+                            width:3cm;
+                        }
+                        .cli_ruc_label{
+                            width:3cm;
+                        }
+                        .cli_ruc{
+                            width:3cm;
+                        }
+                        .cli_telef_label{
+                            width:3cm;
+                        }
+                        .cli_telef{
+                            width:3cm;
+                        }
+                        .cli_movil_label{
+                            width:3cm;
+                        }
+                        .cli_movil{
+                            width:3cm;
+                        }
+
+                        .fecha_inicio_label{
+                            width:3cm;
+                        }
+                        .fecha_inicio{
+                            width:3cm;
+                        }
+                        .fecha_termino_label{
+                            width:3cm;
+                        }
+                        .fecha_termino{
+                            width:3cm;
+                        }
+
+                        .direccion_partida_label{
+                            width:3cm;
+                        }
+                        .direccion_partida{
+                            width:3cm;
+                        }
+                        .direccion_llegada_label{
+                            width:3cm;
+                        }
+                        .direccion_llegada{
+                            width:3cm;
+                        }
+
+                        .vend_nombre_label{
+                            width:3cm;
+                        }
+                        .vend_nombre{
+                            width:3cm;
+                        }
+                        .vend_telef_label{
+                            width:3cm;
+                        }
+                        .vend_telef{
+                            width:3cm;
+                        }
+
+                        .vehiculo_nombre_label{
+                            width:4.5cm;
+                        }
+                        .vehiculo_nombre{
+                            width:3cm;
+                        }
+                        .vehiculo_chapa_label{
+                            width:3cm;
+                        }
+                        .vehiculo_chapa{
+                            width:3cm;
+                        }
+
+                        .transportista_nombre_label{
+                            width:3cm;
+                        }
+                        .transportista_nombre{
+                            width:3cm;
+                        }
+                        .transportista_ruc_label{
+                            width:3cm;
+                        }
+                        .transportista_ruc{
+                            width:3cm;
+                        }
+
+                        .conductor_nombre_label{
+                            width:3cm;
+                        }
+                        .conductor_nombre{
+                            width:3cm;
+                        }
+                        .conductor_ruc_label{
+                            width:3cm;
+                        }
+                        .conductor_ruc{
+                            width:3cm;
+                        }
+                        .conductor_direccion_label{
+                            width:3cm;
+                        }
+                        .conductor_direccion{
+                            width:3cm;
+                        }
+
+                        .tab_motivos{
+                            font-size:x-small;
+                            border-spacing: 3px;
+                            border-collapse: separate;
+                        }
+                        .casilla{
+                            width:0.5cm;
+                            border: solid 1px;
+                            text-align:center;
+                        }
+                        .texto_casilla{
+                            text-align:right;
+                        }
+                    </style>
+
+                    <h2>Nota de Remisión <span t-field="o.name"></span></h2>
+                    <div class="div_border">
+                    <h5>1. DESTINATARIO DE LA MERCADERÍA</h5>
+                    <table width="100%">
+                        <tr>
+                            <td class="cli_nombre_label">Nombre o Razón Social del Destinatario: </td>
+                            <td class="cli_nombre"><span t-field="o.partner_id"/></td>
+                            <td class="cli_ruc_label">R.U.C./C.I.N.: </td>
+                            <td class="cli_ruc"><span t-field="o.partner_ruc"/></td>
+                        </tr>
+                        <tr>
+                            <td class="cli_telef_label">Teléfono Particular: </td>
+                            <td class="cli_telef"><span t-field="o.partner_phone"/></td>
+                            <td class="cli_movil_label">Móvil: </td>
+                            <td class="cli_movil"><span t-field="o.partner_mobile"/></td>
+                        </tr>
+                    </table>
+                  </div>
+                  <div class="blank_space"/>
+                  <div class="div_border">
+                    <h5>2. DATOS DEL ENVÍO</h5>
+                    <table width="100%">
+                        <tr>
+                            <td class="fecha_inicio_label">Fecha de inicio del Traslado: </td>
+                            <td class="fecha_inicio"><span t-field="o.initial_transfer_date"/></td>
+                            <td class="fecha_termino_label">Fecha de término del Traslado: </td>
+                            <td class="fecha_termino"><span t-field="o.finish_transfer_date"/></td>
+                        </tr>
+                        <tr>
+                            <td class="direccion_partida_label">Dirección del punto de partida: </td>
+                            <td class="direccion_partida" colspan="3"><span t-field="o.partner_company.street"/> <span t-field="o.partner_company.street2"/>, <span t-field="o.partner_company.city"/></td>
+                        </tr>
+                        <tr>
+                            <td class="direccion_llegada_label">Dirección de punto de llegada: </td>
+                            <td class="direccion_llegada" colspan="3"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/>, <span t-field="o.partner_id.city"/></td>
+                        </tr>
+                    </table>
+                  </div>
+                      <div class="blank_space"/>
+                  <div class="div_border">
+                  <h5>3. MOTIVO DEL TRANSLADO</h5>
+                  <table width="100%" class="tab_motivos">
+                      <tr>
+                          <td class="texto_casilla">Venta: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_sale">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Exportación: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_export">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Consignación: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_consignment">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Traslado entre locales de la misma empresa: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_intertal_transfer">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Traslado de Bienes para Reparación: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_repair_transfer">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Exhibición, demostración: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_exhibition">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                      </tr>
+                      <tr>
+                          <td class="texto_casilla">Compra: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_purchase">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Importación: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_import">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Devolución: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_return">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Traslado de Bienes para la Transformación: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_transformation_transfer">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Traslado por Emisión móvil: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_movil_transfer">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                          <td class="texto_casilla">Participación en Ferias: </td>
+                          <td class="casilla">
+                              <t t-if="o.is_fair">
+                                  <span> X </span>
+                              </t>
+                          </td>
+                      </tr>
+                  </table>
+                </div>
+                  <div class="blank_space"/>
+                    <div class="div_border">
+                    <h5>4. DATOS DEL TRANSPORTISTA Y DEL COMPROBANTE DE VENTA POR EL SERVICIO DE TRANSPORTE</h5>
+                    <table width="100%">
+                        <tr>
+                            <td class="vend_nombre_label">Nombre y Apellido: </td>
+                            <td class="vend_nombre" colspan="3"><span t-field="o.user_id"/></td>
+                        </tr>
+                        <tr>
+                            <td class="vend_telef_label">Teléfono: </td>
+                            <td class="vend_telef"><span t-field="o.user_phone"/> <span t-field="o.user_mobile"/></td>
+                        </tr>
+
+                              <tr>
+                                  <td class="transportista_nombre_label">Nombre o Razón Social del Transportista: </td>
+                                  <td class="transportista_nombre"><span t-field="o.logistic_company_id"/></td>
+                                  <td class="transportista_ruc_label">R.U.C. del transportista: </td>
+                                  <td class="transportista_ruc"><span t-field="o.logistic_ruc"/></td>
+                              </tr>
+                    </table>
+                  </div>
+                  <div class="blank_space"/>
+                  <div class="div_border">
+                    <h5>5. DATOS DEL VEHICULO DE TRANSPORTE</h5>
+                    <table width="100%">
+                        <tr>
+                            <td class="vehiculo_nombre_label">Marca del Vehículo de Transporte: </td>
+                            <td class="vehiculo_nombre"><span t-field="o.vehicle_name"/></td>
+                            <td class="vehiculo_chapa_label">Número de Chapa: </td>
+                            <td class="vehiculo_chapa"><span t-field="o.vehicle_plate"/></td>
+                        </tr>
+
+                    </table>
+                  </div>
+                  <div class="blank_space"/>
+                  <div class="div_border">
+                    <h5>6. DATOS DEL CONDUCTOR DEL VEHICULO</h5>
+                    <table width="100%">
+                        <tr>
+                            <td class="conductor_nombre_label">Nombre del Conductor: </td>
+                            <td class="conductor_nombre"><span t-field="o.driver_id"/></td>
+                            <td class="conductor_ruc_label">C.I.N. del Conductor: </td>
+                            <td class="conductor_ruc"><span t-field="o.driver_ruc"/></td>
+                        </tr>
+                        <tr>
+                            <td class="conductor_direccion_label">Dirección del Conductor: </td>
+                            <td class="conductor_direccion" colspan="3"><span t-field="o.driver_id.street"/> <span t-field="o.driver_id.street2"/>, <span t-field="o.driver_id.city"/></td>
+                        </tr>
+                    </table>
+                  </div>
+                  <div class="blank_space"/>
+                  <div class="div_border">
+                    <h5>7. DATOS DE LA MERCADERÍA</h5>
+                    <table class="table table-condensed">
+                        <thead>
+                            <tr>
+                                <th>Producto</th>
+                                <th>Cantidad</th>
+                                <th>Precio</th>
+                                <th>Descuento</th>
+                                <th align="right">Subtotal</th>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <t t-foreach="o.nota_line" t-as="i">
+                                <tr>
+                                    <td><span t-field="i.name"/></td>
+                                    <td><span t-esc="'%.0f'%i.product_uom_qty"/></td>
+                                    <td><span t-esc="'{0:,.0f}'.format(i.price_unit)"/></td>
+                                    <td><span t-field="i.discount"/> %</td>
+                                    <td align="right"><span t-esc="'{0:,.0f}'.format(i.price_subtotal)"/></td>
+                                </tr>
+                            </t>
+                            <tr>
+                                <td></td>
+                                <t t-set="cant_total" t-value="sum([x.product_uom_qty for x in o.nota_line])"/>
+                                <td><strong><span t-esc="can_total"/></strong></td>
+                                <td colspan="2" align="right"><strong>Total</strong></td>
+                                <t t-set="suma" t-value="sum([x.price_subtotal for x in o.nota_line])"/>
+                                <td align="right"><strong><span t-esc="suma" t-esc-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/></strong></td>
+                            </tr>
+                        </tbody>
+                    </table>
+                  </div>
+                    <p>Recibí en buenas condiciones la cantidad de <strong><span t-esc="int(cant_total)"/></strong> mercaderías por la suma de <strong><span t-esc="suma" t-esc-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/></strong>, y caso hubiera algún daño en la
+                        devolución de las mismas me comprometo a abonar el importe convenido por la empresa <strong><span t-field="o.partner_company"/></strong>.
+                    </p>
+                </div>
+            </t>
+        </t>
+    </t>
+    </template>
+
+</data>
+</openerp>

+ 17 - 0
nota_remision_sequence.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="1">
+        <!-- Sequences for sale.nota.remision -->
+        <record id="seq_type_sale_nota_remision" model="ir.sequence.type">
+            <field name="name">Sale Note Reference</field>
+            <field name="code">sale.nota.remision</field>
+        </record>
+
+        <record id="seq_sale_nota_remision" model="ir.sequence">
+            <field name="name">Sale Note Reference</field>
+            <field name="code">sale.nota.remision</field>
+            <field name="prefix">NR-</field>
+            <field name="padding">5</field>
+        </record>
+    </data>
+</openerp>

+ 172 - 0
nota_remision_view.xml

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  product_features for OpenERP
+  Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).
+    Authors, Mathieu Lemercier, mathieu@netandco.net, Franck Bret, franck@netandco.net
+  Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>
+  The licence is in the file __openerp__.py
+-->
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="sale_nota_remision_form_view">
+            <field name="name">sale.nota.remision.form.view</field>
+            <field name="model">sale.nota.remision</field>
+            <field name="arch" type="xml">
+                <form string="Referencia Nota">
+                    <header>
+                        <!--<button name="validar" string="Validar" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>-->
+                        <!--<button name="validar" string="Validar" type="object" states="progress" groups="base.group_user"/>-->
+                        <field name="state" widget="statusbar" statusbar_visible="draft,cancel,progress,done"/>
+                    </header>
+                    <h1>
+                        <label string="Nota Referencia " attrs="{'invisible': [('state','not in',('draft'))]}"/>
+                        <field name="name" class="oe_inline" readonly="1"/>
+                    </h1>
+                    <group col="4" string="Datos de compañia">
+                        <field name="partner_company"
+                                context="{'search_default_customer':1,'show_address': 1}"
+                                options='{"always_reload": True, "no_create":True}'
+                                readonly="1"/>
+                        <field name="initial_transfer_date"/>
+                        <field name="origin"/>
+                        <field name="finish_transfer_date"/>
+
+                    </group>
+                    <group col="4" string="Datos del cliente">
+                        <group>
+                            <field name="partner_id"
+                                   domain="[('customer','=',True)]"
+                                   context="{'search_default_customer':1, 'show_address': 1}"
+                                   options='{"always_reload": True, "no_create":True}'/>
+                        </group>
+                        <group>
+                            <field name="partner_ruc"/>
+                            <field name="partner_phone"/>
+                            <field name="partner_mobile"/>
+                        </group>
+                    </group>
+
+                    <group col="4" string="Datos del vendedor">
+                        <field name="user_id" options="{'no_create':True}"/>
+                        <field name="user_ruc"/>
+                        <field name="user_phone"/>
+                        <field name="user_mobile"/>
+                    </group>
+
+                    <group col="4" string="Datos del vehículo">
+                        <field name="vehicle_name"/>
+                        <field name="vehicle_plate"/>
+                    </group>
+
+                    <group col="4" string="Datos del chófer">
+                        <field name="logistic_company_id" options="{'no_create':True}"/>
+                        <field name="logistic_ruc"/>
+                        <field name="logistic_phone"/>
+                        <field name="logistic_mobile"/>
+                        <field name="driver_id" options='{"no_create":True}'/>
+                        <field name="driver_ruc"/>
+                        <field name="driver_phone"/>
+                        <field name="driver_mobile"/>
+                    </group>
+
+                    <group string="Motivos de transferencia (Marca justo la opción correcta)" col="8">
+                        <field name="is_sale"/>
+                        <field name="is_purchase"/>
+                        <field name="is_export"/>
+                        <field name="is_import"/>
+                        <field name="is_consignment"/>
+                        <field name="is_return"/>
+                        <field name="is_intertal_transfer"/>
+                        <field name="is_transformation_transfer"/>
+                        <field name="is_repair_transfer"/>
+                        <field name="is_movil_transfer"/>
+                        <field name="is_exhibition"/>
+                        <field name="is_fair"/>
+                    </group>
+                    <group col="2">
+                            <field name="sale_voucher"/>
+                            <field name="another_transfer"/>
+                    </group>
+                    <group col="2">
+                            <field name="obs_remision"/>
+                    </group>
+
+                    <notebook>
+                        <page string="Productos">
+                            <field name="nota_line">
+                                <form string="Note Lines">
+                                    <group>
+                                        <group>
+                                            <field name="product_id"/>
+                                            <label for="product_uom_qty"/>
+                                            <div>
+                                                <field name="product_uom_qty"/>
+                                            </div>
+                                            <field name="price_unit"/>
+                                        </group>
+                                    </group>
+                                    <label for="name"/>
+                                    <field name="name"/>
+                                </form>
+                                <tree string="Lineas de Orden de la Nota " editable="bottom">
+                                    <field name="product_id"
+                                        groups="base.group_user"/>
+                                    <field name="name"/>
+                                    <field name="product_uom_qty"/>
+                                    <field name="price_unit"/>
+                                    <field name="discount"/>
+                                    <field name="price_subtotal"/>
+                                    <field name="state" invisible="1"/>
+                                </tree>
+                            </field>
+                            <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
+                                <div class="oe_subtotal_footer_separator oe_inline">
+                                    <label for="amount_total" />
+                                </div>
+                                <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
+                            </group>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="sale_nota_remision_tree_view">
+            <field name="name">sale.nota.remision.tree.view</field>
+            <field name="model">sale.nota.remision</field>
+            <field name="arch" type="xml">
+                <tree string="Nota de Remisión">
+                    <field name="name"/>
+                    <field name="origin"/>
+                    <field name="partner_id"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="action_sale_nota_remision" model="ir.actions.act_window">
+            <field name="name">Nota de Remisión</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">sale.nota.remision</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+        </record>
+
+        <menuitem name="Nota de Remisión" action="action_sale_nota_remision" id="menu_sale_nota_remision" parent="base.menu_sales" sequence="7" groups="base.group_sale_salesman"/>
+
+        <record model="ir.ui.view" id="sale_order_nota_remision_add">
+            <field name="name">sale.order.nota.remision.add</field>
+            <field name="model">sale.order</field>
+            <field name="inherit_id" ref="sale.view_order_form" />
+            <field name="arch" type="xml">
+                <xpath expr="//header/button[@name='action_button_confirm']" position="before">
+                    <button name="action_button_create_note" attrs="{'invisible': [('note_reference_exists', '=', True)]}" string="Crear Nota de Remisión" type="object" class="oe_highlight" groups="base.group_user"/>
+                    <button name="action_button_view_note" attrs="{'invisible': [('note_reference_exists', '=', False)]}" string="Ver Nota de Remisión" type="object" groups="base.group_user"/>
+                    <!--<button name="action_button_view_note" string="View Note" attrs="{'invisible': [('state','=','draft')]}" type="object" class="oe_highlight" groups="base.group_user"/>-->
+                </xpath>
+                <field name="date_order" position="after">
+                    <field name="note_reference_exists"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 31 - 0
nota_remision_workflow.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="wkf_nota" model="workflow">
+            <field name="name">sale.nota.remision.basic</field>
+            <field name="osv">sale.nota.remision</field>
+            <field name="on_create">True</field>
+        </record>
+
+        <!-- Activity -->
+        <record id="act_draft" model="workflow.activity">
+            <field name="wkf_id" ref="wkf_nota"/>
+            <field name="flow_start">True</field>
+            <field name="name">draft</field>
+        </record>
+
+        <record id="act_progress" model="workflow.activity">
+            <field name="wkf_id" ref="wkf_nota"/>
+            <field name="flow_stop">True</field>
+            <field name="name">progress</field>
+            <field name="kind">function</field>
+            <field name="action">write({'state':'progress'})</field>
+        </record>
+
+        <record id="trans_draf_progress" model="workflow.transition">
+            <field name="act_from" ref="act_draft"/>
+            <field name="act_to" ref="act_progress"/>
+        </record>
+
+    </data>
+</openerp>

+ 2 - 0
security/ir.model.access.csv

@@ -0,0 +1,2 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_nota_remision","sale.nota.remision","model_sale_nota_remision","base.group_sale_salesman",1,1,1,0

BIN
static/description/icon.png