Sven Fuehr bf9e47e479 [FIX] l10n_es_edi_tbai: fix discount computation traceback
Currently there is a traceback in case of a 100% discount on an invoice line.
This commit fixes the issue by computing the discount differently.

Previously it was tried to calculate the discount amount from the
discounted value and the discount factor.
This is (mathematically) not possible if the discounted value is 0.
After this commit we compute and use the undiscounted value in case
the discount is 100% to compute the discount amount.

The computation was adapted from '_prepare_edi_vals_to_export' from account.move.line

Reproduce
  1. Install l10n_es_edi_tbai
  2. Select the Spanish company
  3. Settings > Accounting: Ensure "Test Mode" is set in Spain Localization section
  4. Create a new invoice with Spanish customer
  5. Add a line with a 100% discount
  6. Confirm the invoice
  7. Process the invocie with TicketBAI
  8. Error / Traceback

opw-3572426

closes odoo/odoo#144571

X-original-commit: 74aa7136fea8bd0f962c577fba89bbd4f7618742
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2023-12-01 19:25:32 +00:00
2023-10-27 08:36:16 +00:00
2023-11-02 21:02:44 +00:00
2023-11-20 04:58:31 +00:00
2023-12-01 18:14:20 +00:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

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

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%