[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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user