mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-26 16:42:06 +02:00
19.0 vanilla
This commit is contained in:
parent
7dc55599c6
commit
7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import template_cn_common
|
||||
from . import template_cn
|
||||
from . import template_cn_large_bis
|
||||
from . import account_move
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.osv import expression
|
||||
from odoo.fields import Domain
|
||||
|
||||
try:
|
||||
from cn2an import an2cn
|
||||
except ImportError:
|
||||
an2cn = None
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
|
|
@ -40,4 +40,4 @@ class AccountMove(models.Model):
|
|||
domains.append([('res_model', '=', 'account.bank.statement'), ('res_id', 'in', statement_ids.ids)])
|
||||
if payment_ids:
|
||||
domains.append([('res_model', '=', 'account.payment'), ('res_id', 'in', payment_ids.ids)])
|
||||
return self.env['ir.attachment'].search_count(expression.OR(domains))
|
||||
return self.env['ir.attachment'].search_count(Domain.OR(domains))
|
||||
|
|
|
|||
50
odoo-bringout-oca-ocb-l10n_cn/l10n_cn/models/template_cn.py
Normal file
50
odoo-bringout-oca-ocb-l10n_cn/l10n_cn/models/template_cn.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import _, models
|
||||
from odoo.addons.account.models.chart_template import template
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@template('cn')
|
||||
def _get_cn_template_data(self):
|
||||
return {
|
||||
'name': _('Accounting Standards for Small Business Enterprises'),
|
||||
'parent': 'cn_common',
|
||||
'property_account_expense_categ_id': 'l10n_cn_account_5401',
|
||||
'property_account_income_categ_id': 'l10n_cn_account_5001',
|
||||
}
|
||||
|
||||
@template('cn', 'res.company')
|
||||
def _get_cn_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'account_fiscal_country_id': 'base.cn',
|
||||
'transfer_account_code_prefix': '1012',
|
||||
'income_currency_exchange_account_id': 'l10n_cn_account_530102',
|
||||
'expense_currency_exchange_account_id': 'l10n_cn_account_560302',
|
||||
'account_journal_suspense_account_id': 'l10n_cn_account_101201',
|
||||
'transfer_account_id': 'l10n_cn_account_101202',
|
||||
'account_production_wip_account_id': 'l10n_cn_account_1406',
|
||||
'default_cash_difference_income_account_id': 'l10n_cn_account_530103',
|
||||
'default_cash_difference_expense_account_id': 'l10n_cn_account_560303',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'l10n_cn_account_530104',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'l10n_cn_account_560304',
|
||||
'account_production_wip_overhead_account_id': 'l10n_cn_account_140601',
|
||||
'account_sale_tax_id': 'l10n_cn_sales_excluded_13',
|
||||
'account_purchase_tax_id': 'l10n_cn_purchase_excluded_13',
|
||||
'expense_account_id': 'l10n_cn_account_5401',
|
||||
'income_account_id': 'l10n_cn_account_5001',
|
||||
'tax_calculation_rounding_method': 'round_per_line',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'l10n_cn_common_account_1403',
|
||||
},
|
||||
}
|
||||
|
||||
@template('cn', 'account.account')
|
||||
def _get_cn_account_account(self):
|
||||
return {
|
||||
'l10n_cn_common_account_1403': {
|
||||
'account_stock_variation_id': 'l10n_cn_account_5601',
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, _
|
||||
from odoo.addons.account.models.chart_template import template
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@template('cn_common')
|
||||
def _get_cn_common_template_data(self):
|
||||
return {
|
||||
'name': _('Common'),
|
||||
'visible': 0,
|
||||
'code_digits': 6,
|
||||
'use_storno_accounting': True,
|
||||
'property_account_receivable_id': 'l10n_cn_common_account_1122',
|
||||
'property_account_payable_id': 'l10n_cn_common_account_2202',
|
||||
'property_stock_valuation_account_id': 'l10n_cn_common_account_1405',
|
||||
'property_stock_account_production_cost_id': 'l10n_cn_common_account_1411',
|
||||
}
|
||||
|
||||
@template('cn_common', 'res.company')
|
||||
def _get_cn_common_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'account_fiscal_country_id': 'base.cn',
|
||||
'bank_account_code_prefix': '1002',
|
||||
'cash_account_code_prefix': '1001',
|
||||
'deferred_expense_account_id': 'l10n_cn_common_account_1801',
|
||||
'deferred_revenue_account_id': 'l10n_cn_common_account_2401',
|
||||
'account_default_pos_receivable_account_id': 'l10n_cn_common_account_112201',
|
||||
},
|
||||
}
|
||||
|
||||
@template('cn_common', 'account.journal')
|
||||
def _get_cn_account_journal(self):
|
||||
return {
|
||||
'cash': {
|
||||
'name': _("Cash"),
|
||||
'type': 'cash',
|
||||
'default_account_id': 'l10n_cn_common_account_1001',
|
||||
},
|
||||
'bank': {'default_account_id': 'l10n_cn_common_account_1002'},
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, _
|
||||
from odoo.addons.account.models.chart_template import template
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@template('cn_large_bis')
|
||||
def _get_cn_large_bis_template_data(self):
|
||||
return {
|
||||
'name': _('Accounting Standards for Business Enterprises'),
|
||||
'parent': 'cn_common',
|
||||
'property_account_expense_categ_id': 'l10n_cn_large_bis_account_6401',
|
||||
'property_account_income_categ_id': 'l10n_cn_large_bis_account_6001',
|
||||
}
|
||||
|
||||
@template('cn_large_bis', 'res.company')
|
||||
def _get_cn_large_bis_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'account_fiscal_country_id': 'base.cn',
|
||||
'transfer_account_code_prefix': '1004',
|
||||
'income_currency_exchange_account_id': 'l10n_cn_large_bis_account_6061',
|
||||
'expense_currency_exchange_account_id': 'l10n_cn_large_bis_account_6061',
|
||||
'account_journal_suspense_account_id': 'l10n_cn_large_bis_account_100201',
|
||||
'transfer_account_id': 'l10n_cn_large_bis_account_1004',
|
||||
'account_production_wip_account_id': 'l10n_cn_large_bis_account_140501',
|
||||
'default_cash_difference_income_account_id': 'l10n_cn_large_bis_account_630101',
|
||||
'default_cash_difference_expense_account_id': 'l10n_cn_large_bis_account_671101',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'l10n_cn_large_bis_account_630102',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'l10n_cn_large_bis_account_671102',
|
||||
'account_production_wip_overhead_account_id': 'l10n_cn_large_bis_account_140502',
|
||||
'account_sale_tax_id': 'l10n_cn_tax_large_bis_sales_excluded_13',
|
||||
'account_purchase_tax_id': 'l10n_cn_purchase_excluded_13',
|
||||
'expense_account_id': 'l10n_cn_large_bis_account_6401',
|
||||
'income_account_id': 'l10n_cn_large_bis_account_6001',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'l10n_cn_common_account_1403',
|
||||
},
|
||||
}
|
||||
|
||||
@template('cn_large_bis', 'account.account')
|
||||
def _get_cn_large_bis_account_account(self):
|
||||
return {
|
||||
'l10n_cn_common_account_1403': {
|
||||
'account_stock_variation_id': 'l10n_cn_large_bis_account_6601',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue