Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] l10n_ke_edi_tremol: currency rate zero division error
When posting an invoice to the fiscal device, the currency rate is calculated from an invoice line by dividing its balance by the lines subtotal. This is because the balance in the database will be in KES (Kenyan shillings), whereas the currency on the line can differ. From v16.0 onwards the way that a line is retrieved in order to calculate the currency rate incorrect. When (for example) an invoice has 'Section' lines, then a division by zero is attempted (resulting in a zero division error). This commit amends the line so that the first line of the previously assigned 'lines' variable is used instead. This variable contains only valid invoice lines (non-zero, non-display type etc). It is already done this way from v15.0 onwards (up to v16.0). closes odoo#110143 Signed-off-by: Josse Colpaert <[email protected]>
- Loading branch information