Search code examples
xmlpython-3.xodooodoo-11

Why do I get the error "not all arguments converted during string formatting None" when installing module in Odoo 11?


I am trying to install the l10n_es_aeat module developed by Odoo Community Association. I have installed it in local with no problem, however in a remote server I get the following error:

not all arguments converted during string formatting None" while parsing /my_odoo_path/l10n_es_aeat/data/aeat_partner.xml:5

This error is due to the XML data introduced by the module, which is only the next record:

<odoo noupdate="1">

<record id="res_partner_aeat" model="res.partner">
    <field name="name">Agencia Estatal de Administración Tributaria (AEAT)</field>
    <field name="supplier">1</field>
    <field name="customer" eval="False"/>
    <field name="is_company">1</field>
    <field name="city">Madrid</field>
    <field name="zip">28020</field>
    <field name="country_id" ref="base.es"/>
    <field name="vat">ESQ2826000H</field>
    <field name="street">C/ Lérida 32-34 </field>
    <field name="phone">91 583 80 72</field>
    <field name="website">https://www.agenciatributaria.gob.es</field>
    <field name="image" type="base64" file="l10n_es_aeat/static/description/icon.png"/>
</record>

</odoo>

Any ideas of what is happening? Thank you!


Solution

  • Thanks to Travis, when I was going to paste him the whole traceback, I realised a line I had not seen before:

    File "/my_odoo_path/linked/partner_vat_unique/models/res_partner.py", line 29, in _check_vat_unique
        "partner.") % record.vat)
    

    That gave me the reason. There is already a partner with the VAT number ESQ2826000H stored in the database of the remote server. So when Odoo tries to load the XML record of the module l10n_es_aeat, throws the error. This worked in localhost because my database had no partners with that VAT.

    And the reason of why there is already a partner with that VAT number in the remote database is because we made a data migration from version 8 to version 11. In version 8 l10n_es_aeat also created a partner with that VAT, so when we try to install the module in version 11, there is a conflict with the migrated partner.