Skip to content

Instantly share code, notes, and snippets.

View alcidesrivera's full-sized avatar

alcidesrivera

  • VIRTUALSAMI CIA. LTDA.
  • Ibarra
View GitHub Profile
@alcidesrivera
alcidesrivera / log_error
Created October 13, 2014 20:43
Error factura de proveedor
2014-10-13 20:20:52,439 9693 ERROR xxxxx openerp.tools.safe_eval: Cannot eval u'action_invoice_create()'
Traceback (most recent call last):
File "/home/servidor/apps/openerp-7.0/server/openerp/tools/safe_eval.py", line 285, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "", line 1, in <module>
File "/home/servidor/apps/openerp-7.0/server/openerp/osv/orm.py", line 377, in function_proxy
return attr(self._cr, self._uid, [self._id], *args, **kwargs)
File "/home/servidor/apps/openerp-7.0/addons/purchase/purchase.py", line 561, in action_invoice_create
inv_id = inv_obj.create(cr, uid, inv_data, context=context)
File "/home/servidor/apps/openerp-7.0/addons/mail/mail_thread.py", line 252, in create
@alcidesrivera
alcidesrivera / firma_electronica.py
Last active October 5, 2022 12:37
Firma Electrónica SRI Ecuador
# -*- coding: utf-8 -*-
##############################################################################
#
# E-Invoice Module - Ecuador
# Copyright (C) 2014 VIRTUALSAMI CIA. LTDA. All Rights Reserved
# alcides@virtualsami.com.ec
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@alcidesrivera
alcidesrivera / einvoice.py
Last active April 29, 2024 14:46
Electronic Document SRI Ecuador
# -*- coding: utf-8 -*-
##############################################################################
#
# E-Invoice Module - Ecuador
# Copyright (C) 2014 VIRTUALSAMI CIA. LTDA. All Rights Reserved
# alcides@virtualsami.com.ec
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# -*- coding: utf-8 -*-
##############################################################################
#
# Account Module - Ecuador
# Copyright (C) 2014 Cristian Salamea All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
OpenERP Server Error
Client Traceback (most recent call last):
File "/home/openerp/apps/openerp-7.0/web/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/home/openerp/apps/openerp-7.0/web/addons/web/controllers/main.py", line 1132, in call_button
action = self._call_kw(req, model, method, args, {})
File "/home/openerp/apps/openerp-7.0/web/addons/web/controllers/main.py", line 1120, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/home/openerp/apps/openerp-7.0/web/addons/web/session.py", line 42, in proxy
factura = self._generate_xml_invoice(obj, access_key, emission_code)
xades = Xades()
file_pk12 = obj.company_id.electronic_signature
password = obj.company_id.password_electronic_signature
xmlstr = etree.tostring(factura, encoding='utf8', method='xml')
p = Popen([JAVA_CMD, '-jar', JAR_PATH, xmlstr, file_pk12, password], stdout=PIPE, stderr=STDOUT)
resultado = p.communicate()[0]
@alcidesrivera
alcidesrivera / Xades.py
Last active August 29, 2015 14:24
Xades
class Xades(object):
def apply_digital_signature(self, xml_document, file_pk12, password):
"""
Metodo que aplica la firma digital al XML
"""
JAR_PATH = 'firma/firmaXadesBes.jar'
JAVA_CMD = 'java'
ds_document = False
xml_str = etree.tostring(xml_document, encoding='utf8', method='xml')
@alcidesrivera
alcidesrivera / sri.py
Last active September 5, 2022 21:13
SRI
@classmethod
def send_receipt(self, xml):
buf = StringIO.StringIO()
buf.write(xml)
buffer_xml = base64.encodestring(buf.getvalue())
client = Client(self.__WS_TEST_RECEIV)
result = client.service.validarComprobante(buffer_xml)
mensaje_error = ""
if (result[0] == 'DEVUELTA'):
Traceback (most recent call last):
File "/home/openerp/apps/odoo/openerp/http.py", line 537, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/openerp/apps/odoo/openerp/http.py", line 574, in dispatch
result = self._call_function(**self.params)
File "/home/openerp/apps/odoo/openerp/http.py", line 310, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/openerp/apps/odoo/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/home/openerp/apps/odoo/openerp/http.py", line 307, in checked_call