fix misc 会计科目相关

This commit is contained in:
Ivan Office
2024-09-10 04:49:57 +08:00
parent 0699ff6d13
commit 1be861dcc2
3 changed files with 33 additions and 6 deletions

View File

@@ -23,7 +23,7 @@
{ {
'name': 'odoo Tweak,Ai Employee,Boost,Customize All in One. Customize,UI,Boost,Security,Data', 'name': 'odoo Tweak,Ai Employee,Boost,Customize All in One. Customize,UI,Boost,Security,Data',
'version': '16.24.08.20', 'version': '16.24.09.10',
'author': 'odooai.cn', 'author': 'odooai.cn',
'category': 'Extra Tools', 'category': 'Extra Tools',
'website': 'https://www.odooai.cn', 'website': 'https://www.odooai.cn',

View File

@@ -323,6 +323,7 @@ class ResConfigSettings(models.TransientModel):
'account.tax', 'account.tax',
# 'wizard_multi_charts_accounts', # 'wizard_multi_charts_accounts',
'account.account', 'account.account',
# 'account.journal',
] ]
# todo: 要做 remove_hr因为工资表会用到 account # todo: 要做 remove_hr因为工资表会用到 account
# 更新account关联很多是多公司字段故只存在 ir_property故在原模型只能用update # 更新account关联很多是多公司字段故只存在 ir_property故在原模型只能用update
@@ -381,7 +382,6 @@ class ResConfigSettings(models.TransientModel):
pass pass
# 日记账处理 # 日记账处理
try: try:
#todo: 当前有些日记账的默认值要在 ir.property 处理 _set_default比较麻烦先修改下该日记账 code创建新日记账后删除旧的即可
rec = self.env['account.journal'].search([]) rec = self.env['account.journal'].search([])
rec.write({ rec.write({
'account_control_ids': None, 'account_control_ids': None,
@@ -391,6 +391,7 @@ class ResConfigSettings(models.TransientModel):
'profit_account_id': None, 'profit_account_id': None,
'suspense_account_id': None, 'suspense_account_id': None,
}) })
self._cr.commit()
except Exception as e: except Exception as e:
pass # raise Warning(e) pass # raise Warning(e)
@@ -403,9 +404,35 @@ class ResConfigSettings(models.TransientModel):
}) })
except Exception as e: except Exception as e:
pass # raise Warning(e) pass # raise Warning(e)
# 库存计价默认值处理
try:
# 当前有些日记账的默认值要在 ir.property 处理 _set_default比较麻烦
todo_list = [
'property_stock_account_input_categ_id',
'property_stock_account_output_categ_id',
'property_stock_valuation_account_id',
'property_stock_journal',
]
for name in todo_list:
field_id = self.env['ir.model.fields']._get('product.category', name).id
prop = self.env['ir.property'].sudo().search([
('fields_id', '=', field_id),
])
if prop:
prop.unlink()
except Exception as e:
pass # raise Warning(e)
# 先 unlink 处理
j_ids = self.env['account.journal'].sudo().search([])
if j_ids:
try:
j_ids.unlink()
except Exception as e:
pass # raise Warning(e)
self._cr.commit() self._cr.commit()
seqs = [] seqs = []
self.env.company.write({ self.env.company.sudo().write({
'chart_template_id': False, 'chart_template_id': False,
}) })
res = self._remove_app_data(to_removes, seqs) res = self._remove_app_data(to_removes, seqs)

View File

@@ -14,8 +14,8 @@
<field name="account_journal_payment_debit_account_id" ref="account_1002_09"/> <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">-->
<value eval="[ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest')]"/> <!-- <value eval="[ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest')]"/>-->
</function> <!-- </function>-->
</data> </data>
</odoo> </odoo>