mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #IAOWCZ 【l10n_cn_standard_latest】预收预付处理 置顶
This commit is contained in:
@@ -314,6 +314,7 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
self = self.with_company(self.env.company)
|
self = self.with_company(self.env.company)
|
||||||
to_removes = [
|
to_removes = [
|
||||||
# 清除财务科目,用于重设
|
# 清除财务科目,用于重设
|
||||||
|
'account.reconcile.model',
|
||||||
'res.partner.bank',
|
'res.partner.bank',
|
||||||
# 'account.invoice',
|
# 'account.invoice',
|
||||||
'account.payment',
|
'account.payment',
|
||||||
@@ -348,48 +349,61 @@ class ResConfigSettings(models.TransientModel):
|
|||||||
# partner 处理
|
# partner 处理
|
||||||
try:
|
try:
|
||||||
rec = self.env['res.partner'].search([])
|
rec = self.env['res.partner'].search([])
|
||||||
for r in rec:
|
rec.write({
|
||||||
r.write({
|
'property_account_receivable_id': None,
|
||||||
'property_account_receivable_id': None,
|
'property_account_payable_id': None,
|
||||||
'property_account_payable_id': None,
|
})
|
||||||
})
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_logger.error('remove data error: %s,%s', 'account_chart', e)
|
_logger.error('remove data error: %s,%s', 'account_chart', e)
|
||||||
# 品类处理
|
# 品类处理
|
||||||
try:
|
try:
|
||||||
rec = self.env['product.category'].search([])
|
rec = self.env['product.category'].search([])
|
||||||
for r in rec:
|
rec.write({
|
||||||
r.write({
|
'property_account_income_categ_id': None,
|
||||||
'property_account_income_categ_id': None,
|
'property_account_expense_categ_id': None,
|
||||||
'property_account_expense_categ_id': None,
|
'property_account_creditor_price_difference_categ': None,
|
||||||
'property_account_creditor_price_difference_categ': None,
|
'property_stock_account_input_categ_id': None,
|
||||||
'property_stock_account_input_categ_id': None,
|
'property_stock_account_output_categ_id': None,
|
||||||
'property_stock_account_output_categ_id': None,
|
'property_stock_valuation_account_id': None,
|
||||||
'property_stock_valuation_account_id': None,
|
'property_stock_journal': None,
|
||||||
})
|
})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
# 产品处理
|
# 产品处理
|
||||||
try:
|
try:
|
||||||
rec = self.env['product.template'].search([])
|
rec = self.env['product.template'].search([])
|
||||||
for r in rec:
|
rec.write({
|
||||||
r.write({
|
'property_account_income_id': None,
|
||||||
'property_account_income_id': None,
|
'property_account_expense_id': None,
|
||||||
'property_account_expense_id': None,
|
'property_account_creditor_price_difference': None,
|
||||||
})
|
})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
# 库存计价处理
|
# 日记账处理
|
||||||
try:
|
try:
|
||||||
rec = self.env['stock.location'].search([])
|
#todo: 当前有些日记账的默认值要在 ir.property 处理 _set_default,比较麻烦,先修改下该日记账 code,创建新日记账后删除旧的即可
|
||||||
for r in rec:
|
rec = self.env['account.journal'].search([])
|
||||||
r.write({
|
rec.write({
|
||||||
'valuation_in_account_id': None,
|
'account_control_ids': None,
|
||||||
'valuation_out_account_id': None,
|
'bank_account_id': None,
|
||||||
})
|
'default_account_id': None,
|
||||||
|
'loss_account_id': None,
|
||||||
|
'profit_account_id': None,
|
||||||
|
'suspense_account_id': None,
|
||||||
|
})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass # raise Warning(e)
|
pass # raise Warning(e)
|
||||||
|
|
||||||
|
# 库存计价处理
|
||||||
|
try:
|
||||||
|
rec = self.env['stock.location'].search([])
|
||||||
|
rec.write({
|
||||||
|
'valuation_in_account_id': None,
|
||||||
|
'valuation_out_account_id': None,
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
pass # raise Warning(e)
|
||||||
|
self._cr.commit()
|
||||||
seqs = []
|
seqs = []
|
||||||
self.env.company.write({
|
self.env.company.write({
|
||||||
'chart_template_id': False,
|
'chart_template_id': False,
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
id,code,name,parent_id/id,reconcile,account_type,tag_ids/id,chart_template_id/id
|
id,code,name,parent_id/id,reconcile,account_type,tag_ids/id,chart_template_id/id
|
||||||
account_1001,1001,库存现金,,TRUE,asset_cash,,l10n_chart_china_standard_business_latest
|
account_1001,1001,库存现金,,TRUE,asset_cash,,l10n_chart_china_standard_business_latest
|
||||||
account_1002,1002,银行存款,,TRUE,asset_cash,tag21,l10n_chart_china_standard_business_latest
|
account_1002,1002,银行存款,,TRUE,asset_cash,tag21,l10n_chart_china_standard_business_latest
|
||||||
account_1002_08,1002.08,银行存款-未付款,,TRUE,asset_cash,tag21,l10n_chart_china_standard_business_latest
|
account_1002_01,1002.01,银行存款-人民币,account_1002,TRUE,asset_cash,,l10n_chart_china_standard_business_latest
|
||||||
account_1002_09,1002.09,银行存款-未收款,,TRUE,asset_cash,tag21,l10n_chart_china_standard_business_latest
|
account_1002_02,1002.02,银行存款-利息,account_1002,TRUE,asset_cash,,l10n_chart_china_standard_business_latest
|
||||||
|
account_1002_07,1002.07,银行暂记科目,account_1002,TRUE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
|
account_1002_08,1002.08,银行存款-未付款,account_1002,TRUE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
|
account_1002_09,1002.09,银行存款-未收款,account_1002,TRUE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1003,1003,存放中央银行款项,,TRUE,asset_current,tag21,l10n_chart_china_standard_business_latest
|
account_1003,1003,存放中央银行款项,,TRUE,asset_current,tag21,l10n_chart_china_standard_business_latest
|
||||||
account_1011,1011,存放同业,,FALSE,asset_current,tag21,l10n_chart_china_standard_business_latest
|
account_1011,1011,存放同业,,FALSE,asset_current,tag21,l10n_chart_china_standard_business_latest
|
||||||
account_1012,1012,其他货币资金,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1012,1012,其他货币资金,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
@@ -32,7 +35,7 @@ account_1402,1402,在途物资,,FALSE,asset_current,,l10n_chart_china_standard_b
|
|||||||
account_1403,1403,原材料,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1403,1403,原材料,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1404,1404,材料成本差异,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1404,1404,材料成本差异,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1405,1405,库存商品,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1405,1405,库存商品,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1405_01,1405.01,其中:数据资源,account_1405,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1405_01,1405.01,其中:数据资源,account_1405,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1406,1406,发出商品,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1406,1406,发出商品,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1407,1407,商品进销差价,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1407,1407,商品进销差价,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
account_1408,1408,委托加工物资,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
account_1408,1408,委托加工物资,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||||
|
|||||||
|
@@ -9,6 +9,9 @@
|
|||||||
<field name="income_currency_exchange_account_id" ref="account_6061"/>
|
<field name="income_currency_exchange_account_id" ref="account_6061"/>
|
||||||
<field name="expense_currency_exchange_account_id" ref="account_6061"/>
|
<field name="expense_currency_exchange_account_id" ref="account_6061"/>
|
||||||
<field name="default_pos_receivable_account_id" ref="account_1124"/>
|
<field name="default_pos_receivable_account_id" ref="account_1124"/>
|
||||||
|
<field name="account_journal_suspense_account_id" ref="account_1002_07"/>
|
||||||
|
<field name="account_journal_payment_credit_account_id" ref="account_1002_08"/>
|
||||||
|
<field name="account_journal_payment_debit_account_id" ref="account_1002_09"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<function model="account.chart.template" name="try_loading">
|
<function model="account.chart.template" name="try_loading">
|
||||||
|
|||||||
@@ -57,6 +57,14 @@ class AccountChartTemplate(models.Model):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _load(self, company):
|
def _load(self, company):
|
||||||
|
if self == self.env.ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest', False):
|
||||||
|
# #todo: 当为 标准中国会计的处理
|
||||||
|
# company.write({
|
||||||
|
# 'account_journal_suspense_account_id': self.account_journal_suspense_account_id.id if self.account_journal_suspense_account_id else False,
|
||||||
|
# 'account_journal_payment_credit_account_id': self.account_journal_payment_credit_account_id.id if self.account_journal_payment_credit_account_id else False,
|
||||||
|
# 'account_journal_payment_debit_account_id': self.account_journal_payment_debit_account_id.id if self.account_journal_payment_debit_account_id else False,
|
||||||
|
# })
|
||||||
|
pass
|
||||||
res = super(AccountChartTemplate, self)._load(company)
|
res = super(AccountChartTemplate, self)._load(company)
|
||||||
# 更新父级
|
# 更新父级
|
||||||
company = self.env.user.company_id
|
company = self.env.user.company_id
|
||||||
@@ -74,8 +82,8 @@ class AccountChartTemplate(models.Model):
|
|||||||
parent = self.env['account.account'].sudo().search([
|
parent = self.env['account.account'].sudo().search([
|
||||||
('company_id', '=', company.id),
|
('company_id', '=', company.id),
|
||||||
('code', '=', parent_code),
|
('code', '=', parent_code),
|
||||||
], limit=1)
|
], limit=1).exists()
|
||||||
if len(parent):
|
if parent:
|
||||||
acc.write({
|
acc.write({
|
||||||
'parent_id': parent.id,
|
'parent_id': parent.id,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user