mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix account
This commit is contained in:
@@ -127,9 +127,9 @@ class ResConfigSettings(models.TransientModel):
|
||||
sql = "delete from %s" % t_name
|
||||
try:
|
||||
self._cr.execute(sql)
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
_logger.error('remove data error: %s,%s', line, e)
|
||||
self._cr.commit()
|
||||
# 更新序号
|
||||
for line in s:
|
||||
domain = [('code', '=ilike', line + '%')]
|
||||
@@ -354,7 +354,14 @@ class ResConfigSettings(models.TransientModel):
|
||||
self._cr.execute(sql2)
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
pass
|
||||
try:
|
||||
# 增加对 pos的处理
|
||||
sql = ("update pos_config set journal_id=NULL;")
|
||||
self._cr.execute(sql)
|
||||
self._cr.commit()
|
||||
except Exception as e:
|
||||
pass
|
||||
try:
|
||||
rec = self.env['res.partner'].search([])
|
||||
for r in rec:
|
||||
@@ -376,7 +383,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'property_stock_valuation_account_id': None,
|
||||
})
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
pass
|
||||
try:
|
||||
rec = self.env['stock.location'].search([])
|
||||
for r in rec:
|
||||
@@ -385,7 +392,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
'valuation_out_account_id': None,
|
||||
})
|
||||
except Exception as e:
|
||||
pass # raise Warning(e)
|
||||
pass
|
||||
|
||||
seqs = []
|
||||
return self.remove_app_data(to_removes, seqs)
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<field name="default_pos_receivable_account_id" ref="account_1124"/>
|
||||
</record>
|
||||
|
||||
<function model="account.chart.template" name="try_loading_for_current_company">
|
||||
<value eval="[ref('l10n_cn_standard_latest.l10n_chart_china_standard_business_latest')]"/>
|
||||
<function model="account.chart.template" name="try_loading">
|
||||
<value eval="[ref('l10n_chart_china_standard_business_latest')]"/>
|
||||
</function>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -199,38 +199,6 @@
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<record id="l10n_cn_standard_sale_included_3" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10n_chart_china_standard_business_latest"/>
|
||||
<field name="name">3%销项税(含)</field>
|
||||
<field name="description">增值税销项税3%,单价含税</field>
|
||||
<field name="amount">3</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="price_include" eval="1"/>
|
||||
<field name="tax_group_id" ref="l10n_cn.l10n_cn_tax_group_vat_3"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
<!-- sale tax excluded -->
|
||||
<record id="l10n_cn_standard_sale_excluded_13" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10n_chart_china_standard_business_latest"/>
|
||||
@@ -364,39 +332,6 @@
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<record id="l10n_cn_standard_sale_excluded_3" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10n_chart_china_standard_business_latest"/>
|
||||
<field name="name">3%销项税</field>
|
||||
<field name="description">增值税销项税3%,单价不含税</field>
|
||||
<field name="amount">3</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">sale</field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="tax_group_id" ref="l10n_cn.l10n_cn_tax_group_vat_3"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_5'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<!-- purchase tax excluded -->
|
||||
<record id="l10n_cn_standard_purchase_excluded_13" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10n_chart_china_standard_business_latest"/>
|
||||
@@ -530,36 +465,4 @@
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
<record id="l10n_cn_standard_purchase_excluded_3" model="account.tax.template">
|
||||
<field name="chart_template_id" ref="l10n_chart_china_standard_business_latest"/>
|
||||
<field name="name">3%进项税</field>
|
||||
<field name="description">增值税进项税3%,单价不含税</field>
|
||||
<field name="amount">3</field>
|
||||
<field name="amount_type">percent</field>
|
||||
<field name="type_tax_use">purchase</field>
|
||||
<field name="price_include" eval="0"/>
|
||||
<field name="tax_group_id" ref="l10n_cn.l10n_cn_tax_group_vat_3"/>
|
||||
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_1'),
|
||||
}),
|
||||
]"/>
|
||||
<field name="refund_repartition_line_ids" eval="[(5, 0, 0),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'base',
|
||||
}),
|
||||
(0,0, {
|
||||
'factor_percent': 100,
|
||||
'repartition_type': 'tax',
|
||||
'account_id': ref('account_2221_1_1'),
|
||||
}),
|
||||
]"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<data noupdate="1">
|
||||
<!-- Chart template -->
|
||||
<record id="l10n_chart_china_standard_business_latest" model="account.chart.template">
|
||||
<field name="name">2020中国企业会计科目表</field>
|
||||
<field name="name">2021中国企业会计科目表-odoo14</field>
|
||||
<field name="code_digits" eval="4" />
|
||||
<field name="currency_id" ref="base.CNY" />
|
||||
<field name="cash_account_code_prefix">1001</field>
|
||||
|
||||
@@ -29,11 +29,11 @@ def post_init_hook(cr, registry):
|
||||
数据初始化,只在安装后执行,更新时不执行
|
||||
此处不执行,只是记录,该数据已处理完成
|
||||
"""
|
||||
cr.execute("UPDATE account_account_template set group_id = "
|
||||
"(select id from account_group where account_group.code_prefix=trim(substring(account_account_template.code from 1 for 1)) limit 1);")
|
||||
# cr.execute("UPDATE account_account_template set group_id = "
|
||||
# "(select id from account_group where account_group.code_prefix_start=trim(substring(account_account_template.code from 1 for 1)) limit 1);")
|
||||
|
||||
cr.execute("UPDATE account_account set group_id = "
|
||||
"(select id from account_group where account_group.code_prefix=trim(substring(account_account.code from 1 for 1)) limit 1);")
|
||||
"(select id from account_group where account_group.code_prefix_start=trim(substring(account_account.code from 1 for 1)) limit 1);")
|
||||
cr.commit()
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user