Merge branch 'various_fixes'

This commit is contained in:
Frederik Jaeckel 2024-12-19 11:35:33 +01:00
commit 6c47581745
3 changed files with 20 additions and 7 deletions

View file

@ -144,12 +144,20 @@ class EdocumentMixin(object):
def tax_unece_code(self, tax):
""" 'tax': invoice.line
"""
if not (tax.unece_code or ''):
unece_code = self.get_tax_unece_code(tax)
if not unece_code:
raise UserError(gettext(
'edocument_xrechnung.msg_tax_code_missing',
taxname=tax.rec_name))
return tax.unece_code
def get_tax_unece_code(self, tax):
while tax:
if tax.unece_code:
return tax.unece_code
break
tax = tax.parent
def get_category_code(self, tax):
while tax:
if tax.unece_category_code: