Przeglądaj źródła

Módulo implementado pedido por la set

SEBAS 1 rok temu
commit
d4045f5a3b

+ 31 - 0
__init__.py

@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.
+#
+##############################################################################
+
+import partner_data
+# import consulta_dte
+# import envio_lotes
+# import eventos_dte
+# import mje_resultado
+import account_move
+import ruc_documentos_timbrados
+import res_company
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
__init__.pyc


+ 41 - 0
__openerp__.py

@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.
+#
+##############################################################################
+
+
+{
+    'name': 'SET Paraguay',
+    'version': '2.0',
+    'category': 'Tools',
+    'author': 'Eiru Software/Sebastian Penayo',
+    'depends': ['base','web_widget_datepicker_options','account','partner_extra_data_basic'],
+    'data': [
+        "partner_data_view.xml",
+        "res_company_view.xml",
+        # "consulta_dte_view.xml",
+        # "envio_lotes_view.xml",
+        # "eventos_dte_view.xml",
+        # "mje_resultado_view.xml",
+        "ruc_documentos_timbrados_view.xml",
+        "set_menu.xml",
+        "account_move_view.xml",    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 63 - 0
account_move.py

@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class account_invoice(models.Model):
+    _name = 'account.invoice'
+    _inherit = 'account.invoice'
+    _description = 'Add extra data to SET in account invoice'
+
+    cdc = fields.Char('Código de Control (CDC)')
+    nro_factura = fields.Char(string='Factura Nº', related='number', store = True)
+    suc = fields.Char('SUC')
+    sec = fields.Char('Sec')
+    talonario = fields.Many2one('ruc.documentos.timbrados', string='Talonario')
+    timbrado = fields.Char(string='Timbrado', related="talonario.name")
+    fecha_final = fields.Date(string='Vencimiento de Timbrado', related="talonario.fecha_final")
+    nro_actual = fields.Integer('Nro Actual')
+    no_mostrar_libro_iva = fields.Boolean(string='No visualizar en el libro IVA')
+    importacion = fields.Boolean(string='Fact. de importación')
+    importacion_gasto = fields.Boolean(string='Fact. de gastos de importación')
+
+    @api.multi
+    def action_invoice_open(self):
+        res = super(AccountInvoice, self).action_invoice_open()
+        for invoice in self:
+            if invoice.type == 'out_invoice':
+                campo_original = invoice.nro_factura.replace("-", "")
+                campo1 = campo_original[:3]
+                campo2 = campo_original[4:7]
+                campo3 = campo_original[7:]
+                invoice.suc = campo1
+                invoice.sec = campo2
+                invoice.nro_actual = campo3
+        return res
+
+
+    # def separar_cadena (self):
+    #     if self.nro_factura:
+    #         longitud = len(self.nro_factura)
+    #         if longitud >= 3:
+    #             self.sec = self.nro_factura[3:6]
+    #         if longitud >= 6:
+    #             self.nro_actual = self.nro_factura[6:]
+    #         self.suc = self.nro_factura[:3]

BIN
account_move.pyc


+ 78 - 0
account_move_view.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="account_invoice_form2">
+            <field name="name">account.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='date_invoice']" position="after">
+                    <field name="nro_factura"/>
+                    <field name="suc"/>
+                    <field name="sec"/>
+                    <field name="nro_actual"/>
+                    <!-- <field name="despacho" options="{'no_quick_create': True, 'no_open': True}" attrs="{'invisible':[('importacion_gasto','!=',True)],'required':[('importacion_gasto','=',True)]}" domain="[('state','=','draft')]"/> -->
+                    <!-- <field name="partner_no_despachante" options="{'no_quick_create': True, 'no_open': True}" attrs="{'invisible':[('importacion_gasto','!=',True)]}"/> -->
+              </xpath>
+
+             <field name="fiscal_position" position="after">
+
+                    <field name="talonario" string="Talonario"/>
+                    <field name="timbrado" string="Timbrado"/>
+                    <field name="fecha_final"/>
+              </field>
+
+
+                <!-- <xpath expr="//form/sheet/notebook" position="inside">
+                <page string="Documento Electrónico">
+                    <group>
+                        <header>
+                            <button name="enviar_factura_electronica" string="Enviar" type="object" class="oe_highlight" attrs="{'invisible':['|',('state','!=', 'posted'),('estado_de', 'in', ('aprobado','enviado','anulado'))]}"/>
+                            <button name="descargar_xml" string="Descargar xml" type="object"/>
+                            <field name="estado_de" widget="statusbar"/>
+                        </header>
+                    </group>
+                    <group>
+                        <group>
+                            <field name="cdc" string="Codigo de Control (CDC) " readonly="1"/>
+                            <field name="qr_code" widget="image" class="oe_avatar" attrs="{'invisible':[('qr_code', '=', False)]}"/>
+                            <field name="secuencia" invisible="1"/>
+                            <field name="fecha_firma" invisible="1"/>
+                            <field name="tipo_emision"/>
+                            <field name="info_kude"/>
+                            <field name="tipo_transaccion" string="Tipo de transacción"/>
+                            <field name="tipo_impuesto" string="Tipo de impuestos"/>
+                            <field name="indicador_presencia" string="Indicador de Presencia"/>
+                            <field name="descripcion_indi_presencia" string="Describir Otros" attrs="{'invisible':[('indicador_presencia', '!=', 9)],'required':[('indicador_presencia', '=', 9)]}"/>
+
+                            <field name="operacion_credito" attrs="{'required':[('tipo_factura', '=', 2)]}"/>
+                        </group>
+                        <group>
+
+                            <field name="texto_qr" invisible="1"/>
+                            <field name="dEstRes" attrs="{'invisible':[('estado_de', 'not in', ('aprobado','rechazado'))]}"/>
+                            <field name="dProtAut" attrs="{'invisible':[('estado_de', 'not in', ('aprobado','rechazado'))]}"/>
+                            <field name="dFecProc" attrs="{'invisible':[('estado_de', 'not in', ('aprobado','rechazado'))]}"/>
+                            <field name="mje_resultado_ids" readonly="1">
+                                <tree>
+                                    <field name="name"/>
+                                    <field name="dMsgRes"/>
+                                    <field name="tipo"/>
+                                    <field name="invoice_id" invisible="1"/>
+                                    <field name="create_date" string="Fecha creación" optional="hide"/>
+                                    <field name="write_date" string="Fecha última actualización" optional="hide"/>
+                                </tree>
+                            </field>
+                        </group>
+                    </group>
+                    <group>
+                        <field name="respuesta" readonly="1" groups="factura_electronica.responsable_factu_elect_group"/>
+                        <field name="respuesta_lote" readonly="1" groups="factura_electronica.responsable_factu_elect_group"/>
+                    </group>
+                </page>
+            </xpath> -->
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 41 - 0
consulta_dte.py

@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class consulta_dte(models.Model):
+    _name = 'consulta.dte'
+    _description = 'Agrega datos sobre consultas DTE'
+
+    access_token = fields.Char('Seguridad Token')
+    access_url = fields.Char('Portal acceso URL')
+    access_warning = fields.Text('Access Warning')
+    agente = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Agente')
+    name = fields.Char('Descripción')
+    dCDC = fields.Char('CDC.', size=18)
+    dCodRes = fields.Char('Código de respuesta')
+    dFecProc = fields.Datetime(string='Fecha de respuesta')
+    dMsgRes = fields.Char('Mensaje de respuesta')
+    dProtAut = fields.Char('Código de operación')
+    display_name = fields.Char('Display Name')
+    fecha_consulta = fields.Datetime(string='Fecha consulta')
+    xContEv = fields.Char('Eventos')
+    xContenDE = fields.Char('XML')

BIN
consulta_dte.pyc


+ 60 - 0
consulta_dte_view.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="consulta_dte_form">
+            <field name="name">consulta.dte.form</field>
+            <field name="model">consulta.dte</field>
+            <field name="inherit_id"/>
+            <field name="arch" type="xml">
+              <form string="Consulta DTE">
+                    <!-- <header>
+                          <button name="consultar" string="Consultar" type="object" class="oe_highlight" attrs="{'invisible':[('xContenDE', '!=', False)]}"/>
+                    </header> -->
+                    <sheet>
+                        <group>
+                            <group>
+                                <field name="name"/>
+                                <field name="dCDC" required="1"/>
+                                <field name="xContenDE"/>
+                            </group>
+                            <group>
+                                <group>
+                                                <field name="fecha_consulta" readonly="1" force_save="1"/>
+                                                <field name="dFecProc" readonly="1" force_save="1"/>
+                                                <field name="dCodRes" readonly="1" force_save="1"/>
+                                                <field name="dProtAut" readonly="1" force_save="1"/>
+                                                <field name="dMsgRes" readonly="1" force_save="1"/>
+                                                <field name="xContEv" readonly="1" force_save="1"/>
+
+                                </group>
+                            </group>
+                        </group>
+                    </sheet>
+                                <!-- <div class="oe_chatter">
+                                    <field name="message_follower_ids" widget="mail_followers"/>
+                                    <field name="activity_ids" widget="mail_activity"/>
+                                    <field name="message_ids" widget="mail_thread"/>
+                                </div> -->
+            </form>
+          </field>
+        </record>
+
+
+
+        <!-- tree view -->
+
+        <record id="consulta_dte_tree_view" model="ir.ui.view">
+            <field name="name">consulta.dte.tree</field>
+            <field name="model">consulta.dte</field>
+            <field name="arch" type="xml">
+              <tree string="Consulta DTE">
+                  <field name="name"/>
+                  <field name="dCDC"/>
+              </tree>
+            </field>
+        </record>
+
+
+
+    </data>
+</openerp>

+ 51 - 0
envio_lotes.py

@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class envio_lotes(models.Model):
+    _name = 'envio.lotes'
+    _description = 'Agrega datos sobre envio por lotes'
+
+    access_warning = fields.Char('Access Warning')
+    access_token = fields.Char('Security token')
+    tipo = fields.Selection([('1','Factura electrónica'),('2','Factura electrónica de exportación'),('3','Factura electrónica de importación'),('4','Autofactura electrónica'),('5','Nota de crédito electrónica'),('6','Nota de débito electrónica'),('7','Nota de remisión electrónica'),('7','Comprobante de retención electrónico')],'Tipo documento')
+    numero_lote = fields.Char('Numero lote')
+    archivo = fields.Char('Archivo')
+    name = fields.Char('Descripción')
+    fecha_envio = fields.Datetime(string='Fecha de envío')
+    dMsgRes = fields.Char('Mensaje de respuesta')
+    dFecProc = fields.Datetime(string='Fecha de respuesta')
+    dProtConstLote = fields.Char('Numero lote de respuesta')
+    dTpoProces = fields.Datetime(string='Tiempo medio de Procesamiento ms')
+    con_dFecRes = fields.Datetime(string='Fecha de respuesta de la consulta')
+    con_dCodRes = fields.Char('Código de respuesta de la consulta')
+    con_dMsgRes = fields.Char('Mensaje de respuesta de consulta')
+    # invoice_ids = fields.Many2one('Documento electrónico')
+    invoice_date = fields.Datetime(string='Fecha de factura')
+    # nro_factura = fields.Many2one('Documento electrónico')
+    # partner_id = fields.Many2one('Empresa')
+    # company_id = fields.Many2one('Empresa')
+    respuesta = fields.Char('Respuesta')
+    domain_tipo = fields.Char('Domain Tipo')
+    state = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Estado')
+    con_dFecProc = fields.Datetime(string='Fecha de respuesta de la consulta')
+    dCodRes = fields.Char('Código de respuesta')

BIN
envio_lotes.pyc


+ 83 - 0
envio_lotes_view.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="envio_lotes_form">
+            <field name="name">envio.lotes.form</field>
+            <field name="model">envio.lotes</field>
+            <field name="inherit_id"/>
+            <field name="arch" type="xml">
+              <form string="Envio DE por Lotes">
+                                  <!-- <header>
+                                      <button name="crear_zip" string="Crear ZIP" type="object" attrs="{'invisible':[('state', 'not in', ('borrador'))]}"/>
+                                      <button name="enviar" string="Enviar" type="object" class="oe_highlight" attrs="{'invisible':[('state', 'in', ('enviado','cerrado'))]}"/>
+                                      <button name="consultar_estado" string="Consultar Estado" type="object" class="oe_highlight" attrs="{'invisible':[('state', 'not in', ('enviado'))]}"/>
+                                      <field name="state" widget="statusbar" nolabel="1"/>
+                                  </header> -->
+                                  <sheet>
+
+                                      <group>
+                                          <group>
+                                              <field name="name"/>
+                                              <field name="tipo" required="1"/>
+                                              <field name="numero_lote" readonly="1"/>
+                                              <field name="domain_tipo" invisible="1"/>
+                                              <field name="archivo" filename="name" readonly="1"/>
+                                              <field name="fecha_envio" readonly="1"/>
+                                          </group>
+                                          <group>
+                                              <group>
+                                                  <field name="dMsgRes"/>
+                                                  <field name="dCodRes" groups="factura_electronica.responsable_factu_elect_groupe"/>
+                                                  <field name="dFecProc" groups="factura_electronica.responsable_factu_elect_group"/>
+                                                  <field name="dProtConstLote" groups="factura_electronica.responsable_factu_elect_group"/>
+                                                  <field name="dTpoProces" groups="factura_electronica.responsable_factu_elect_group"/>
+
+                                                  <field name="con_dMsgRes"/>
+                                                  <field name="con_dCodRes"/>
+                                                  <field name="con_dFecProc" groups="factura_electronica.responsable_factu_elect_group"/>
+                                                  <field name="respuesta" groups="factura_electronica.responsable_factu_elect_group"/>
+                                              </group>
+                                          </group>
+                                      </group>
+                                      <notebook>
+                                          <page string="Facturas" attrs="{'invisible':[('tipo', '=', '7')]}">
+                                              <!-- <field name="invoice_ids" domain="domain_tipo" context="{'form_view_ref': 'account.view_move_form'}"> -->
+
+                                                  <tree editable="bottom">
+                                                     <!-- <field name="partner_id" string="Empresa"/>
+                                                     <field name="company_id" invisible="1"/> -->
+                                                      <field name="invoice_date" string="Fecha Factura"/>
+                                                      <!-- <field name="nro_factura"/> -->
+                                                      <!-- <field name="estado_de" string="Estado DE"/> -->
+                                                      <field name="state"/>
+                                                  </tree>
+                                              <!-- </field> -->
+                                          </page>
+                                      </notebook>
+                                  </sheet>
+                                  <!-- <div class="oe_chatter">
+                                      <field name="message_follower_ids" widget="mail_followers"/>
+                                      <field name="activity_ids" widget="mail_activity"/>
+                                      <field name="message_ids" widget="mail_thread"/>
+                                  </div> -->
+            </form>
+          </field>
+        </record>
+
+        <!-- tree view -->
+
+        <record id="envio_lotes_tree_view" model="ir.ui.view">
+            <field name="name">envio.lotes.tree</field>
+            <field name="model">envio.lotes</field>
+            <field name="arch" type="xml">
+                <tree string="Envios DE por Lotes">
+                  <field name="name"/>
+                  <field name="tipo"/>
+                  <field name="numero_lote"/>
+                  <field name="state"/>
+                </tree>
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 60 - 0
eventos_dte.py

@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class eventos_dte(models.Model):
+    _name = 'eventos.dte'
+    _description = 'Agrega datos sobre eventos DTE'
+
+    access_token = fields.Char('Seguridad Token')
+    access_url = fields.Char('Portal acceso URL')
+    access_warning = fields.Text('Access Warning')
+    agente = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Agente')
+    cdc = fields.Char('CDC.', size=18)
+    name = fields.Char('Descripción')
+    cdc_receptor = fields.Char('CDC Receptor', size=18)
+    dCodRes = fields.Char('Código de respuesta')
+    dDVRec = fields.Char('Digito Verificador')
+    dEstRes = fields.Char('Estado de respuesta')
+    dFecEmi = fields.Datetime(string='Fecha de emisión')
+    dFecProc = fields.Datetime(string='Fecha de respuesta')
+    dFecRecep = fields.Datetime(string='Fecha estimada de recepción')
+    dMsgRes = fields.Char('Mensaje de respuesta')
+    # dNomRec = fields.Many2one('Nombre o razón social')
+    dNumFin = fields.Char('Número de final del rango')
+    dNumIn = fields.Char('Número de inicio del rango')
+
+    dProtAut = fields.Char('Código de operación')
+    dRucRec = fields.Char('RUC del receptor')
+    dTotalGs = fields.Char('Monto total en Gs.')
+    display_name = fields.Char('Display Name')
+    fecha_envio = fields.Datetime(string='Fecha envio')
+    fecha_firma = fields.Datetime(string='Fecha firma')
+    has_message = fields.Boolean(string='Has message' ,default = False)
+    iTipConf = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Tipo de conformidad')
+    iTipRec = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Tipo de Receptor')
+    # invoice_id = fields.Many2one('Documento electrónico')
+    mOtEve = fields.Char('Motivo del evento')
+    respuesta = fields.Char('Respuesta')
+    state = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Estado')
+    timbrado_id = fields.Many2one('Documento electrónico')
+    tipo = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Tipo')

BIN
eventos_dte.pyc


+ 91 - 0
eventos_dte_view.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="eventos_dte_form">
+            <field name="name">eventos.dte.form</field>
+            <field name="model">eventos.dte</field>
+            <field name="inherit_id"/>
+            <field name="arch" type="xml">
+              <form string="Eventos DTE">
+                                <!-- <header>
+                                    <button name="enviar" string="Enviar" type="object" class="oe_highlight" attrs="{'invisible':[('state', 'not in', ('borrador'))]}"/>
+                                    <button name="descargar_xml" string="Descargar XML del Evento" type="object" class="oe_highlight"/>
+                                    <field name="state" widget="statusbar" nolabel="1"/>
+                                </header> -->
+                                <sheet>
+
+                                    <group>
+                                        <group>
+                                            <field name="name"/>
+                                            <field name="tipo" required="1"/>
+                                            <field name="tipo" attrs="{'invisible':[('tipo', '!=', 'recepcion')],'required':[('tipo', '=', 'recepcion')]}"/>
+
+                                            <!-- <field name="invoice_id" attrs="{'invisible':[('tipo', '!=', 'cancelacion')],'required':[('tipo', '=', 'cancelacion')]}" domain="[('estado_de','=','aprobado'),('state','=','cancel')]"/> -->
+                                            <field name="cdc" attrs="{'invisible':[('tipo', '!=', 'cancelacion')]}" readonly="1" force_save="1"/>
+                                            <field name="timbrado_id" attrs="{'invisible':[('tipo', '!=', 'inutilizacion')],'required':[('tipo', '=', 'inutilizacion')]}"/>
+                                            <field name="dNumIn" attrs="{'invisible':[('tipo', '!=', 'inutilizacion')],'required':[('tipo', '=', 'inutilizacion')]}"/>
+                                            <field name="dNumFin" attrs="{'invisible':[('tipo', '!=', 'inutilizacion')],'required':[('tipo', '=', 'inutilizacion')]}"/>
+                                            <field name="mOtEve" attrs="{'invisible':[('tipo', 'not in', ('inutilizacion','cancelacion'))],'required':[('tipo', 'in', ('inutilizacion','cancelacion'))]}"/>
+                                            <field name="agente" invisible="1"/>
+                                            <field name="fecha_envio" readonly="1" force_save="1"/>
+                                            <field name="fecha_firma" readonly="1" force_save="1"/>
+
+                                        </group>
+                                        <group>
+                                            <group>
+
+                                                <field name="dEstRes" readonly="1" force_save="1"/>
+                                                <field name="dCodRes" readonly="1" force_save="1"/>
+                                                <field name="dFecProc" readonly="1" force_save="1"/>
+                                                <field name="dMsgRes" readonly="1" force_save="1"/>
+                                                <field name="dProtAut" readonly="1" force_save="1"/>
+                                                <field name="respuesta" readonly="1" force_save="1" groups="base.group_no_one"/>
+
+                                            </group>
+                                        </group>
+
+
+                                    </group>
+                                    <group>
+                                        <group string="Datos del DE/DTE Recepcionado" attrs="{'invisible':[('tipo', 'not in', ('recepcion','disconformidad','conformidad','desconocimiento'))]}">
+                                            <field name="cdc_receptor" attrs="{'required':[('tipo', 'in', ('recepcion','conformidad','disconformidad','desconocimiento'))]}"/>
+                                            <field name="dFecEmi" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/>
+                                            <field name="dFecRecep" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/>
+                                            <field name="iTipRec" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/>
+                                            <!-- <field name="dNomRec" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/> -->
+                                            <field name="dRucRec" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/>
+                                            <field name="dDVRec" attrs="{'invisible':[('tipo', 'not in', ('recepcion','desconocimiento'))],'required':[('tipo', 'in', ('recepcion','desconocimiento'))]}"/>
+                                            <field name="dTotalGs" attrs="{'invisible':[('tipo', 'not in', ('recepcion'))], 'required':[('tipo', 'in', ('recepcion'))]}"/>
+                                            <field name="mOtEve" attrs="{'invisible':[('tipo', 'not in', ('disconformidad','desconocimiento'))],'required':[('tipo', 'in', ('disconformidad','desconocimiento'))]}"/>
+                                            <field name="iTipConf" attrs="{'invisible':[('tipo', '!=', 'conformidad')],'required':[('tipo', 'in', ('conformidad'))]}"/>
+                                            <field name="dFecRecep" attrs="{'invisible':[('iTipConf', '!=', 2),('tipo','!=','conformidad')],'required':[('iTipConf', '=', 2),('tipo','=','conformidad')]}"/>
+                                        </group>
+                                    </group>
+
+                                </sheet>
+                                <!-- <div class="oe_chatter">
+                                    <field name="message_follower_ids" widget="mail_followers"/>
+                                    <field name="activity_ids" widget="mail_activity"/>
+                                    <field name="message_ids" widget="mail_thread"/>
+                                </div> -->
+                            </form>
+                    </field>
+        </record>
+
+
+        <!-- tree view -->
+
+        <record id="eventos_dte_tree_view" model="ir.ui.view">
+            <field name="name">eventos.dte.tree</field>
+            <field name="model">eventos.dte</field>
+            <field name="arch" type="xml">
+                <tree string="Eventos DTE">
+                      <field name="name"/>
+                      <field name="tipo"/>
+                      <field name="state"/>
+                </tree>
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 43 - 0
mje_resultado.py

@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class mje_resultado(models.Model):
+    _name = 'mje.resultado'
+    _description = 'Agrega datos sobre mensaje resultado'
+
+    dMsgRes = fields.Char('Mensaje de respuesta')
+    display_name = fields.Char('Display Name')
+    name = fields.Char('Descripción')
+    dFecProc = fields.Datetime(string='Fecha de respuesta')
+  # invoice_id = fields.Many2one('Documento electrónico')
+    tipo = fields.Selection([('1','Factura electrónica'),('2','Factura electrónica de exportación'),('3','Factura electrónica de importación'),('4','Autofactura electrónica'),('5','Nota de crédito electrónica'),('6','Nota de débito electrónica'),('7','Nota de remisión electrónica'),('7','Comprobante de retención electrónico')],'Tipo documento')
+  # picking_id = fields.Many2one('Picking')
+    # xContenDE = fields.Binary(
+    #     compute='_get_barcode',
+    #     string=_('AFIP Barcode Image')
+    # )
+    xContEv = fields.Char('Eventos')
+    dProtAut = fields.Char('Código de operación')
+    dCDC =  fields.Char('CDC.', size=18)
+    fecha_consulta = fields.Datetime(string='Fecha consulta')
+    dCodRes = fields.Char('Código de respuesta')

BIN
mje_resultado.pyc


+ 66 - 0
mje_resultado_view.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="mje_resultado_form">
+            <field name="name">mje.resultado.form</field>
+            <field name="model">mje.resultado</field>
+            <field name="inherit_id"/>
+            <field name="arch" type="xml">
+              <form string="Mensaje Resultado">
+                                <header>
+                                    <button name="consultar" string="Consultar" type="object" class="oe_highlight" attrs="{'invisible':[('xContenDE', '!=', False)]}"/>
+                                </header>
+                                <sheet>
+
+                                    <group>
+                                        <group>
+                                            <field name="name"/>
+                                            <field name="dCDC" required="1"/>
+                                            <!-- <field name="xContenDE"/> -->
+                                        </group>
+                                        <group>
+                                            <group>
+                                                <field name="fecha_consulta" readonly="1" force_save="1"/>
+                                                <field name="dFecProc" readonly="1" force_save="1"/>
+                                                <field name="dCodRes" readonly="1" force_save="1"/>
+                                                <field name="dProtAut" readonly="1" force_save="1"/>
+                                                <field name="dMsgRes" readonly="1" force_save="1"/>
+                                                <field name="xContEv" readonly="1" force_save="1"/>
+
+                                            </group>
+                                        </group>
+                                    </group>
+                                </sheet>
+                                <!-- <div class="oe_chatter">
+                                    <field name="message_follower_ids" widget="mail_followers"/>
+                                    <field name="activity_ids" widget="mail_activity"/>
+                                    <field name="message_ids" widget="mail_thread"/>
+                                </div> -->
+            </form>
+          </field>
+        </record>
+
+
+        <!-- tree view -->
+
+        <record id="mje_resultado_tree_view" model="ir.ui.view">
+            <field name="name">mje.resultado.tree</field>
+            <field name="model">mje.resultado</field>
+            <field name="arch" type="xml">
+              <tree string="Mensaje Resultado">
+                    <field name="name"/>
+                    <field name="dMsgRes"/>
+                    <field name="tipo"/>
+                    <!-- <field name="invoice_id" string="Factura"/> -->
+                    <field name="create_date" string="Fecha de Creación" optional="hide"/>
+                    <field name="write_date" string="Fecha de última actualización" optional="hide"/>
+                    <field name="create_uid" string="Creado por" optional="hide"/>
+                    <field name="write_uid" string="Actualizado por" optional="hide"/>
+              </tree>
+            </field>
+        </record>
+
+
+
+    </data>
+</openerp>

+ 302 - 0
partner_data.py

@@ -0,0 +1,302 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+from openerp.exceptions import ValidationError
+from math import floor
+import re
+import sys
+import logging
+
+# logger = logging.getlogger(__name__)
+
+class res_partner(models.Model):
+    _name = 'res.partner'
+    _inherit = 'res.partner'
+    _description = 'Add extra data to SET'
+
+    digitointer = fields.Char('RUC Internacional', size=13)
+    dv= fields.Char('Digito Verificador', size=1)
+    esinternacional = fields.Boolean(string='Es internacional' ,default = False)
+    retencion = fields.Boolean(string='Retiene IVA' ,default = False)
+    retentor_renta = fields.Boolean(string='Retentor renta' ,default = False)
+    porcentaje_retencion = fields.Integer('Porcentaje de Retención')
+    porcentaje_retencion_renta = fields.Integer('Porcentaje de Retención Renta')
+    porcentaje_retencion_absorbida = fields.Integer('Porcentaje de Retención Absorbida')
+    retiene_iva_cliente = fields.Boolean(string='Es agente retentor' ,default = False)
+    concepto_iva = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Concepto IVA')
+    concepto_renta = fields.Char('Concepto renta')
+    rucdv = fields.Char('R.U.C.', size=12)
+    naturaleza_receptor = fields.Selection([('1','Contribuyente'),('2','No contribuyente')],'Naturaleza receptor')
+    naturaleza_vendedor = fields.Selection([('1','No contribuyente'),('2','Extranjero')],'Naturaleza vendedor')
+    nivel = fields.Integer('Nivel', size=2)
+    nombre_fantasia = fields.Char('Nombre de fantasia')
+    ci = fields.Char('CI', size=13)
+    nro_casa = fields.Integer('Nro. Casa')
+    nro_documento = fields.Char('Nro. Documento')
+    timbrado = fields.Char('Timbrado')
+    tipo_documento_identidad = fields.Char('Tipo Documento Identidad')
+    iva_retencion_10 = fields.Integer('Porcentaje de retención sobre el IVA 10%')
+    iva_retencion_5 = fields.Integer('Porcentaje de retención sobre el IVA 5%')
+    tipo_documento_receptor = fields.Selection([('1','Cédula paraguaya'),('2','Pasaporte'),('3','Cédula extranjera'),('4','Carnet de residencia'),('5','Innominado'),('6','Tarjeta diplomática de exoneración fiscal')],'Tipo Documento Receptor')
+    tipo_documento_vendedor = fields.Selection([('1','Cédula paraguaya'),('2','Pasaporte'),('3','Cédula extranjera'),('4','Carnet de residencia')],'Tipo Documento Vendedor')
+    tipo_operacion = fields.Selection([('1','B2B'),('2','B2C'),('3','B2G'),('4','B2F')],'Tipo Operación')
+    situacion = fields.Selection([('contribuyente','Contribuyente'),('nocontribuyente','No contribuyente')],'Situación')
+    # activity_id = fields.Many2one("economic.activity",
+    #                               string="Default Economic Activity",
+    #                               context={'active_test': False})
+    # economic_activities_ids = fields.Many2many('economic.activity',
+    #                                            string='Economic Activities',
+    #                                            context={'active_test': False})
+    tipo_identificacion = fields.Selection([('1','Cédula paraguaya'),('2','RUC'),('3','Cédula extranjera'),('4','Carnet de residencia'),('5','Innominado')],'Tipo de Identificación')
+
+
+
+
+
+    # @api.constrains("ruc")
+    # def constrains_py_doc_number(self):
+    #     for partner in self:
+    #         if not partner.tipo_identificacion and not partner.ruc:
+    #             continue
+    #         elif not partner.tipo_identificacion and partner.ruc and not partner.parent_id:
+    #             raise ValidationError(_("Seleccione un tipo de documento"))
+    #         elif partner.tipo_identificacion and not partner.ruc:
+    #             raise ValidationError(_("El campo RUC no puede estar vacio"))
+    #         vat = partner.ruc
+    #         if partner.tipo_identificacion == '2':
+    #             check = self._validate_ruc(vat)
+    #             if not check:
+    #                 raise ValidationError(_('El número de RUC [%s] no es válido' % vat))
+    #         elif partner.tipo_identificacion == '1':
+    #             check = self._validate_ci(vat)
+    #             if not check:
+    #                 raise ValidationError(_('El número de identificación [%s] no es válido' % vat))
+    #         else:
+    #             continue
+    #
+    # @staticmethod
+    # def _validate_ruc(vat):
+    #     factor = '43298765432'
+    #     sum = 0
+    #     dig_check = None
+    #     if len(vat) != 12:
+    #         return False
+    #     try:
+    #         int(vat)
+    #     except ValueError:
+    #         return False
+    #     for f in range(0, 11):
+    #         sum += int(factor[f]) * int(vat[f])
+    #     subtraction = 11 - floor((sum % 11))
+    #     if subtraction < 10:
+    #         dig_check = subtraction
+    #     elif subtraction == 10:
+    #         dig_check = ""
+    #     elif subtraction == 11:
+    #         dig_check = 0
+    #
+    #     if not int(vat[11]) == dig_check:
+    #         return False
+    #     return True
+    #
+    # @staticmethod
+    # # def _validate_ci(vat):
+    #
+    # def _validate_ci(vat):
+    #     logging.warning(vat)
+    #     ruc = ''
+    #     basemax = 7
+    #     for c in str(vat).replace('-', ''):
+    #         ruc += c.isdigit() and c or str(ord(c))
+    #     k = 2
+    #     total = 0
+    #
+    #     for c in reversed(ruc[:-1]):
+    #         n = int(c)
+    #         if n > basemax:
+    #             k = 2
+    #         total += n * k
+    #         k += 1
+    #     resto = total % basemax
+    #     if resto > 1:
+    #         n = basemax - resto
+    #     else:
+    #         n = 0
+    #     return n == int(ruc[-1])
+    #     vat = vat.replace("-", "").replace('.', '')
+    #     sum = 0
+    #     if not vat:
+    #         return False
+    #     try:
+    #         int(vat)
+    #     except ValueError:
+    #         return False
+    #     vat = "%08d" % int(vat)
+    #     long = len(vat)
+    #     if long > 8:
+    #         return False
+    #     code = [2, 9, 8, 7, 6, 3, 4]
+    #     for f in range(0, long - 1):
+    #         sum += int(vat[f]) * int(code[f])
+    #     total = sum + int(vat[-1])
+    #     subtraction = total % 10
+    #     if subtraction != 0:
+    #         return False
+    #     return True
+
+
+    # """
+    # El numero de una cédula de identidad tiene exactamente 7 dígitos al cual se le adiciona
+    #  un dígito verificador.
+    #
+    # Es así que un número valido debe respetar el siguiente formato:
+    #
+    # a.bcd.efg-h
+    #
+    # El dígito posterior al guión (h) es también llamado dígito verificador.
+    #
+    # Para obtener h debemos:
+    #
+    # Multiplicar a,b,c,d,e,f,g por las siguientes constantes:
+    #         (a; b; c; d; e; f; g) .* (2; 9; 8; 7; 6; 3; 4)
+    #
+    # El resultado de la suma s = 2*a + 9*b + 8*c + 7*d + 6*e + 3*f + 4*g es dividido por 10
+    # quedándonos con resto (M = s modulo 10)
+    #
+    # Finalmente h = (10 - M) % 10
+    #
+    # Ejemplo practico:
+    # Si la CI es 1.234.567:
+    #
+    # s = 2*1 + 9*2 + 8*3 + 7*4 + 6*5 + 3*6 + 4*7 = 148
+    # M = 148 % 10 = 8
+    # h = (10 - 8) % 10 = 2
+    # Obteniendo que 1.234.567-2 es un número de CI valido.
+    # """
+
+        # class res_partner(models.Model):
+        #     _inherit = 'res.partner'
+
+        # code = [2, 9, 8, 7, 6, 3, 4]
+        #
+        #     # def __init__(self, vat):
+        # """ Inicializa la clase
+        #     Asigna un numero de cedula a la propiedad publica numero
+        #
+        #         Args:
+        #             numero: un numero de cedula entre 6 y 7 digitos, puede ser int o string
+        # """
+        # self.ruc = vat
+        # self._verifier = ""
+        #
+        # @property
+        # def numero(self):
+        #     """ propiedad de lectura
+        #
+        #     Returns:
+        #         _numero: la propiedad privada de numero de cedula ya normalizada
+        #     """
+        #     return self._ruc
+        #
+        # @numero.setter
+        # def numero(self, val):
+        #     """ asigna a la propiedad privada el numero de cedula asignado a numero,
+        #         lo normaliza y valida
+        #     Args:
+        #         val (int o string): el numero de cedula
+        #
+        #     """
+        #     try:
+        #         if isinstance(val, str):
+        #             # si la cedula es un string, le saco el formato (puntos y guiones)
+        #             numUpdated = re.sub(r"[\.|\-]", "", val)
+        #             self._ruc = numUpdated
+        #         else:
+        #             self._ruc = str(val)
+        #
+        #         if not self._ruc.isnumeric():
+        #             sys.exit("cedula should be only numbers")
+        #
+        #         if (len(self._ruc) < 6 or len(self._ruc) > 7):
+        #             sys.exit("invalid cedula length...")
+        #
+        #     except:
+        #         sys.exit(
+        #             "Cedula conversion error, check cedula length, value or format.")
+        #
+        # @property
+        # def verifier(self):
+        #     """propiedad de lectura del digito verificador
+        #
+        #     Returns:
+        #         int: digito verificador
+        #     """
+        #     return self._verifier
+        #
+        # def __acumSequence(self, seq, index):
+        #     """ funcion recursiva privada que suma los digitos de una cedula
+        #
+        #     Args:
+        #         seq: el numero en la constante SEQUENCE
+        #         index (int): la posicion en ambos arrays (secuencia y cedula)
+        #                 Deben matchear en posicion
+        #
+        #         ** NOTA: como la correspondencia debe ser 1:1 seq y _numero, en caso de ser
+        #         una cedula de 6 digitos se podia haber agregado un 0 al inicio de _numero para comenzar
+        #         con el mismo largo (7 digitos), pero asi es mas divertido :D
+        #
+        #     Returns:
+        #         int: la acumulacion de la suma de digito de self._numero * digito de secuencia
+        #     """
+        #     if index < (len(seq) - 1):
+        #         return (seq[index] * int(self._ruc[index])) + self.__acumSequence(seq, index + 1)
+        #     return seq[index] * int(self._ruc[index])
+        #
+        # def getVerifierDigit(self):
+        #     """ calculo de digito verificador
+        #
+        #     Returns:
+        #         int: digito verificador
+        #     """
+        #     try:
+        #         digit_diff = (len(self.code) - len(self._ruc))
+        #         if digit_diff >= 0:
+        #             acum = 0
+        #             acum = self.__acumSequence(self.code[digit_diff:], 0)
+        #             mod = (acum % 10)
+        #             verifier = ((10 - mod) % 10)
+        #             self._verifier = str(verifier)
+        #         return verifier
+        #     except:
+        #         print("ERROR: unknown error, check params!")
+        #
+        # def formatCedula(self):
+        #     """ formatea un numero de cedula al formato de puntos y guion
+        #     ej: 12345678 => 1.234.567-8
+        #
+        #     Returns:
+        #         string: el numero de cedula completo y formateado
+        #     """
+        #     self.getVerifierDigit()
+        #     if len(self.ruc) == 6:
+        #         return self.ruc[:3] + '.' + self.ruc[3:] + '-' + self.verifier
+        #     return self.ruc[:1] + '.' + self.ruc[1:4] + '.' + self.ruc[4:] + '-' + self.verifier

BIN
partner_data.pyc


+ 87 - 0
partner_data_view.xml

@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="res_partner_ruc">
+            <field name="name">res.partner.ruc</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='name']" position="after">
+                <br/>
+                    <field name="nombre_fantasia" placeholder="Nombre Fantasia"/>
+
+
+                </xpath>
+
+                <field name="website" position="before">
+                    <field name="tipo_identificacion"/>
+                  <!--   <field name="sexo" attrs="{'invisible':[('is_company','=',True)]}"/>
+                    <field name="fecha_nac" attrs="{'invisible':[('is_company','=',True)]}" options="{'datepicker':{'yearRange': 'c-60:c+0'}}"/>
+                    <field name="ubicacion" widget="url"/> -->
+                </field>
+                <xpath expr="//sheet/group" position="after">
+                      <group attrs="{'invisible':[('supplier', '=', False)]}">
+                          <group string="Retenciones a proveedores">
+                              <field name="retencion"/>
+                              <!-- <div class="o_row"> -->
+
+                                  <field name="porcentaje_retencion" widget="integer"/>
+                                  <span>%</span>
+                              <!-- </div> -->
+                            </group>
+                              <group>
+                              <field name="situacion"/>
+                              <field name="retentor_renta"/>
+                              <field name="concepto_renta" attrs="{'invisible':[('retentor_renta', '=', False)]}"/>
+                              <field name="concepto_iva" attrs="{'invisible':[('retencion', '=', False)]}"/>
+                              <field name="porcentaje_retencion_renta" attrs="{'invisible':[('retentor_renta', '=', False)]}"/>
+                              <field name="porcentaje_retencion_absorbida" attrs="{'invisible':[('retentor_renta', '=', False)]}"/>
+                              <!-- <field name="cuenta_renta"/> -->
+                              </group>
+
+                      </group>
+      		    </xpath>
+              <xpath expr="//sheet/group" position="after">
+                  <group>
+                      <group string="Datos">
+                      <!-- <field name="supplier" invisible="0"/>
+                     <field name="customer" invisible="0"/> -->
+                     <field name="retiene_iva_cliente" invisible="0"/>
+                      <field name="esinternacional" invisible="1"/>
+                      <!-- <field name="ruc" attrs="{'required': [('parent_id','=',False) , '&amp;',  ('esinternacional', '=', False),('ci', '=', False)],'invisible': [('esinternacional','=',True)]}"/> -->
+                       <field name="digitointer" attrs="{'required': ['|',('customer', '=', True),('supplier','=',True) , '&amp;',  ('esinternacional', '=', True),('ci', '=', False)],'invisible': [('esinternacional','=',False)]}"/>
+                      <field name="dv" readonly="1" force_save="1" attrs="{'invisible': [('esinternacional','=',True)]}"/>
+                      <field name="ci"/>
+                      <!-- <field name="fecha_nacimiento" attrs="{'invisible': [('company_type','=','company')]}"/> -->
+                      </group>
+
+                      <group string="Retenciones" attrs="{'invisible':[('customer','!=',True)]}">
+                          <field name="iva_retencion_10"/>
+                          <field name="iva_retencion_5"/>
+                      </group>
+
+                       <group string="Timbrado de facturas" attrs="{'invisible':[('supplier','!=',True)]}">
+                          <field name="timbrado"/>
+                          <!-- <field name="vencimiento_timbrado"/> -->
+                       </group>
+
+                  </group>
+          <!-- <field name="contratista"/>
+          <field name="nivel" invisible="1"/> -->
+          </xpath>
+
+
+            </field>
+        </record>
+        <record id="res_partner_extra_data_search" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.search</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_res_partner_filter"/>
+            <field name="arch" type="xml">
+                <field name="name" position="before">
+                    <field name="ruc" filter_domain="['|','|','|','|',('ruc','ilike',self),('name','ilike',self),('mobile','ilike',self),('phone','ilike',self),('email','ilike',self)]" string="general"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 19 - 0
qr_generator.py

@@ -0,0 +1,19 @@
+
+import qrcode
+import base64
+from io import BytesIO
+
+
+class GenerateQrCode():
+    def generate_qr_code(url):
+        qr = qrcode.QRCode(version=4,
+                           error_correction=qrcode.constants.ERROR_CORRECT_L,
+                           box_size=20,
+                           border=4,)
+        qr.add_data(url)
+        qr.make(fit=True)
+        img = qr.make_image()
+        temp = BytesIO()
+        img.save(temp, format="PNG")
+        qr_img = base64.b64encode(temp.getvalue())
+        return qr_img

+ 42 - 0
res_company.py

@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+from openerp.exceptions import ValidationError
+
+
+class res_company(models.Model):
+    _name = 'res.company'
+    _inherit = 'res.company'
+    _description = 'Add extra data to res company'
+
+    codigo_actividad = fields.Char('Código de actividad')
+    codigo_establecimiento = fields.Char('Código establecimiento', size=2)
+    establecimiento = fields.Char('Establecimiento')
+    punto_expedicion = fields.Char('Punto de expedición de comprobantes', size=3)
+    imputa_ire = fields.Boolean(string='Imputa al IRE' ,default = False)
+    imputa_irp_isp = fields.Boolean(string='Imputa al IRP-RSP' ,default = False)
+    imputa_iva = fields.Boolean(string='Imputa al IVA' ,default = False)
+    dv = fields.Char('Digito Verificador', size=2)
+    dv_representante = fields.Char('DV del representante legal', size=2)
+    representante_legal = fields.Char('Representante legal')
+    actividad = fields.Char('Actividad Comercial')
+    regimen = fields.Selection([('1','B2B'),('2','B2C'),('3','B2G'),('4','B2F')],'Tipo Régimen')

BIN
res_company.pyc


+ 38 - 0
res_company_view.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="res_company_set">
+            <field name="name">res.company.set</field>
+            <field name="model">res.company</field>
+            <field name="inherit_id" ref="base.view_company_form"/>
+            <field name="arch" type="xml">
+                <field name="website" position="before">
+                    <field name="representante_legal"/>
+                    <field name="dv_representante"/>
+                    <field name="codigo_actividad"/>
+                    <field name="actividad"/>
+                    <field name="codigo_establecimiento"/>
+                    <field name="establecimiento"/>
+                    <field name="punto_expedicion"/>
+                    <field name="regimen"/>
+                    <field name="imputa_ire"/>
+                    <field name="imputa_irp_isp"/>
+                    <field name="imputa_iva"/>
+                </field>
+
+
+
+            </field>
+        </record>
+        <!-- <record id="res_partner_extra_data_search" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.search</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_res_partner_filter"/>
+            <field name="arch" type="xml">
+                <field name="name" position="before">
+                    <field name="ruc" filter_domain="['|','|','|','|',('ruc','ilike',self),('name','ilike',self),('mobile','ilike',self),('phone','ilike',self),('email','ilike',self)]" string="general"/>
+                </field>
+            </field>
+        </record> -->
+    </data>
+</openerp>

+ 47 - 0
ruc_documentos_timbrados.py

@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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, tools, api, _
+
+class ruc_documentos_timbrados(models.Model):
+    _name = 'ruc.documentos.timbrados'
+    _description = 'Agrega datos sobre timbrado'
+
+    name = fields.Char('Número de timbrado')
+    nombre_documento = fields.Char('Descripción del documento')
+    tipo_documento = fields.Selection([('1','Factura'),('2','Factura electrónica de exportación'),('3','Factura electrónica de importación')],'Tipo documento')
+    timbrado_electronico = fields.Selection([('1','Factura electrónica'),('2','Factura electrónica de exportación'),('3','Factura electrónica de importación'),('4','Autofactura electrónica'),('5','Nota de crédito electrónica'),('6','Nota de débito electrónica'),('7','Nota de remisión electrónica'),('8','Comprobante de retención electrónico')],'Tipo de documento electrónico')
+    actividad_economica = fields.Char('Actividad económica')
+    codigo_actividad = fields.Char('Código de actividad económica')
+    fecha_inicio = fields.Date(string='Fecha inicio de validez')
+    fecha_final = fields.Date(string='Fecha de expiración de timbrado')
+    activo = fields.Boolean(string='Activo' ,default = True)
+    suc = fields.Char('Suc')
+    sec = fields.Char('Sec')
+    nro_ini = fields.Integer('Nº inicial')
+    nro_fin = fields.Integer('Nº final')
+    ultimo_nro_utilizado = fields.Integer('Nro actual')
+    id = fields.Integer('ID')
+    company_id = fields.Many2one('res.company', string='Compañia')
+    company_name =  fields.Char(string='Compañia', related='company_id.name', readonly=True)
+    invoice_ids = fields.One2many('account.invoice', 'partner_id', string='Facturas',
+        readonly=True, copy=False)
+    user_ids = fields.Many2many('res.users', string='Usuarios')

BIN
ruc_documentos_timbrados.pyc


+ 71 - 0
ruc_documentos_timbrados_view.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="ruc_documentos_timbrados_form">
+            <field name="name">ruc.documentos.timbrados.form</field>
+            <field name="model">ruc.documentos.timbrados</field>
+            <field name="inherit_id"/>
+            <field name="arch" type="xml">
+              <form string="Talonario">
+                                  <!-- <header>
+                                      <button name="crear_zip" string="Crear ZIP" type="object" attrs="{'invisible':[('state', 'not in', ('borrador'))]}"/>
+                                      <button name="enviar" string="Enviar" type="object" class="oe_highlight" attrs="{'invisible':[('state', 'in', ('enviado','cerrado'))]}"/>
+                                      <button name="consultar_estado" string="Consultar Estado" type="object" class="oe_highlight" attrs="{'invisible':[('state', 'not in', ('enviado'))]}"/>
+                                      <field name="state" widget="statusbar" nolabel="1"/>
+                                  </header> -->
+                                  <sheet>
+
+                                      <group>
+                                        <group>
+                                             <field name="name"/>
+                                             <field name="nombre_documento"/>
+                                             <field name="tipo_documento"/>
+                                             <field name="fecha_inicio"/>
+                                             <field name="fecha_final"/>
+                                             <!-- <field name="nro_autorizacion_autoimpresor"/> -->
+                                             <field name="activo"/>
+
+                                         </group>
+                                         <group>
+                                             <field name="suc"/>
+                                             <field name="sec"/>
+                                             <field name="nro_ini"/>
+                                             <field name="nro_fin"/>
+                                             <field name="ultimo_nro_utilizado"/>
+                                             <field name="company_id" />
+                                         </group>
+                                      </group>
+                                      <group>
+                                          <group string="Usuarios habilitados">
+                                              <field name="user_ids"/>
+                                          </group>
+                                      </group>
+                                    </sheet>
+
+                                  <notebook>
+                                     <page string="Facturas">
+                                         <field name="invoice_ids"/>
+                                     </page>
+                                 </notebook>
+
+            </form>
+          </field>
+        </record>
+
+        <!-- tree view -->
+
+        <record id="ruc_documentos_timbrados_tree_view" model="ir.ui.view">
+            <field name="name">ruc.documentos.timbrados.tree</field>
+            <field name="model">ruc.documentos.timbrados</field>
+            <field name="arch" type="xml">
+                <tree string="Talonario">
+                  <field name="name"/>
+                  <field name="tipo_documento"/>
+                  <field name="fecha_inicio"/>
+                  <field name="fecha_final"/>
+                </tree>
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 69 - 0
set_menu.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <menuitem name="SET" id="menu_set" parent="account.menu_finance" sequence="51" />
+
+        <!-- <record id="set_lote_view" model="ir.actions.act_window">
+            <field name="name">EnvioLote</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">envio.lotes</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="set_paraguay.envio_lotes_tree_view"/>
+        </record>
+
+        <menuitem id="menu_set_lotes" parent="menu_set" action="set_paraguay.set_lote_view" name="Envío DE por lotes" sequence="99"/>
+
+        <record id="set_eventos_view" model="ir.actions.act_window">
+            <field name="name">EventosDte</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">eventos.dte</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="set_paraguay.eventos_dte_tree_view"/>
+        </record>
+
+
+        <menuitem action="set_paraguay.set_eventos_view" name="Eventos DTE" id="menu_set_eventos" sequence="100"
+            parent="menu_set"/>
+
+        <record id="set_consulta_view" model="ir.actions.act_window">
+            <field name="name">ConsultaDte</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">consulta.dte</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="set_paraguay.consulta_dte_tree_view"/>
+        </record>
+
+        <menuitem action="set_paraguay.set_consulta_view" name="Consulta DTE" id="menu_set_consulta" sequence="120"
+            parent="menu_set"/>
+
+        <record id="set_resultado_view" model="ir.actions.act_window">
+            <field name="name">MensajeResultado</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">mje.resultado</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="set_paraguay.mje_resultado_tree_view"/>
+        </record>
+
+        <menuitem action="set_paraguay.set_resultado_view" name="Consulta de mensajes de resultado" id="menu_set_resultado" sequence="120"
+            parent="menu_set"/> -->
+
+            <record id="set_timbrado_view" model="ir.actions.act_window">
+                <field name="name">Timbrado</field>
+                <field name="type">ir.actions.act_window</field>
+                <field name="res_model">ruc.documentos.timbrados</field>
+                <field name="view_type">form</field>
+                <field name="view_mode">tree,form</field>
+                <field name="view_id" ref="set_paraguay.ruc_documentos_timbrados_tree_view"/>
+            </record>
+
+        <menuitem action="set_paraguay.set_timbrado_view" name="Timbrado" id="menu_set_timbrado" sequence="122"
+              parent="menu_set"/>
+
+
+
+    </data>
+</openerp>

BIN
static/description/icon.png