b18caa77713646f0807754448ebccb421f07334a
This module implements communication with the fiscal device for submitting invoices to the KRA (Kenya Revenue Authority). The device supported in this module is the Tremol G03. -- COMMUNICATION FLOW SUMMARY -- 1. "Send Invoice To Device" on account move is clicked 2. l10n_ke_action_cu_post triggers a client action, with serialised invoice data. (more details below) 3. The client action uses the 'post_send' function defined in javascript to forward the request to the /hw_proxy/l10n_ke_cu_send endpoint on the proxy server (more details below) 4. The proxy server wraps the serialised data with the appropriate bytes (for instance, a couple of a checksum bytes), and sends them to the device through serial communication (more details below) 5. The data returned from the fiscal device is communicated back in the request. The client action 'post_send' then triggers the 'l10n_ke_cu_response' with an rpc call, with the aforementioned data from the fiscal device (more details) 2. The module l10n_ke_edi_tremol inherits from the account_move model in order to provide methods for serialising the data of the account_move and sending it to the proxy server. Fields have been added to the product template to define the HS Code and HS Name (data which is required by the KRA in some circumstances). A field has also been added to the company defining the address of the proxy server. The fields added on the account move are populated by the data returned by the fiscal device, this includes the device serial number, the invoice number on the device, the URL of the invoice on the KRA web portal, and the date/time the invoice was signed. 3. Communication between the client database and the proxy server is defined using a client action defined in l10n_ke_edi_tremol/static/src/js/send_invoice.js. This allows users who aren't on-premise to communicate with the device, provided the proxy is accessible on the network that the user is on. 4. The proxy server is an intermediary server that should be connected to the tremol G03, and running the IOT drivers from hw_drivers. The driver that supports communication between the proxy server and the fiscal device has been defined in this commit inside of hw_drivers/iot_handlers/drivers//L10nKeEDISerialDriver.py. The proxy server can be run on the IOT box, or on odoo community by running: ./odoo-bin addons-path=.... -d dbname --load hw_drivers --proxy-mode ** all messages are encoded/decoded with cp1251, as defined in the protocol. The company vat code is sent along with the request to compare that sent with that of the device. The 'serial_number' of the device is always returned along with the request, since it is required for the invoice details, and it is retrieved as part of the query to find the registered VAT code on the device. --- DATA and VIEWS --- product_view: adds HS Name, and HS Code on the product product and product template form views. report_invoice: adds to the invoice qweb template such that a section including the fiscal device / KRA details is included at the bottom of the invoice when the invoice is rendered as a pdf. res_config_settings_view: adds makes the proxy address field editable from the config settings. account_move_view: add a tab for the tremol device details and the qr code on the account move form view. The KRA invoice number is also added as an optional field on the account move tree view, and the invoice search view is inherited to make this field searchable too. (l10n_ke) account_tax_report_data, account_tax_template_data: The tax report is defined for Kenya, and tax tags that link to the lines on this tax report are defined on the existing taxes. This allows the classification of the tax, between zero-rated and exempt, during the serialisation. closes odoo/odoo#106654 Task-id: 2950308 X-original-commit: b0be9e074a1ecf1f6de7a03c71df0c63868501e3 Signed-off-by: Josse Colpaert <jco@odoo.com> Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%