www.numberspeaks.com

BLOG

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 …

Add menu in dropdown list on tree view – Odoo 9

To add an additional menu in action dropdown list on tree view, we need to register “ir.actions.server” and “ir.values” on the qweb/xml file as follow. Note that code field name is using old Odoo python API. In your sale order model create the method as bellow with Odoo new API. Restart odoo and upgrade your module, you’ll have now cancel menu on your sales order tree view.

POS order to quotation in Odoo 9

Odoo 9 community does not have a button to generate from the POS (Point of Sale) Order a quotation (Sales Order), here is the following code of my module pos_2_so. Folders arborescence will have as sub folders :  model, view, static, ref the print screen : We will start by adding a new button on the interface of the pos, in the folder static/src/xml/, we create a new file named pos_2_so.xml. Bellow is its QWeb xml code : This portion of code creates a template named pos2sopad which include only a button : We need to set a placeholder by adding …

Artisan mousepad

Artisan is a Japanese brand that specializes in creating high-quality artisan mousepads. These mousepads are made using premium materials, such as silica gel and cloth, and are known for their smooth and consistent surface that provides an excellent tracking experience for gaming mice. What sets Artisan mousepads apart from other brands is their focus on both form and function. These mousepads are not just functional, but also have a unique and attractive design that adds to the overall aesthetic of a computer setup. They come in a variety of sizes, shapes, and colors, so there is something for everyone.Another notable …

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.

Odoo 11 how to avoid loading the homepage after module upgrade

​ Download on GitHub Download upgrade module Odoo 11 redirects the user to his homepage after a module upgrade, to avoid this trouble I made a small modification of the module upgrade behavior. Additional module is available here. It inherits only the model “ir.module.module” and override “_button_immediate_function” method.