diff --git a/addons/account/account.py b/addons/account/account.py index af0d5147220..88d6bebb9f5 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3091,6 +3091,42 @@ class wizard_multi_charts_accounts(osv.osv_memory): default_account = acc_template_ref.get(template.property_account_income_opening.id) return default_account + journal_names = { + 'sale': _('Sales Journal'), + 'purchase': _('Purchase Journal'), + 'sale_refund': _('Sales Refund Journal'), + 'purchase_refund': _('Purchase Refund Journal'), + 'general': _('Miscellaneous Journal'), + 'situation': _('Opening Entries Journal'), + } + journal_codes = { + 'sale': _('SAJ'), + 'purchase': _('EXJ'), + 'sale_refund': _('SCNJ'), + 'purchase_refund': _('ECNJ'), + 'general': _('MISC'), + 'situation': _('OPEJ'), + } + + obj_data = self.pool.get('ir.model.data') + analytic_journal_obj = self.pool.get('account.analytic.journal') + template = self.pool.get('account.chart.template').browse(cr, uid, chart_template_id, context=context) + + journal_data = [] + for journal_type in ['sale', 'purchase', 'sale_refund', 'purchase_refund', 'general', 'situation']: + vals = { + 'type': journal_type, + 'name': journal_names[journal_type], + 'code': journal_codes[journal_type], + 'company_id': company_id, + 'centralisation': journal_type == 'situation', + 'analytic_journal_id': _get_analytic_journal(journal_type), + 'default_credit_account_id': _get_default_account(journal_type, 'credit'), + 'default_debit_account_id': _get_default_account(journal_type, 'debit'), + } + journal_data.append(vals) + return journal_data + def generate_properties(self, cr, uid, chart_template_id, acc_template_ref, company_id, context=None): """ This method used for creating properties.