Skip to content

Commit

Permalink
TA#66667 [MIG] [16.0] canada_account_types
Browse files Browse the repository at this point in the history
  • Loading branch information
rivo2302 committed Aug 27, 2024
1 parent 50beb37 commit 3add2ef
Show file tree
Hide file tree
Showing 8 changed files with 197 additions and 142 deletions.
3 changes: 0 additions & 3 deletions canada_account_types/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ Income Statement
* One-time Expenses
* Tax Expenses

New Categories
--------------

Interest Expenses
~~~~~~~~~~~~~~~~~
In french, this category is named ``Charges d'intérêts``.
Expand Down
4 changes: 2 additions & 2 deletions canada_account_types/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"license": "LGPL-3",
"category": "Accounting",
"summary": "Add account types for Canada.",
"depends": ["account"],
"depends": ["account", "web_custom_label"],
"data": [
"views/account_account_views.xml",
"data/web_custom_label.xml",
],
"installable": True,
}
179 changes: 179 additions & 0 deletions canada_account_types/data/web_custom_label.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo noupdate="1">

<record id="label_account_type_asset_current_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_current</field>
<field name="term">Other Current Assets</field>
</record>

<record id="label_account_type_asset_current_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_current</field>
<field name="term">Autres actifs courants</field>
</record>

<record id="label_account_type_asset_fixed_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_fixed</field>
<field name="term">Immobilisations</field>
</record>

<record id="label_account_type_asset_fixed_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_fixed</field>
<field name="term">Immobilisations</field>
</record>

<record id="label_account_type_asset_non_current_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_non_current</field>
<field name="term">Other Non-current Assets</field>
</record>

<record id="label_account_type_asset_non_current_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">asset_non_current</field>
<field name="term">Autres actifs non courants</field>
</record>

<record id="label_account_type_liability_current_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">liability_current</field>
<field name="term">Other Current Liabilities</field>
</record>

<record id="label_account_type_liability_current_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">liability_current</field>
<field name="term">Autres passifs courants</field>
</record>

<record id="label_account_type_income_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">income</field>
<field name="term">Revenues</field>
</record>

<record id="label_account_type_income_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">income</field>
<field name="term">Revenus</field>
</record>

<record id="label_account_type_income_other_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">income_other</field>
<field name="term">One-time Revenues</field>
</record>

<record id="label_account_type_income_other_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">income_other</field>
<field name="term">Revenus ponctuels</field>
</record>

<record id="label_account_type_expense_direct_cost_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">expense_direct_cost</field>
<field name="term">Direct Costs</field>
</record>

<record id="label_account_type_expense_direct_cost_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">expense_direct_cost</field>
<field name="term">Coûts directs</field>
</record>

<record id="label_account_type_expense_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">expense</field>
<field name="term">Indirect Costs</field>
</record>

<record id="label_account_type_expense_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids"
eval="[(4, ref('account.model_account_account')), (4, ref('account.model_account_account_template'))]" />
<field name="type_">field</field>
<field name="position">selection</field>
<field name="reference">account_type</field>
<field name="key">expense</field>
<field name="term">Coûts indirects</field>
</record>
</odoo>
104 changes: 6 additions & 98 deletions canada_account_types/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,112 +16,20 @@ msgstr ""
"Plural-Forms: \n"



#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__liability_non_current
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__liability_non_current
msgid "Non-current Liabilities"
msgstr "Passifs non courants"

#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__asset_prepayments
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__asset_prepayments
msgid "Prepayments"
msgstr "Accomptes"

#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__equity
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__equity
msgid "Equity"
msgstr "Fonds propres"

#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__off_balance
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__off_balance
msgid "Off-Balance Sheet"
msgstr "Hors bilan"


#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__equity_unaffected
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__equity_unaffected
msgid "Current Year Earnings"
msgstr "Bénéfices de l'année en cours"

#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__liability_payable
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__liability_payable
msgid "Payable"
msgstr "Dette fournisseur"

#. module: account
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__liability_credit_card
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__liability_credit_card
msgid "Credit Card"
msgstr "Carte de crédit"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__interest_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__interest_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__expense_interest
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__expense_interest
msgid "Interest Expenses"
msgstr "Charges d'intérêts"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__one_time_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__one_time_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__expense_one_time_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__expense_one_time_expenses
msgid "One-time Expenses"
msgstr "Charges ponctuelles"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__tax_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__tax_expenses
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account__account_type__expense_tax
#: model:ir.model.fields.selection,name:canada_account_types.selection__account_account_template__account_type__expense_tax
msgid "Tax Expenses"
msgstr "Charges d'impôts"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__asset_current
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__asset_current
msgid "Other Current Assets"
msgstr "Autres actifs courants"


#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__asset_non_current
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__asset_non_current
msgid "Other Non-current Assets"
msgstr "Autres actifs non courants"


#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__liability_current
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__liability_current
msgid "Other Current Liabilities"
msgstr "Autres passifs courants"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__income
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__income
msgid "Revenues"
msgstr "Revenus"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__income_other
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__income_other
msgid "One-time Revenues"
msgstr "Revenus ponctuels"

#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__expense_direct_cost
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__expense_direct_cost
msgid "Direct Costs"
msgstr "Coûts directs"


#. module: canada_account_types
#: model:ir.model.fields.selection,name:account.selection__account_account__account_type__expense
#: model:ir.model.fields.selection,name:account.selection__account_account_template__account_type__expense
msgid "Indirect Costs"
msgstr "Coûts indirects"



36 changes: 10 additions & 26 deletions canada_account_types/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@ class Account(models.Model):

account_type = fields.Selection(
selection_add=[
('interest_expenses', 'Interest Expenses'),
('one_time_expenses', 'One-time Expenses'),
('tax_expenses', 'Tax Expenses'),
('asset_current', 'Other Current Assets'),
('asset_fixed', 'Immobilisations'),
('asset_non_current', 'Other Non-current Assets'),
('liability_current', 'Other Current Liabilities'),
('income', 'Revenues'),
('income_other', 'One-time Revenues'),
('expense_direct_cost', 'Direct Costs'),
('expense', 'Indirect Costs'),
("expense_interest", "Interest Expenses"),
("expense_one_time_expenses", "One-time Expenses"),
("expense_tax", "Tax Expenses"),
],
ondelete={
'interest_expenses': lambda rec: rec._compute_account_type(),
'one_time_expenses': lambda rec: rec._compute_account_type(),
'tax_expenses': lambda rec: rec._compute_account_type(),
}
"expense_interest": lambda rec: rec._compute_account_type(),
"expense_one_time_expenses": lambda rec: rec._compute_account_type(),
"expense_tax": lambda rec: rec._compute_account_type(),
},
)


Expand All @@ -36,16 +28,8 @@ class AccountTemplate(models.Model):

account_type = fields.Selection(
selection_add=[
('interest_expenses', 'Interest Expenses'),
('one_time_expenses', 'One-time Expenses'),
('tax_expenses', 'Tax Expenses'),
('asset_current', 'Other Current Assets'),
('asset_fixed', 'Immobilisations'),
('asset_non_current', 'Other Non-current Assets'),
('liability_current', 'Other Current Liabilities'),
('income', 'Revenues'),
('income_other', 'One-time Revenues'),
('expense_direct_cost', 'Direct Costs'),
('expense', 'Indirect Costs'),
("expense_interest", "Interest Expenses"),
("expense_one_time_expenses", "One-time Expenses"),
("expense_tax", "Tax Expenses"),
],
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified canada_account_types/static/description/account_types_french.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions canada_account_types/views/account_account_views.xml

This file was deleted.

0 comments on commit 3add2ef

Please sign in to comment.