mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix misc,主要是财务相关
This commit is contained in:
@@ -313,14 +313,17 @@ class ResConfigSettings(models.TransientModel):
|
||||
company_id = self.env.company.id
|
||||
self = self.with_company(self.env.company)
|
||||
to_removes = [
|
||||
# 清除财务科目,用于重设
|
||||
# 清除财务科目,用于重设。有些是企业版的也处理下
|
||||
'account.reconcile.model',
|
||||
'account.transfer.model.line',
|
||||
'account.transfer.model',
|
||||
'res.partner.bank',
|
||||
# 'account.invoice',
|
||||
'account.payment',
|
||||
'account.bank.statement',
|
||||
# 'account.tax.account.tag',
|
||||
'account.tax',
|
||||
'account.tax.template',
|
||||
# 'wizard_multi_charts_accounts',
|
||||
'account.account',
|
||||
# 'account.journal',
|
||||
@@ -336,7 +339,6 @@ class ResConfigSettings(models.TransientModel):
|
||||
sql2 = "update account_journal set bank_account_id=NULL where company_id=%d;" % company_id
|
||||
self._cr.execute(sql)
|
||||
self._cr.execute(sql2)
|
||||
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
_logger.error('remove data error: %s,%s', 'account_chart: set tax and account_journal', e)
|
||||
@@ -354,6 +356,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'property_account_receivable_id': None,
|
||||
'property_account_payable_id': None,
|
||||
})
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
_logger.error('remove data error: %s,%s', 'account_chart', e)
|
||||
# 品类处理
|
||||
@@ -368,6 +371,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'property_stock_valuation_account_id': None,
|
||||
'property_stock_journal': None,
|
||||
})
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass
|
||||
# 产品处理
|
||||
@@ -378,6 +382,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'property_account_expense_id': None,
|
||||
'property_account_creditor_price_difference': None,
|
||||
})
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass
|
||||
# 日记账处理
|
||||
@@ -402,6 +407,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'valuation_in_account_id': None,
|
||||
'valuation_out_account_id': None,
|
||||
})
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
# 库存计价默认值处理
|
||||
@@ -420,6 +426,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
])
|
||||
if prop:
|
||||
prop.unlink()
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
# 先 unlink 处理
|
||||
@@ -427,14 +434,17 @@ class ResConfigSettings(models.TransientModel):
|
||||
if j_ids:
|
||||
try:
|
||||
j_ids.unlink()
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
|
||||
self._cr.commit()
|
||||
seqs = []
|
||||
self.env.company.sudo().write({
|
||||
try:
|
||||
c_ids = self.env['res.company'].sudo().search([])
|
||||
c_ids.sudo().write({
|
||||
'chart_template_id': False,
|
||||
})
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
seqs = []
|
||||
res = self._remove_app_data(to_removes, seqs)
|
||||
return res
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
{
|
||||
'name': '2023最新中国会计科目表.企业标准会计.Latest Chinese Accounting for odoo16',
|
||||
'version': '16.24.09.06',
|
||||
'version': '16.24.09.11',
|
||||
'author': 'odooai.cn',
|
||||
'category': 'Accounting/Localizations/Account Charts',
|
||||
'website': 'https://www.odooai.cn',
|
||||
@@ -65,6 +65,7 @@
|
||||
'data/account_tax_group_data.xml',
|
||||
'data/account_tax_template_data.xml',
|
||||
'data/account_chart_template_data.xml',
|
||||
'data/account_chart_template_try_loading.xml',
|
||||
],
|
||||
'post_init_hook': 'post_init_hook',
|
||||
'installable': True,
|
||||
|
||||
@@ -4,8 +4,8 @@ account_1002,1002,银行存款,,TRUE,asset_cash,tag21,l10n_chart_china_standard_
|
||||
account_1002_01,1002.01,银行存款-人民币,account_1002,TRUE,asset_cash,,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_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_1011,1011,存放同业,,FALSE,asset_current,tag21,l10n_chart_china_standard_business_latest
|
||||
account_1012,1012,其他货币资金,,FALSE,asset_current,,l10n_chart_china_standard_business_latest
|
||||
|
||||
|
@@ -1,21 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- 此处不设置为 noupdate,因为要更新-->
|
||||
<record id="l10n_chart_china_standard_business_latest" model="account.chart.template">
|
||||
<field name="property_account_receivable_id" ref="account_1122"/>
|
||||
<field name="property_account_payable_id" ref="account_2202"/>
|
||||
<field name="property_account_expense_categ_id" ref="account_6401"/>
|
||||
<field name="property_account_income_categ_id" ref="account_6001"/>
|
||||
<field name="property_account_expense_categ_id" ref="account_6401"/>
|
||||
<field name="property_tax_receivable_account_id" ref="account_2221_1_5"/>
|
||||
<field name="property_tax_payable_account_id" ref="account_2221_1_1"/>
|
||||
<field name="income_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="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"/>
|
||||
<!-- 现金差异收入-->
|
||||
<field name="default_cash_difference_income_account_id" ref="account_6603"/>
|
||||
<!-- 现金差额费用-->
|
||||
<field name="default_cash_difference_expense_account_id" ref="account_6603"/>
|
||||
<!-- 现金折扣收益科目-->
|
||||
<field name="account_journal_early_pay_discount_gain_account_id" ref="account_6603"/>
|
||||
<!-- 现金折扣损失科目-->
|
||||
<field name="account_journal_early_pay_discount_loss_account_id" ref="account_6603"/>
|
||||
</record>
|
||||
|
||||
<!-- <function model="account.chart.template" name="try_loading">-->
|
||||
<!-- <value eval="[ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest')]"/>-->
|
||||
<!-- </function>-->
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<function model="account.chart.template" name="try_loading">
|
||||
<value eval="[ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest')]"/>
|
||||
</function>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -51,7 +51,7 @@
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
'account_id': ref('account_2221_1_1'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
@@ -62,7 +62,7 @@
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
'account_id': ref('account_2221_1_1'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<data noupdate="1">
|
||||
<!-- Chart template -->
|
||||
<record id="l10n_chart_china_standard_business_latest" model="account.chart.template">
|
||||
<field name="name">2023中国企业会计科目表-odoo16</field>
|
||||
<field name="code_digits" eval="4"/>
|
||||
<field name="currency_id" ref="base.CNY"/>
|
||||
<field name="country_id" ref="base.cn"/>
|
||||
<field name="cash_account_code_prefix">1001</field>
|
||||
<field name="bank_account_code_prefix">1002</field>
|
||||
<field name="transfer_account_code_prefix">1003</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user