viernes, 20 de mayo de 2016

Only things... how to get a backup from Odoo using wget

Hi everyone, my recent publication:
Go to my Gist page

Is very easy, with this line you can download ZIP file backup for you Odoo server.

Nice, and see you

domingo, 5 de julio de 2015

How to know my public IP in terminal

Hi everybody, today i share a simple list for get your public IP in linux command line.
First command, check your IP using dyndns service is very long command.
curl -s | grep -o "[[:digit:].]\+"
This is short command and very easy to remember.
Ipify is the same than ifconfig but response is in JSON format, prefer for webservices or other apps.
curl ''
Mi favorite is this command, is very elegant only send a request to obtain IP using DNS server.
dig +short
Other command is the same that others.
For to use this commands you need to install curl and digpackages.
For use curl install sudo aptitude install curl
For use dig install sudo aptitude install dnsutils

viernes, 3 de julio de 2015

Differents cases for you don't use position="replace" in Odoo xml

Hi everybody, today i explain how to use position attribute in Odoo XML.

Realy is very easy, only you never forget this rule:

Never use this attribute position="replace" NEVER NEVER.
<field name="street" position="replace">
    <!-- .... Never use!!!! -->
Exist other for example position="attribute", position="after", position="before"
<!-- You need add new attributes to field -->
<field name="street" position="attribute">
    <attribute name="class">big_field</attribute>
    <attribute name="value">Default Value</attribute>
    <attribute name="style">boder:solid 0.1em #f00;</attribute>

<!-- You need add other field after that -->
<field name="street" position="after">
    <field name="street2"/>

<!-- You need add other field before that -->
<field name="street" position="before">
    <field name="first_name"/>
Is very importan in your addons not use replace attribute because is posible in your view or inherit view other addons touch the same part and cause error and generates incompatibilities.

Other example with xpath expresion
<!-- add in all links with class 
is menu_links text color red. -->
<xpath expr="//a[@class='menu_links']" position="attributes">
    <attribute name="style">color:#f00;</attribute>

<!-- add in only in first link with class 
is menu_links text color red. -->
<xpath expr="//a[@class='menu_links'][0]" position="attributes">
    <attribute name="style">color:#f00;</attribute>

<!-- add in only in second link with class 
is menu_links text color red. -->
<xpath expr="//a[@class='menu_links'][1]" position="attributes">
    <attribute name="style">boder:solid 0.1em #f00;</attribute>
The last example is very dangerous because is possible the second link not exist and cause error.

lunes, 22 de junio de 2015

My return random.randint(0, 1)

Hi everybody, i didn't posted like before days.
But the summer arrive and i will try posts new content. Now a days i publised a lot of commits and PR's (pull request) in my github account ( i will try posted all interesting things in my blog.

This is only a notify posts but the next posts i promise i published interesting things.

Thanks for followme @endika_iglesias

domingo, 1 de febrero de 2015

How to check if my website this ON?

With Selenium language, is very easy. Only need installed selenium python library.
Simple example using Selenium library
browser = webdriver.Firefox()
assert 'Google' in browser.title
In this example only checked if has the "Google" title.

Now, if don't has the correct title the webs site, takes a screenshot.
browser = webdriver.Firefox()
if 'Google' not in browser.title:
    base64 = browser.get_screenshot_as_base64()
Finally, you can program tasks to check your websites and send email on error. If you want see the full example code go to this url Github/Endika/test_script/

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
openssl req -new -newkey rsa:4096 -days 2 -nodes -x509 -subj "/C=SP/ST=Madrid/L=Madrid/O=Empresa/OU=Internet Services/" -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
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
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(){ = '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
        ev_instance = lv_orgman.

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

How to delete the zeros of a variable?

Use this function, and convert 00001 to 1.
      input  = lv_partner
      output = lv_partner.