'Returns the IDs of all ancestor charts, including the chart itself.
(inverse of child_of operator)
:param browse_record chart_template: the account.chart.template record
:return: the IDS of all ancestor charts, including the chart itself.'

@api.model
def _get_chart_parent_ids(self, chart_template):

    result = [chart_template.id]
    while chart_template.parent_id:
        chart_template = chart_template.parent_id
        result.append(chart_template.id)
    return result
