[FIX] l10n_vn: Account type

242: These future expenses must be deferred on the company’s balance
sheet until the moment in time they can be recognized, at once or over a
defined period, on the Profit and Loss statement.
6274, 6414, 6424: Fixed asset depreciation not expense

closes odoo/odoo#146802

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
This commit is contained in:
Trinh Ngoc Hung
2024-01-03 09:17:49 +00:00
parent 1479104495
commit db2c22f0d4
3 changed files with 32 additions and 5 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
'name': 'Vietnam - Accounting',
'icon': '/account/static/description/l10n.png',
'countries': ['vn'],
'version': '2.0.1',
'version': '2.0.2',
'author': 'General Solutions',
'website': 'https://www.odoo.com/documentation/17.0/applications/finance/fiscal_localizations/vietnam.html',
'category': 'Accounting/Localizations/Account Charts',
@@ -71,7 +71,7 @@
"chart2411","Fixed assets prior to commissioning","2411","asset_non_current","False","Mua sắm TSCĐ"
"chart2412","Construction works","2412","asset_non_current","False","Xây dựng cơ bản"
"chart2413","Major repairs of fixed assets","2413","asset_non_current","False","Sửa chữa lớn TSCĐ"
"chart242","Prepaid expenses","242","asset_non_current","False","Chi phí trả trước"
"chart242","Prepaid expenses","242","asset_prepayments","False","Chi phí trả trước"
"chart243","Deferred tax assets","243","asset_non_current","False","Tài sản thuế thu nhập hoãn lại"
"chart244","Mortgage, collaterals and deposits","244","asset_non_current","False","Cầm cố, thế chấp, ký quỹ, kýcược"
"chart331","Trade payables","331","liability_payable","True","Phải trả cho người bán"
@@ -162,7 +162,7 @@
"chart6271","Factory staff costs","6271","expense","False","Chi phí nhân viên phân xưởng"
"chart6272","Material costs","6272","expense","False","Chi phí nguyên, vật liệu"
"chart6273","Production tools and instruments","6273","expense","False","Chi phí dụng cụ sản xuất"
"chart6274","Fixed asset depreciation","6274","expense","False","Chi phí khấu hao TSCĐ"
"chart6274","Fixed asset depreciation","6274","expense_depreciation","False","Chi phí khấu hao TSCĐ"
"chart6277","Outside services","6277","expense","False","Chi phí dịch vụ mua ngoài"
"chart6278","Other expenses","6278","expense","False","Chi phí bằng tiền khác"
"chart631","Production costs","631","expense_direct_cost","False","Giá thành sản xuất"
@@ -171,14 +171,14 @@
"chart6411","Staff expenses","6411","expense","False","Chi phí nhân viên"
"chart6412","Materials and packing materials","6412","expense","False","Chi phí nguyên vật liệu, bao bì"
"chart6413","Tools and instruments","6413","expense","False","Chi phí dụng cụ, đồ dùng"
"chart6414","Fixed asset deprecation","6414","expense","False","Chi phí khấu hao TSCĐ"
"chart6414","Fixed asset deprecation","6414","expense_depreciation","False","Chi phí khấu hao TSCĐ"
"chart6415","Warranty expenses","6415","expense","False","Chi phí bảo hành"
"chart6417","Outside services","6417","expense","False","Chi phí dịch vụ mua ngoài"
"chart6418","Other expenses","6418","expense","False","Chi phí bằng tiền khác"
"chart6421","Staff expenses","6421","expense","False","Chi phí nhân viên"
"chart6422","Office supply expenses","6422","expense","False","Chi phí vật liệu quản lý"
"chart6423","Office equipment expenses","6423","expense","False","Chi phí đồ dùng văn phòng"
"chart6424","Fixed asset depreciation","6424","expense","False","Chi phí khấu hao TSCĐ"
"chart6424","Fixed asset depreciation","6424","expense_depreciation","False","Chi phí khấu hao TSCĐ"
"chart6425","Taxes, fees and charges","6425","expense","False","Thuế, phí và lệ phí"
"chart6426","Provision expenses","6426","expense","False","Chi phí dự phòng"
"chart6427","Outside services","6427","expense","False","Chi phí dịch vụ mua ngoài"
1 id name code account_type reconcile name@vi_VN
71 chart2411 Fixed assets prior to commissioning 2411 asset_non_current False Mua sắm TSCĐ
72 chart2412 Construction works 2412 asset_non_current False Xây dựng cơ bản
73 chart2413 Major repairs of fixed assets 2413 asset_non_current False Sửa chữa lớn TSCĐ
74 chart242 Prepaid expenses 242 asset_non_current asset_prepayments False Chi phí trả trước
75 chart243 Deferred tax assets 243 asset_non_current False Tài sản thuế thu nhập hoãn lại
76 chart244 Mortgage, collaterals and deposits 244 asset_non_current False Cầm cố, thế chấp, ký quỹ, kýcược
77 chart331 Trade payables 331 liability_payable True Phải trả cho người bán
162 chart6271 Factory staff costs 6271 expense False Chi phí nhân viên phân xưởng
163 chart6272 Material costs 6272 expense False Chi phí nguyên, vật liệu
164 chart6273 Production tools and instruments 6273 expense False Chi phí dụng cụ sản xuất
165 chart6274 Fixed asset depreciation 6274 expense expense_depreciation False Chi phí khấu hao TSCĐ
166 chart6277 Outside services 6277 expense False Chi phí dịch vụ mua ngoài
167 chart6278 Other expenses 6278 expense False Chi phí bằng tiền khác
168 chart631 Production costs 631 expense_direct_cost False Giá thành sản xuất
171 chart6411 Staff expenses 6411 expense False Chi phí nhân viên
172 chart6412 Materials and packing materials 6412 expense False Chi phí nguyên vật liệu, bao bì
173 chart6413 Tools and instruments 6413 expense False Chi phí dụng cụ, đồ dùng
174 chart6414 Fixed asset deprecation 6414 expense expense_depreciation False Chi phí khấu hao TSCĐ
175 chart6415 Warranty expenses 6415 expense False Chi phí bảo hành
176 chart6417 Outside services 6417 expense False Chi phí dịch vụ mua ngoài
177 chart6418 Other expenses 6418 expense False Chi phí bằng tiền khác
178 chart6421 Staff expenses 6421 expense False Chi phí nhân viên
179 chart6422 Office supply expenses 6422 expense False Chi phí vật liệu quản lý
180 chart6423 Office equipment expenses 6423 expense False Chi phí đồ dùng văn phòng
181 chart6424 Fixed asset depreciation 6424 expense expense_depreciation False Chi phí khấu hao TSCĐ
182 chart6425 Taxes, fees and charges 6425 expense False Thuế, phí và lệ phí
183 chart6426 Provision expenses 6426 expense False Chi phí dự phòng
184 chart6427 Outside services 6427 expense False Chi phí dịch vụ mua ngoài
@@ -0,0 +1,27 @@
from odoo import api, SUPERUSER_ID
from odoo.osv import expression
FIXED_ACCOUNTS_TYPE = {
'asset_prepayments': ['242'],
'expense_depreciation': ['6274', '6414', '6424'],
}
def _fix_accounts_type(env):
for correct_account_type, accounts_code in FIXED_ACCOUNTS_TYPE.items():
domains_per_company = []
for company in env['res.company'].with_context(active_test=False).search([('chart_template', '=', 'vn')]):
doamin = expression.AND([
[('company_id', '=', company.id), ('account_type', '!=', correct_account_type)],
expression.OR([
[('code', 'like', f'{code}%')] for code in accounts_code
])
])
domains_per_company.append(doamin)
accounts = env['account.account'].search(expression.OR(domains_per_company))
accounts.account_type = correct_account_type
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
_fix_accounts_type(env)