Skip to content

Commit

Permalink
[MIG] l10n_us_gaap: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Sep 17, 2024
1 parent 812ab16 commit 7e6d862
Show file tree
Hide file tree
Showing 11 changed files with 307 additions and 1,595 deletions.
1 change: 1 addition & 0 deletions l10n_us_gaap/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
8 changes: 3 additions & 5 deletions l10n_us_gaap/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "United States Sample GAAP Chart of Accounts",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"development_status": "Mature",
"category": "Localization",
"category": "Accounting/Localizations/Account Charts",
"countries": ["us"],
"author": "ForgeFlow, Odoo Community Association (OCA)",
"maintainers": ["JordiBForgeFlow"],
"website": "https://github.com/OCA/l10n-usa",
"depends": ["account"],
"data": [
"data/account_chart_template_data.xml",
"data/account_group.xml",
"data/account_us_gaap_data.xml",
"data/account_chart_template_data_load.xml",
"data/res_company_data.xml",
],
Expand Down
14 changes: 0 additions & 14 deletions l10n_us_gaap/data/account_chart_template_data.xml

This file was deleted.

7 changes: 6 additions & 1 deletion l10n_us_gaap/data/account_chart_template_data_load.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<function model="account.chart.template" name="try_loading">
<value eval="[ref('l10n_us_gaap.l10n_us_gaap_chart_template')]" />
<value eval="[]" />
<value>us_gaap</value>
<value
model="res.company"
search="[('partner_id.country_id.code', 'in', ['US', False])]"
/>
</function>
</odoo>
849 changes: 0 additions & 849 deletions l10n_us_gaap/data/account_group.xml

This file was deleted.

720 changes: 0 additions & 720 deletions l10n_us_gaap/data/account_us_gaap_data.xml

This file was deleted.

113 changes: 113 additions & 0 deletions l10n_us_gaap/data/template/account.account-us_gaap.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
id,name,code,account_type
l10n_us_gaap_account_2121,Stock Interim (Received),2121,asset_current
l10n_us_gaap_account_1331,Stock Interim (Delivered),1331,asset_current
l10n_us_gaap_account_112,Investments And Securities,112,asset_current
l10n_us_gaap_account_113,Derivative Instruments And Hedges,113,asset_current
l10n_us_gaap_account_114,"Capital Leases, Lessor",114,asset_current
l10n_us_gaap_account_115,Restricted Assets,115,asset_current
l10n_us_gaap_account_116,Intercompany Investments,116,asset_current
l10n_us_gaap_account_121,Accounts Receivable,121,asset_receivable
l10n_us_gaap_account_122,Notes And Loans Receivable,122,asset_receivable
l10n_us_gaap_account_123,Receivables With Imputed Interest,123,asset_receivable
l10n_us_gaap_account_124,Contracts Or Programs,124,asset_receivable
l10n_us_gaap_account_125,Other Receivables,125,asset_receivable
l10n_us_gaap_account_131,"Merchandise, Material And Supplies",131,asset_current
l10n_us_gaap_account_132,Work In Process,132,asset_current
l10n_us_gaap_account_133,Finished Goods,133,asset_current
l10n_us_gaap_account_134,Capitalized Contract Cost,134,asset_current
l10n_us_gaap_account_135,Other Inventory,135,asset_current
l10n_us_gaap_account_136,Inventory For Long-Term Contracts Or Programs,136,asset_current
l10n_us_gaap_account_137,Allowances And Adjustments,137,asset_current
l10n_us_gaap_account_141,Prepaid Expense,141,asset_current
l10n_us_gaap_account_142,Returnable Deposits,142,asset_current
l10n_us_gaap_account_143,Accrued Revenue,143,asset_current
l10n_us_gaap_account_144,Deferred Costs,144,asset_current
l10n_us_gaap_account_145,Other Accrued And Deferred Assets,145,asset_current
l10n_us_gaap_account_146,Investments And Other Assets,146,asset_current
l10n_us_gaap_account_151,"Land, Buildings And Improvements",151,asset_non_current
l10n_us_gaap_account_152,Machinery And Equipment,152,asset_non_current
l10n_us_gaap_account_153,"Other Property, Plant And Equipment",153,asset_non_current
l10n_us_gaap_account_154,Assets Under Construction,154,asset_non_current
l10n_us_gaap_account_161,Intangible Assets Excluding Goodwill,161,asset_non_current
l10n_us_gaap_account_162,Goodwill,162,asset_non_current
l10n_us_gaap_account_163,Acquisitions In Progress,163,asset_non_current
l10n_us_gaap_account_211,Accounts Payable,211,liability_payable
l10n_us_gaap_account_212,Accrued Liabilities,212,liability_current
l10n_us_gaap_account_213,Employee-Related Liabilities,213,liability_current
l10n_us_gaap_account_214,Taxes Payable,214,liability_current
l10n_us_gaap_account_215,Interest And Dividends Payable,215,liability_current
l10n_us_gaap_account_221,Debts,221,liability_current
l10n_us_gaap_account_222,Notes And Loans Payable,222,liability_current
l10n_us_gaap_account_223,Special Assessment Bond,223,liability_current
l10n_us_gaap_account_224,Long-Term Federal Home Loan Bank Advances,224,liability_current
l10n_us_gaap_account_225,Capital Lease Obligations,225,liability_current
l10n_us_gaap_account_23,Deferred Revenue And Credits,23,liability_current
l10n_us_gaap_account_241,Billings In Excess Of Cost,241,liability_current
l10n_us_gaap_account_251,Derivative Liability,251,liability_current
l10n_us_gaap_account_252,Hedging Liabilities,252,liability_current
l10n_us_gaap_account_253,Energy Marketing Contract Liabilities,253,liability_current
l10n_us_gaap_account_271,Related Party Accounts Payable,271,liability_payable
l10n_us_gaap_account_272,Related Party Notes Payable,272,liability_current
l10n_us_gaap_account_273,Due To Employees,273,liability_current
l10n_us_gaap_account_274,Due To Officers Or Stockholders,274,liability_current
l10n_us_gaap_account_275,Due To Affiliate,275,liability_current
l10n_us_gaap_account_276,Due To Other Related Parties,276,liability_current
l10n_us_gaap_account_28,Other Liabilities,28,liability_current
l10n_us_gaap_account_311,Common Stock,311,equity
l10n_us_gaap_account_312,Preferred Stock,312,equity
l10n_us_gaap_account_313,Additional Paid-In Capital,313,equity
l10n_us_gaap_account_314,Legal Equity (Statutory Capital),314,equity
l10n_us_gaap_account_321,Retained Earnings - Appropriated,321,equity
l10n_us_gaap_account_32201,Current Year Earnings,32201,equity_unaffected
l10n_us_gaap_account_32202,Retained Earnings - Unappropriated,32202,equity
l10n_us_gaap_account_323,Retained Earnings Deficit,323,equity
l10n_us_gaap_account_324,Retained Earnings - Suspense Account,324,equity
l10n_us_gaap_account_331,Foreign Currency Translation Gain (Loss),331,equity
l10n_us_gaap_account_332,Available For Sale Securities Gain (Loss),332,equity
l10n_us_gaap_account_333,Impairment Debt Securities,333,equity
l10n_us_gaap_account_334,Cash Flow Hedges Gain (Loss),334,equity
l10n_us_gaap_account_335,Defined Benefit Plan Income (Loss),335,equity
l10n_us_gaap_account_341,Unearned Sop Shares,341,equity
l10n_us_gaap_account_342,"Receivable From Officers, Directors For Issuance Of Capital Stock",342,equity
l10n_us_gaap_account_343,Receivable From Shareholders Or Affiliates For Issuance Of Capital Stock,343,equity
l10n_us_gaap_account_344,"Stockholders' Equity Note, Subscriptions Receivable",344,equity
l10n_us_gaap_account_345,"Warrants, Rights Outstanding",345,equity
l10n_us_gaap_account_346,Other Additional Capital,346,equity
l10n_us_gaap_account_347,Treasury Stock,347,equity
l10n_us_gaap_account_348,Additional Items,348,equity
l10n_us_gaap_account_35,Equity Attributable To Non-Controlling Interest,35,equity
l10n_us_gaap_account_41101,Product Sales,41101,income
l10n_us_gaap_account_41102,Merchandise Sales,41102,income
l10n_us_gaap_account_41201,"Returns, Allowances",41201,income
l10n_us_gaap_account_41202,Sales Discounts (Consideration Paid To Customers),41202,income
l10n_us_gaap_account_421,General Services,421,income
l10n_us_gaap_account_42201,Sales Allowances,42201,income
l10n_us_gaap_account_42202,Sales Discounts,42202,income
l10n_us_gaap_account_423,Itemized Services,423,income
l10n_us_gaap_account_431,Other Recurring Income,431,income
l10n_us_gaap_account_5112,Cost Of Services Rendered,51102,expense
l10n_us_gaap_account_51103,Other Costs Of Sales,51103,expense
l10n_us_gaap_account_51101,Cost Of Goods Sold,5111,expense
l10n_us_gaap_account_51201,Selling And Marketing,51201,expense
l10n_us_gaap_account_51202,"General, Administrative Expenses",51202,expense
l10n_us_gaap_account_51203,Other Operating Expenses,51203,expense
l10n_us_gaap_account_51204,Price Differences,51204,expense
l10n_us_gaap_account_51205,Inventory Adjustments,51205,expense
l10n_us_gaap_account_513,Doubtful Accounts,513,expense
l10n_us_gaap_account_6110,Unusual And/Or Infrequent Items,6110,expense
l10n_us_gaap_account_61101,Foreign Currency Gain,61101,income_other
l10n_us_gaap_account_61102,Foreign Currency Loss,61102,expense
l10n_us_gaap_account_6111,Additional Itemized Gains And Losses,6111,income_other
l10n_us_gaap_account_61201,Other Non-Operating Income,61201,income_other
l10n_us_gaap_account_61202,Other Non-Operating Loss,61202,expense
l10n_us_gaap_account_613,Restructuring Charge,613,expense
l10n_us_gaap_account_614,Inventory Write-Downs (Not Recognized In Cost Of Sales),614,expense
l10n_us_gaap_account_615,Impairment Charge,615,expense
l10n_us_gaap_account_616,Extinguishment Of Debt,616,expense
l10n_us_gaap_account_617,"Business Combination, Acquisition Related Costs",617,expense
l10n_us_gaap_account_618,Gain (Loss) Related To Litigation Settlement,618,expense
l10n_us_gaap_account_619,Asset Retirement Obligation,619,expense
l10n_us_gaap_account_621,Non-Operating Revenues,621,income_other
l10n_us_gaap_account_622,Non-Operating Expenses,622,expense
l10n_us_gaap_account_63,Non-Monetary Transactions,63,expense
l10n_us_gaap_account_7,Income Tax (Benefit),7,income
141 changes: 141 additions & 0 deletions l10n_us_gaap/data/template/account.tax.group-us_gaap.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
id,name,code_prefix_start
l10n_us_gaap_account_group_1,Assets,1
l10n_us_gaap_account_group_1_1,Cash And Investments,11
l10n_us_gaap_account_group_1_1_1,Cash And Cash Equivalents,111
l10n_us_gaap_account_group_1_1_2,Investments and Securities,112
l10n_us_gaap_account_group_1_1_3,Derivative Instruments And Hedges,113
l10n_us_gaap_account_group_1_1_4,"Capital Leases, Lessor",114
l10n_us_gaap_account_group_1_1_5,Restricted Assets,115
l10n_us_gaap_account_group_1_1_6,Intercompany Investments,116
l10n_us_gaap_account_group_1_2,Receivables,12
l10n_us_gaap_account_group_1_2_1,"Accounts, Notes And Loans",121
l10n_us_gaap_account_group_1_2_2,Notes And Loans Receivable,122
l10n_us_gaap_account_group_1_2_3,Receivables With Imputed Interest,123
l10n_us_gaap_account_group_1_2_4,Contracts Or Programs,124
l10n_us_gaap_account_group_1_2_5,Other Receivables,125
l10n_us_gaap_account_group_1_3,Inventory,13
l10n_us_gaap_account_group_1_3_1,"Merchandise, Material And Supplies",131
l10n_us_gaap_account_group_1_3_2,Work In Process,132
l10n_us_gaap_account_group_1_3_3,Finished Goods,133
l10n_us_gaap_account_group_1_3_4,Capitalized Contract Cost,134
l10n_us_gaap_account_group_1_3_5,Other Inventory,135
l10n_us_gaap_account_group_1_3_6,Inventory For Long-Term Contracts Or Programs,136
l10n_us_gaap_account_group_1_3_7,Allowances And Adjustments,137
l10n_us_gaap_account_group_1_4,"Accrued, Deferred And Other Assets",14
l10n_us_gaap_account_group_1_4_1,Prepaid Expense,141
l10n_us_gaap_account_group_1_4_2,Returnable Deposits,142
l10n_us_gaap_account_group_1_4_3,Accrued Revenue,143
l10n_us_gaap_account_group_1_4_4,Deferred Costs,144
l10n_us_gaap_account_group_1_4_5,Other Accrued And Deferred Assets,145
l10n_us_gaap_account_group_1_4_6,Investments And Other Assets,146
l10n_us_gaap_account_group_1_5,"Property, Plant And Equipment",15
l10n_us_gaap_account_group_1_5_1,"Land, Buildings And Improvements",151
l10n_us_gaap_account_group_1_5_2,Machinery And Equipment,152
l10n_us_gaap_account_group_1_5_3,"Other Property, Plant And Equipment",153
l10n_us_gaap_account_group_1_5_4,Assets Under Construction,154
l10n_us_gaap_account_group_1_6,Intangible Assets,16
l10n_us_gaap_account_group_1_6_1,Intangible Assets Excluding Goodwill,161
l10n_us_gaap_account_group_1_6_2,Goodwill,162
l10n_us_gaap_account_group_1_6_3,Acquisitions In Progress,163
l10n_us_gaap_account_group_2,Liabilities,2
l10n_us_gaap_account_group_2_1,Accounts Payable And Accrued Liabilities,21
l10n_us_gaap_account_group_2_1_1,Accounts Payable,211
l10n_us_gaap_account_group_2_1_2,Accrued Liabilities,212
l10n_us_gaap_account_group_2_1_3,Employee-Related Liabilities,213
l10n_us_gaap_account_group_2_1_4,Taxes Payable,214
l10n_us_gaap_account_group_2_1_5,Interest And Dividends Payable,215
l10n_us_gaap_account_group_2_2,Debt And Capital Lease Obligations,22
l10n_us_gaap_account_group_2_2_1,Debts,221
l10n_us_gaap_account_group_2_2_2,Notes And Loans Payable,22.2
l10n_us_gaap_account_group_2_2_3,Special Assessment Bond,223
l10n_us_gaap_account_group_2_2_4,Long-Term Federal Home Loan Bank Advances,224
l10n_us_gaap_account_group_2_2_5,Capital Lease Obligations,225
l10n_us_gaap_account_group_2_3,Deferred Revenue And Credits,23
l10n_us_gaap_account_group_2_4,Contracts Or Programs,24
l10n_us_gaap_account_group_2_4_1,Billings In Excess Of Cost,241
l10n_us_gaap_account_group_2_5,Derivative Instruments And Hedges,25
l10n_us_gaap_account_group_2_5_1,Derivative Liability,251
l10n_us_gaap_account_group_2_5_2,Hedging Liabilities,252
l10n_us_gaap_account_group_2_5_3,Energy Marketing Contract Liabilities,253
l10n_us_gaap_account_group_2_6,Liabilities Other Than Debt,26
l10n_us_gaap_account_group_2_7,Related Party Liabilities,27
l10n_us_gaap_account_group_2_7_1,Related Party Accounts Payable,271
l10n_us_gaap_account_group_2_7_2,Related Party Notes Payable,272
l10n_us_gaap_account_group_2_7_3,Due To Employees,273
l10n_us_gaap_account_group_2_7_4,Due To Officers Or Stockholders,274
l10n_us_gaap_account_group_2_7_5,Due To Affiliate,275
l10n_us_gaap_account_group_2_7_6,Due To Other Related Parties,276
l10n_us_gaap_account_group_2_8,Other Liabilities,28
l10n_us_gaap_account_group_3,Equity,3
l10n_us_gaap_account_group_3_1,Paid-In Capital,31
l10n_us_gaap_account_group_3_1_1,Common Stock,311
l10n_us_gaap_account_group_3_1_2,Preferred Stock,312
l10n_us_gaap_account_group_3_1_3,Additional Paid-In Capital,313
l10n_us_gaap_account_group_3_1_4,Legal Equity (Statutory Capital),314
l10n_us_gaap_account_group_3_2,Retained Earnings,32
l10n_us_gaap_account_group_3_2_1,Appropriated,321
l10n_us_gaap_account_group_3_2_2,Unappropriated,322
l10n_us_gaap_account_group_3_2_3,Retained Earnings Deficit,323
l10n_us_gaap_account_group_3_2_4,Suspense Account,324
l10n_us_gaap_account_group_3_3,Accumulated Other Comprehensive Income,33
l10n_us_gaap_account_group_3_3_1,Foreign Currency Translation Gain (Loss),331
l10n_us_gaap_account_group_3_3_2,Available For Sale Securities Gain (Loss),332
l10n_us_gaap_account_group_3_3_3,Impairment Debt Securities,33.3
l10n_us_gaap_account_group_3_3_4,Cash Flow Hedges Gain (Loss),334
l10n_us_gaap_account_group_3_3_5,Defined Benefit Plan Income (Loss),335
l10n_us_gaap_account_group_3_4,Other Equity,34
l10n_us_gaap_account_group_3_4_1,Unearned Sop Shares,341
l10n_us_gaap_account_group_3_4_2,"Receivable From Officers, Directors For Issuance Of Capital Stock",342
l10n_us_gaap_account_group_3_4_3,Receivable From Shareholders Or Affiliates For Issuance Of Capital Stock,343
l10n_us_gaap_account_group_3_4_4,"Stockholders' Equity Note, Subscriptions Receivable",344
l10n_us_gaap_account_group_3_4_5,"Warrants, Rights Outstanding",345
l10n_us_gaap_account_group_3_4_6,Other Additional Capital,346
l10n_us_gaap_account_group_3_4_7,Treasury Stock,347
l10n_us_gaap_account_group_3_4_8,Additional Items,348
l10n_us_gaap_account_group_3_5,Equity Attributable To Non-Controlling Interest,35
l10n_us_gaap_account_group_4,Revenue,4
l10n_us_gaap_account_group_4_1,Goods,41
l10n_us_gaap_account_group_4_1_1,Products And Merchandise,411
l10n_us_gaap_account_group_4_1_1_1,Products,4111
l10n_us_gaap_account_group_4_1_1_2,Merchandise,4112
l10n_us_gaap_account_group_4_1_2,"Allowances, Discounts",412
l10n_us_gaap_account_group_4_1_2_1,"Returns, Allowances",4121
l10n_us_gaap_account_group_4_1_2_2,Sales Discounts (Consideration Paid To Customers),4122
l10n_us_gaap_account_group_4_2,Services,42
l10n_us_gaap_account_group_4_2_1,General Services,421
l10n_us_gaap_account_group_4_2_2,"Allowances, Discounts",422
l10n_us_gaap_account_group_4_2_2_1,Sales Allowances,4221
l10n_us_gaap_account_group_4_2_2_2,Sales Discounts,422.2
l10n_us_gaap_account_group_4_2_3,Itemized Services,423
l10n_us_gaap_account_group_4_2_3_1,Other Sales Revenues,4231
l10n_us_gaap_account_group_4_3,Other Operating Income,43
l10n_us_gaap_account_group_4_3_1,Other Recurring Income,431
l10n_us_gaap_account_group_5,Expenses,5
l10n_us_gaap_account_group_5_1,Expenses Classified By Function,51
l10n_us_gaap_account_group_5_1_1,Cost Of Revenue,511
l10n_us_gaap_account_group_5_1_1_1,Cost Of Goods Sold,5111
l10n_us_gaap_account_group_5_1_1_2,Cost Of Services Rendered,5112
l10n_us_gaap_account_group_5_1_1_3,Other Costs Of Sales,5113
l10n_us_gaap_account_group_5_1_2,"Selling, General, Administrative",512
l10n_us_gaap_account_group_5_1_2_1,Selling And Marketing,5121
l10n_us_gaap_account_group_5_1_2_2,"General, Administrative Expenses",5122
l10n_us_gaap_account_group_5_1_2_3,Other Operating Expenses,5123
l10n_us_gaap_account_group_5_1_3,Doubtful Accounts,513
l10n_us_gaap_account_group_6,"Other Revenue, Expenses, Gains And Losses",6
l10n_us_gaap_account_group_6_1,Gains And Losses,61
l10n_us_gaap_account_group_6_1_1,Foreign Currency,611
l10n_us_gaap_account_group_6_1_10,Unusual And/Or Infrequent Items,6110
l10n_us_gaap_account_group_6_1_11,Additional Itemized Gains And Losses,6111
l10n_us_gaap_account_group_6_1_2,Other Non-Operating Income Or Loss,612
l10n_us_gaap_account_group_6_1_3,Restructuring Charge,613
l10n_us_gaap_account_group_6_1_4,Inventory Write-Downs (Not Recognized In Cost Of Sales),614
l10n_us_gaap_account_group_6_1_5,Impairment Charge,615
l10n_us_gaap_account_group_6_1_6,Extinguishment Of Debt,616
l10n_us_gaap_account_group_6_1_7,"Business Combination, Acquisition Related Costs",617
l10n_us_gaap_account_group_6_1_8,Gain (Loss) Related To Litigation Settlement,618
l10n_us_gaap_account_group_6_1_9,Asset Retirement Obligation,619
l10n_us_gaap_account_group_6_2,"Non-Operating Revenues, Expenses",62
l10n_us_gaap_account_group_6_2_1,Non-Operating Revenues,621
l10n_us_gaap_account_group_6_2_2,Non-Operating Expenses,622
l10n_us_gaap_account_group_6_3,Non-Monetary Transactions,63
l10n_us_gaap_account_group_7,Income Tax (Benefit),7
1 change: 1 addition & 0 deletions l10n_us_gaap/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import template_us_gaap
37 changes: 37 additions & 0 deletions l10n_us_gaap/models/template_us_gaap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ruff: noqa: E501
from odoo import models

from odoo.addons.account.models.chart_template import template


class AccountChartTemplate(models.AbstractModel):
_inherit = "account.chart.template"

@template("us_gaap")
def _get_us_gaap_template_data(self):
return {
"name": "US GAAP Chart of Accounts",
"country": "base.us",
"code_digits": "6",
}

@template("us_gaap", "res.company")
def _get_us_gaap_res_company(self):
return {
self.env.company.id: {
"anglo_saxon_accounting": True,
"account_fiscal_country_id": "base.us",
"bank_account_code_prefix": "1111",
"cash_account_code_prefix": "1112",
"transfer_account_code_prefix": "1117",
"currency_id": "base.USD",
"property_account_receivable_id": "l10n_us_gaap_account_121",
"property_account_payable_id": "l10n_us_gaap_account_211",
"property_account_expense_categ_id": "l10n_us_gaap_account_51202",
"property_account_income_categ_id": "l10n_us_gaap_account_421",
"expense_currency_exchange_account_id": "l10n_us_gaap_account_61102",
"income_currency_exchange_account_id": "l10n_us_gaap_account_61101",
"account_journal_early_pay_discount_loss_account_id": "l10n_us_gaap_account_41202",
"account_journal_early_pay_discount_gain_account_id": "l10n_us_gaap_account_42202",
}
}
Loading

0 comments on commit 7e6d862

Please sign in to comment.