miércoles, 21 de mayo de 2014

[SOLVED] Servers Digital Ocean with timezone problems

use this command
cp /usr/share/zoneinfo/Europe/Madrid /etc/localtime 

lunes, 19 de mayo de 2014

How to create certificates in a single line

complete as follows
/C= Country Name (2 letter code)
/ST= State or Province Name (full name)
/L= Locality Name
/O= Organization Name
/OU= Organizational Unit Name
/CN=website.com
openssl req -new -newkey rsa:4096 -days 2 -nodes -x509 -subj "/C=SP/ST=Madrid/L=Madrid/O=Empresa/OU=Internet Services/CN=website.com" -keyout server.key  -out server.cert
view example in github

lunes, 17 de febrero de 2014

Solution jQueryMobile viewport tag

If we use the jQueryMobile library, it may not work the viewport tag
Si usamos la librería jQueryMobile es muy posible que tengamos problemas para que nos funcione la etiqueta viewport
<html>
<head>
...
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
...
</head>
<body>
...
</body>
It has very easy solution. First step to remove the label.
Bueno por suerte tiene muy fácil solución. Primer paso eliminar la etiqueta.
Second step, add an instruction using javascript with jquery.
Segundo paso, añadimos mediante una instrucción javascript con jquery.
jQuery(document).bind('mobileinit', function(){
        jQuery.mobile.metaViewportContent = 'width=device-width, minimum-scale=1, maximum-scale=2';
});
With this statement, we can zoom in on our mobile device.
Con esta instrucción, podremos hacer zoom en nuestro dispositivo movil.

jueves, 6 de febrero de 2014

Translate the organization number of internal number of SAP


    CALL METHOD cl_crm_org_management=>get_instance
      IMPORTING
        ev_instance = lv_orgman.

    CALL METHOD lv_orgman->get_sales_org_of_vkorg
      EXPORTING
        iv_vkorg            = lv_s_vkorg
      IMPORTING
        ev_sales_org        = lv_sales_org
      EXCEPTIONS
        crm_key_not_defined = 1.

How to delete the zeros of a variable?

Use this function, and convert 00001 to 1.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
      input  = lv_partner
    IMPORTING
      output = lv_partner.

lunes, 3 de febrero de 2014

SAP Cheat Cube CRM version


Copying the idea of Cube Cheat. I have prepared one. You may download the image and print it for your personal use.

Copiando la idea de los Cheat Cube. He preparado uno. Podéis descargar la imagen sin problema he imprimirla para vuestro uso personal.

Here is a preview of the final result.

Aquí una preview del resultado final.

sábado, 18 de enero de 2014

Get BP number with customer user (Obtén el numero de BP con el usuario del cliente)

Only use one function. It's very simple.

      CALL FUNCTION 'YCRM_CC_FUNC_GET_FRONT_OFFICE'
        EXPORTING
          user       = sy-uname 
        IMPORTING
          og_partner = lv_bp.

sy-uname is the global variable in ABAP contains the current user.
lv_bp is the local variable containing BP code.

Read structures and get the sales manager (leer la estructura y obtener el jefe de ventas)

For example, i need to get my sales manager of the organizational structure. The function is this
  CALL FUNCTION 'RH_STRUC_GET'
    EXPORTING
      act_otype      = 'BP'
      act_objid      = partner_no #enter de Partner number
      act_wegid      = 'BP-CP-O'  #we indicate that we want to get
      act_tdepth     = 0
    TABLES
      result_tab     = lt_result #here the result
    EXCEPTIONS
      no_plvar_found = 1
      no_entry_found = 2
      OTHERS         = 3.

Install OpenERP7 in Linux with HTTPS (Instalar OpenERP7 en Linux con HTTPS)

Is the time to upgrade. Ok, i will change many things. Conclude with Ubuntu and only use Debian. Continued...
Es la hora de actualizarse. Ok, voy a cambiar muchas cosas. Termino con Ubuntu y sólo usaremos Debian. Continuamos...

The new version has changed many things, easier installation. (in previous post Instalar OpenERP 6 de un golpe):
La nueva versión a cambiado muchas cosas, una instalación más sencilla. (en post anteriores Instalar OpenERP 6 de un golpe):

Add in /etc/apt/sources.list
echo "deb http://nightly.openerp.com/7.0/nightly/deb/ ./" >> /etc/apt/sources.list
sudo apt-get update; sudo apt-get install openerp

And wait...
sudo service openerp start

We can see the log, while loading
Podemos ver el log, mientras carga
watch tail /var/log/openerp/openerp-server.log

When loaded, configure the HTTPS
Cuando esté cargado, configuramos el HTTPS
First, we block the default port 8069
Primero, bloqueamos el puerto por defecto 8069
sudo iptables -A INPUT -i eth0 -p tcp --destination-port 8069 -j DROP

Second, we create the SSL
Segundo, creamos el SSL
#need these packages
sudo aptitude install apache2
sudo a2enmod ssl proxy_http headers rewrite

#Create de certificate
sudo mkdir /etc/ssl/openerp
cd /etc/ssl/openerp
openssl genrsa -des3 -out openERPserver.pkey 1024
openssl rsa -in openERPserver.pkey -out openERPserver.key
openssl req -new -key openERPserver.key -out openERPserver.csr

openssl x509 -req -days 365 -in openERPserver.csr -signkey openERPserver.key -out openERPserver.crt

Now we need to configure Apache to use SSL with openERP.
Ahora tenemos que configurar apache para que use SSL con openERP.
#Create the openerp file withthis content
sudo nano /etc/apache2/sites-available/openerp

#openerp file

       SSLEngine on
       SSLCertificateFile /etc/ssl/openerp/oeserver.crt
       SSLCertificateKeyFile /etc/ssl/openerp/oeserver.key

       ProxyRequests Off

       
              Order deny,allow
              Allow from all
       

       ProxyVia On
       ProxyPass / http://127.0.0.1:8069/

       
              ProxyPassReverse /
       

       RequestHeader set “X-Forwarded-Proto” “https”

       SetEnv proxy-nokeepalive 1

And finally we enable our configuration
Ya por último habilitamos nuestra configuración
sudo a2ensite openerp

We have already completed. Now run
Ya hemos finalizado. Ahora ejecutamos
https://ipservidor