[FIX] account_edi_ubl_cii: send and print working properly for invoices
with canary islands taxes Steps to reproduce: 1. Go to Apps, and Install the module `l10n_es` 2. Go to Accounting App > Customer invoices 3. Create a new Invoice with fake comany, fake address with state set as `Santa Cruz de Tenerife (ES)` and the ZIP set as 38400. 4. Add any line to the invoice and confirm. 5. Try to Send & Print the invoice, you may need to select the template before. Issue: We won't be able to either print or send the Invoice getting a traceback containing `KeyError: 'tax_details_per_record'`. Solution: Keys for `vals` have change so we need to adapt it to match new keys naming and sorting for accesing the same values. FW - port: master opw-3067491 closes odoo/odoo#107176 X-original-commit: accb722d12e76d178ba70b884a020e162e73634f Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
This commit is contained in:
@@ -88,8 +88,8 @@ class AccountEdiXmlCII(models.AbstractModel):
|
||||
"shall be categorized with an Invoiced item VAT category code (BT-151).")
|
||||
|
||||
def _check_non_0_rate_tax(self, vals):
|
||||
for line_vals in vals['tax_details_per_record']:
|
||||
tax_rate_list = line_vals['line'].tax_ids.flatten_taxes_hierarchy().mapped("amount")
|
||||
for line_vals in vals['tax_details']['tax_details_per_record']:
|
||||
tax_rate_list = line_vals.tax_ids.flatten_taxes_hierarchy().mapped("amount")
|
||||
if not any([rate > 0 for rate in tax_rate_list]):
|
||||
return _("When the Canary Island General Indirect Tax (IGIC) applies, the tax rate on "
|
||||
"each invoice line should be greater than 0.")
|
||||
|
||||
Reference in New Issue
Block a user