在 odoo 9 中从西班牙语 odoo 本地化安装模块 l10n_es_aeat_mod303 时出错

Error installing module l10n_es_aeat_mod303 from spanish odoo localization in odoo 9

在 odoo 9 中,从西班牙语本地化安装模块 l10n_es_aeat_mod303,给我这个错误:

(...)File "/etc/odoo/server/openerp/addons/base/ir/ir_model.py", line 995, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % (xmlid))
ParseError: ""External ID not found in the system: l10n_es.account_tax_template_s_iva4b" while evaluating
"[(6, False, [ref('l10n_es.account_tax_template_s_iva4b'), ref('l10n_es.account_tax_template_s_iva4s')])]"" while parsing /etc/odoo/server/addons_extra/l10n_es_aeat_mod303/data/tax_code_map_mod303_data.xml:9, near
<record id="aeat_mod303_map_line_01" model="l10n.es.aeat.map.tax.line">
    <field name="map_parent_id" ref="aeat_mod303_map"/>
    <field name="field_number">01</field>
    <field name="name">R&#233;gimen General - Base imponible 4%</field>
    <field name="to_regularize" eval="False"/>
    <field name="move_type">regular</field>
    <field name="field_type">base</field>
    <field name="sum_type">both</field>
    <field name="inverse" eval="False"/>
<!-- Base facturas de venta (haber) - Descuentos en facturas de venta(debe):
     S_IVA4B, S_IVA4S -->
<field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_s_iva4b'), ref('l10n_es.account_tax_template_s_iva4s')])]"/>

它似乎没有找到标识符 "account_tax_template_s_iva4b"。
¿在安装模块之前需要安装一些依赖项或者我该如何解决这个错误?

问题与依赖关系无关,但问题出在数据中。

在模块 l10n_es_aeat_mod303/data/tax_code_map_mod303_data 中。xml 文件可用。

   <field name="tax_ids" eval="[(6, False, [ref('l10n_es.account_tax_template_s_iva4b'), ref('l10n_es.account_tax_template_s_iva4s')])]"/>

l10n_es.account_tax_template_s_iva4b 在 odoo 基本模块中找不到外部 ID。

您可以在xml文件中手动更改tax_ids或在openerp[=中的注释中添加xml文件27=.py 文件,之后那个模块就可以工作了。

这可能对您有所帮助。

我发现官方的l10n_es模块在addons里面,另一个在addons_extra.

主要问题是conf文件优先使用官方插件,然后,addons_extra:

addons_path = /odoo/addons,/odoo/addons_extra


为了改变这一点,我遵循了以下步骤:

  1. 确保 l10n_es 的新模块在 addons_extra 文件夹中。
  2. 将路径放在conf文件中addons_path参数的第一位(重要的是官方插件路径 将在我们的新模块路径之后):

    addons_path = /odoo/addons_extra/l10n-spain,/odoo/addons,/odoo/addons_extra

  3. 重启服务器并更新模块列表。

  4. 更新 l10n_es 模块。

现在,新模块已安装,我可以安装 l10n_es_aeat_mod303 模块而不会出现错误。