A quick response code, also known as a QR code, resembles a barcode and is commonly used for information tracking. It consists of a white background with a square grid of black squares that can be read by imaging equipment and store large amounts of data, making it easily accessible.
InOdoo, QR codes are useful for tracking information about products, stock movements, invoices, sales, and purchases. This guide will explain how to create a QR code in Odoo 14 in detail, including an illustration of a QR code for a specific invoice.
The QR code will show information such as the customer, invoice date, and payment reference. A python package called “qrcode” is used to generate QR codes, which makes creating QR code images easy. To use it, the package must first be installed using the “pip3 install qrcode” command in the terminal.
The code example for creating a QR code with invoice information such as customer, invoice date, and payment reference is shown below. The base64 library is imported for the image, and the QR code fields are calculated into the inherited python file, respectively.
Here is the related XML file:
In this example, producing the QR code of an invoice, company name, reference of the payment, client, and salesperson details are added using the
.add dataargument. Additionally, the
make imagefunction of the QR will create an image utilizing all of the arguments.
The associated image can be stored in PNG or SVG format; in this case, PNG is used. It is then encoded with the appropriate value and given to a specific value in the field on the invoice.
When a QR code is scanned, the results are displayed as
By using this technique, we can create a QR code that contains information from several records in Odoo 14.
Reach new heights with WanBuffer’s offshore engineering team. Our team of over 50 highly skilled and dedicated full-stack software engineers have the expertise and experience to tackle your key technology challenges, improve efficiency and reduce expenses. Let us help you drive your business forward today.Let’s Schedule Meeting