chart_template.py 604 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from odoo import models
  3. class AccountChartTemplate(models.Model):
  4. _inherit = 'account.chart.template'
  5. # Write paperformat and report template used on company
  6. def _load(self, company):
  7. res = super(AccountChartTemplate, self)._load(company)
  8. if self == self.env.ref('l10n_at.l10n_at_chart_template'):
  9. company.write({
  10. 'external_report_layout_id': self.env.ref('l10n_din5008.external_layout_din5008').id,
  11. 'paperformat_id': self.env.ref('l10n_din5008.paperformat_euro_din').id
  12. })
  13. return res