www.numberspeaks.com

BLOG

windows logo

Kill remote desktop session

Remote desktop sometimes gives me this error message “The terminal server has exceeded the maximum number of allowed connections.” It means my previous remote desktop session has been lost or allowed connections are full. I order to solve this, if you don’t mind losing your unsaved work, you will need to kill a session to open a new one, replace 192.168.1.1 by your server’s IP on the following command.

Odoo 11 community SO PO iOS approval

 Simple app to approve Odoo SO, PO from your iPhone / iPad, it has been tested only on Odoo Community 11, but it should work with newer version also. It requires an additional module on Odoo available on Github (link bellow). Odoo – NS module will add “Waiting for confirmation” Status on sale.order and purchase.order model.You will be able to customize the module and add any document that needs approval (like Invoices, payment confirmation, etc…)Long press on document from Odoo – NS iOS app will display PDF.If you have any question, you can contact me here:https://www.numberspeaks.com/contact/ 

How to protect Odoo against brute force attack behind Nginx or Caddy

Odoo community is not protected against brute force attack by default, the system is vulnerable over internet, however Odoo store provides auth_brute_force App which can handle this task, it’s available through this link. But it doesn’t work correctly behind a reverse proxy such as Caddy or Nginx. In the second part of this post, i’ll explain the little tip to make it work. Download and install the module Download the file corresponding to your version of Odoo. Unzip the file “auth_brute_force-9.0.1.1.0.zip”. Move the folder “auth_brute_force” to your module folder: “/usr/lib/python2.7/dist-packages/openerp/addons/“. Enable the developper mode through “About” popup. Then go to …

How to use datetime in Python

  Exemple 1 : subtract 2 dates run the command. Exemple 2 : add or subtract days to a date run the command. Exemple 3 : today date Exemple 4 : convert string to datetime Exemple 5 : convert datetime to string

How to get data from URL with a controller in Odoo 9

Create under your module a folder controller, in that folder create files controller.py and __init__.py and link your new file in __init__.py, don’t forget to add controller folder in the __init__.py at the root folder of your module. controller.py code bellow will make available the URL www.myodoo.com/page/random/random_variable, random_variable value will be stored in values dictionary on key variable. in folder view of your module create the file template.xml

Import xlsx file Odoo 11 – Sales orders

I will describe the basis in python to import xlsx file and how to handle the imported data, in this exemple sales orders is imported. Uploaded file is stored in the variable upload_file and is encoded in base 64, to read it we have to decode first the data by using b64decode function, then save it, for me i chose “/tmp” folder. Result import_data is an array of dictionary as follow [{‘column_name_1’:data_column_1_row_1, ‘column_name_2’:data_column_2_row_1,…},{‘column_name_1’:data_column_1_row_2, ‘column_name_2’:data_column_2_row_2,…},…] Bellow XML view for the importation module.