I want to display all the taxes that are applied in a particular invoice and their amounts[in the tree view of a model account.invoice] This is the output:
The column Tax Lines shows the ids of the taxes that are present in table account.invoice.tax (whereas I want to show their names and corresponding amount)
The model account.invoice has a field called tax_line_ids[Tax Lines] that contains the record of all the taxes on a invoice which is stored in a separate table account.invoice.tax, which in its own tree view looks like this:
I want to extract the tax name and its corresponding amount for it to reflect in account.invoice's tree view
Here's my python code which does'nt seem to work:
@api.one
def taxz(self):
tax_pool = self.pool.get("account.tax")
found_taxes = tax_pool.read(cr, uid, [tax_id,], ["tax_line_ids"], context)
found_tax = found_taxes[0] if found_taxes else None
tax_line_ids = found_tax["tax_line_ids"]
_logger.critical("context type: " + type(context))
_logger.critical("context content: " + str(context))
_logger.critical(tax_line_ids)
xml code for the view:
<field name="tax_line_ids" widget="many2many_tags" />