| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
from odoo import models |
| 3 |
from odoo.addons.account.models.chart_template import template |
| 4 |
|
| 5 |
|
| 6 |
class AccountChartTemplate(models.AbstractModel): |
| 7 |
_inherit = 'account.chart.template' |
| 8 |
|
| 9 |
@template('fr') |
| 10 |
def _get_fr_template_data(self): |
| 11 |
return { |
| 12 |
'code_digits': 6, |
| 13 |
'property_account_receivable_id': 'fr_pcg_recv', |
| 14 |
'property_account_payable_id': 'fr_pcg_pay', |
| 15 |
'downpayment_account_id': 'pcg_4191', |
| 16 |
} |
| 17 |
|
| 18 |
@template('fr', 'res.company') |
| 19 |
def _get_fr_res_company(self): |
| 20 |
return { |
| 21 |
self.env.company.id: { |
| 22 |
'account_fiscal_country_id': 'base.fr', |
| 23 |
'bank_account_code_prefix': '512', |
| 24 |
'cash_account_code_prefix': '53', |
| 25 |
'transfer_account_code_prefix': '58', |
| 26 |
'account_default_pos_receivable_account_id': 'fr_pcg_recv_pos', |
| 27 |
'income_currency_exchange_account_id': 'pcg_766', |
| 28 |
'expense_currency_exchange_account_id': 'pcg_666', |
| 29 |
'account_journal_suspense_account_id': 'pcg_471', |
| 30 |
'account_journal_early_pay_discount_loss_account_id': 'pcg_665', |
| 31 |
'account_journal_early_pay_discount_gain_account_id': 'pcg_765', |
| 32 |
'deferred_expense_account_id': 'pcg_486', |
| 33 |
'deferred_revenue_account_id': 'pcg_487', |
| 34 |
'l10n_fr_rounding_difference_loss_account_id': 'pcg_658', |
| 35 |
'l10n_fr_rounding_difference_profit_account_id': 'pcg_758', |
| 36 |
'account_sale_tax_id': 'tva_normale', |
| 37 |
'account_purchase_tax_id': 'tva_acq_normale', |
| 38 |
'expense_account_id': 'pcg_607_account', |
| 39 |
'income_account_id': 'pcg_707_account', |
| 40 |
'account_stock_journal_id': 'inventory_valuation', |
| 41 |
'account_stock_valuation_id': 'pcg_31_account', |
| 42 |
}, |
| 43 |
} |
| 44 |
|
| 45 |
@template('fr', 'account.journal') |
| 46 |
def _get_fr_account_journal(self): |
| 47 |
return { |
| 48 |
'sale': {'refund_sequence': True}, |
| 49 |
'purchase': {'refund_sequence': True}, |
| 50 |
} |
| 51 |
|
| 52 |
def _get_bank_fees_reco_account(self, company): |
| 53 |
# French account for the bank fees reco model. We need to be as precise |
| 54 |
# as possible in case it's modified so it's missing and not replaced. |
| 55 |
fr_account = self.env['account.account'].with_company(company).search([ |
| 56 |
('code', '=', '627800'), |
| 57 |
('account_type', '=', 'expense'), |
| 58 |
('name', '=', 'Other expenses and commissions on services supplied'), |
| 59 |
], limit=1) |
| 60 |
return fr_account or super()._get_bank_fees_reco_account(company) |
| 61 |
|
| 62 |
@template('fr', 'account.account') |
| 63 |
def _get_fr_account_account(self): |
| 64 |
return { |
| 65 |
'pcg_31_account': { |
| 66 |
'account_stock_expense_id': 'pcg_601_account', |
| 67 |
'account_stock_variation_id': 'pcg_6031', |
| 68 |
}, |
| 69 |
} |