From 3bb774d6deb6ca75e0ba11ba563fac067b7332de Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 2 May 2017 15:19:36 +0200 Subject: [PATCH] [IMP] account: add a default 'cash basis tax journal' upon chart template installation. This is probably needed by all countries that use caseh basis taxes, and will save them the journal creation + save of the settings. --- addons/account/models/chart_template.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 87b76b4e9d1..83ecd07ea89 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -41,6 +41,7 @@ def migrate_tags_on_taxes(cr, registry): if len(tax_id.ids) == 1: tax_id.sudo().write({'tag_ids': [(6, 0, tax_template.tag_ids.ids)]}) + # --------------------------------------------------------------- # Account Templates: Account, Tax, Tax Code and chart. + Wizard # --------------------------------------------------------------- @@ -161,6 +162,8 @@ class AccountChartTemplate(models.Model): journal = JournalObj.create(vals_journal) if vals_journal['type'] == 'general' and vals_journal['code'] == _('EXCH'): company.write({'currency_exchange_journal_id': journal.id}) + if vals_journal['type'] == 'general' and vals_journal['code'] == _('CABA'): + company.write({'tax_cash_basis_journal_id': journal.id}) return True @api.multi @@ -182,7 +185,8 @@ class AccountChartTemplate(models.Model): journals = [{'name': _('Customer Invoices'), 'type': 'sale', 'code': _('INV'), 'favorite': True, 'sequence': 5}, {'name': _('Vendor Bills'), 'type': 'purchase', 'code': _('BILL'), 'favorite': True, 'sequence': 6}, {'name': _('Miscellaneous Operations'), 'type': 'general', 'code': _('MISC'), 'favorite': False, 'sequence': 7}, - {'name': _('Exchange Difference'), 'type': 'general', 'code': _('EXCH'), 'favorite': False, 'sequence': 9},] + {'name': _('Exchange Difference'), 'type': 'general', 'code': _('EXCH'), 'favorite': False, 'sequence': 9}, + {'name': _('Cash Basis Tax Journal'), 'type': 'general', 'code': _('CABA'), 'favorite': False, 'sequence': 10}] if journals_dict != None: journals.extend(journals_dict)