Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Odoo13 External ID not found in the system: account.model_account_invoice

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
templatesemailtemplateodoo12Odoo13.0
1 Svar
7566 Visninger
Avatar
Lima Saudara

I making a custom module that will generate email.template.

In Odoo12 this addons working properly, now I want to modify the code that will be used on Odoo13,

Here is the template.xml code:

<odoo>
    <data>
  <record id="dotmatrix_invoice" model="mail.template">
  <field name="name">Dot Matrix Invoice</field>
  <field name="model_id" ref="account.model_account_invoice"/>
  <field name="subject">Dot Matrix Invoice</field>
  <field name="body_html"><![CDATA[
  ${'INVOICE'.rjust(30)} ${object.number}
  ${''.rjust(80, '-')}
  ${'Customer:'.rjust(20)} ${object.partner_id.display_name.ljust(20)} ${'Date:'.rjust(20)} ${object.date_invoice}
  ${' '.rjust(20)} ${object.partner_id.street.ljust(20) if object.partner_id.street else ''.ljust(20) } ${'Salesperson:'.rjust(20)} ${object.user_id.name}
  ${''.rjust(20)} ${object.partner_id.street2.ljust(20) if object.partner_id.street2 else ''.ljust(20)} ${'Due Date:'.rjust(20)} ${object.date_due}
  ${''.rjust(20)} ${object.partner_id.city.ljust(20) if object.partner_id.city else ''.ljust(20)} ${'Payment Terms:'.rjust(20)} ${object.payment_term_id.name if object.payment_term_id else ''}
  ${''.rjust(20)} ${object.partner_id.state_id.name if object.partner_id.state_id else ''} ${object.partner_id.zip}
  ${''.rjust(20)} ${object.partner_id.country_id.name if object.partner_id.country_id else ''}
  ${'PRODUCT LINES'}
  ${''.rjust(80, '-')}
  ${'Product'.ljust(29)} ${'Qty'.ljust(5)} ${'Price'.rjust(12)} ${'Disc'.rjust(7)} ${'Taxes'.ljust(8)} ${'Subtotal'.rjust(13)}
  ${''.rjust(80, '-')}
  % for l in object.invoice_line_ids:
  ${l.name[:28].ljust(29)} ${"{:4,.0f}".format(l.quantity).rjust(5)} ${"{:4,.0f}".format(l.price_unit).rjust(12)} ${"{:4,.0f}".format(l.discount).rjust(7)} ${l.invoice_line_tax_ids.name.ljust(8) if l.invoice_line_tax_ids else ''.ljust(8) } ${"{:4,.0f}".format(l.price_subtotal).rjust(13)}
  % endfor
  ${''.rjust(80, '-')}
  ${'Untaxed Amount:'.rjust(65)} ${"{:4,.0f}".format(object.amount_untaxed).rjust(13)}
  ${'Tax:'.rjust(65)} ${"{:4,.0f}".format(object.amount_tax).rjust(13)}
  ${'Total:'.rjust(65)} ${"{:4,.0f}".format(object.amount_total).rjust(13)}
  ]]></field>
  </record>
  </data>
</odoo>


But I got this following error:

Error:
Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/odoo13/odoo/tools/cache.py", line 85, in lookup
    r = d[key]
  File "/opt/odoo/odoo13/odoo/tools/func.py", line 69, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/odoo/odoo13/odoo/tools/lru.py", line 44, in __getitem__
    a = self.d[obj].me
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f65579bed40>, 'account.model_account_invoice')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 561, in _tag_record
    f_val = self.id_get(f_ref)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 657, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 663, in model_id_get
    return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_model.py", line 1671, in xmlid_to_res_model_res_id
    return self.xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-25>", line 2, in xmlid_lookup
  File "/opt/odoo/odoo13/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_model.py", line 1660, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: account.model_account_invoice
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/odoo/odoo13/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo13/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo/odoo13/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/opt/odoo/odoo13/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo13/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo13/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo13/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo13/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo13/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo13/addons/web/controllers/main.py", line 1326, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo13/addons/web/controllers/main.py", line 1314, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo/odoo13/odoo/api.py", line 387, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo/odoo13/odoo/api.py", line 374, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-60>", line 2, in button_immediate_install
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
    return method(self, *args, **kwargs)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/opt/odoo/odoo13/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/odoo13/odoo/modules/loading.py", line 423, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/opt/odoo/odoo13/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/opt/odoo/odoo13/odoo/modules/loading.py", line 225, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/opt/odoo/odoo13/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 736, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 803, in convert_xml_import
    obj.parse(doc.getroot())
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 721, in parse
    exc_info[2]
  File "/opt/odoo/odoo13/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 561, in _tag_record
    f_val = self.id_get(f_ref)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 657, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/opt/odoo/odoo13/odoo/tools/convert.py", line 663, in model_id_get
    return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_model.py", line 1671, in xmlid_to_res_model_res_id
    return self.xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-25>", line 2, in xmlid_lookup
  File "/opt/odoo/odoo13/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/opt/odoo/odoo13/odoo/addons/base/models/ir_model.py", line 1660, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system: account.model_account_invoice" while parsing /opt/odoo/odoo13/custom-addons/dotmatrix/views/templates.xml:1, near
<odoo>
    <data>
        <record id="dotmatrix_invoice" model="mail.template">
            <field name="name">Dot Matrix Invoice</field>
            <field name="model_id" ref="account.model_account_invoice"/>
            <field name="subject">Dot Matrix Invoice</field>
            <field name="body_html">
                ${'INVOICE'.rjust(30)} ${object.number}
                ${''.rjust(80, '-')}
                ${'Customer:'.rjust(20)} ${object.partner_id.display_name.ljust(20)} ${'Date:'.rjust(20)} ${object.date_invoice}
                ${' '.rjust(20)} ${object.partner_id.street.ljust(20) if object.partner_id.street else ''.ljust(20) } ${'Salesperson:'.rjust(20)} ${object.user_id.name}
                ${''.rjust(20)} ${object.partner_id.street2.ljust(20) if object.partner_id.street2 else ''.ljust(20)} ${'Due Date:'.rjust(20)} ${object.date_due}
                ${''.rjust(20)} ${object.partner_id.city.ljust(20) if object.partner_id.city else ''.ljust(20)} ${'Payment Terms:'.rjust(20)} ${object.payment_term_id.name if object.payment_term_id else ''}
                ${''.rjust(20)} ${object.partner_id.state_id.name if object.partner_id.state_id else ''} ${object.partner_id.zip}
                ${''.rjust(20)} ${object.partner_id.country_id.name if object.partner_id.country_id else ''}
                ${'PRODUCT LINES'}
                ${''.rjust(80, '-')}
                ${'Product'.ljust(29)} ${'Qty'.ljust(5)} ${'Price'.rjust(12)} ${'Disc'.rjust(7)} ${'Taxes'.ljust(8)} ${'Subtotal'.rjust(13)}
                ${''.rjust(80, '-')}
                % for l in object.invoice_line_ids:
                ${l.name[:28].ljust(29)} ${"{:4,.0f}".format(l.quantity).rjust(5)} ${"{:4,.0f}".format(l.price_unit).rjust(12)} ${"{:4,.0f}".format(l.discount).rjust(7)} ${l.invoice_line_tax_ids.name.ljust(8) if l.invoice_line_tax_ids else ''.ljust(8) } ${"{:4,.0f}".format(l.price_subtotal).rjust(13)}
                % endfor
                ${''.rjust(80, '-')}
                ${'Untaxed Amount:'.rjust(65)} ${"{:4,.0f}".format(object.amount_untaxed).rjust(13)}
                ${'Tax:'.rjust(65)} ${"{:4,.0f}".format(object.amount_tax).rjust(13)}
                ${'Total:'.rjust(65)} ${"{:4,.0f}".format(object.amount_total).rjust(13)}
                </field>
        </record>
    </data>
</odoo>


 It seems the error came from the

<field name="model_id" ref="account.model_account_invoice"/>

So if on Odoo it refer on account.model_account_invoice , What it will be on Odoo13? 

0
Avatar
Kassér
Avatar
Niyas Raphy (Walnut Software Solutions)
Bedste svar

Hi,

In odoo13, the account.invoice model is merged with account.move .

So instead of,

<field name="model_id" ref="account.model_account_invoice"/>

this, try,

<field name="model_id" ref="account.model_account_move"/>


Thanks

2
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
How to learn odoo pos technical Løst
odoo12 Odoo13.0
Avatar
Avatar
1
feb. 21
3679
How to get the Invoice Payments Widget value on Customer Invoice?
invoice templates account.move emailtemplate Odoo13.0
Avatar
1
apr. 20
60
How to get the Invoice Payments Widget value on Customer Invoice?
invoice templates account.move emailtemplate Odoo13.0
Avatar
0
apr. 20
10
How to render mail.template ? Løst
templates odoo12
Avatar
Avatar
1
apr. 20
9295
How to change the html body part in reset password email template in odoo12 Løst
emailtemplate odoo12
Avatar
Avatar
1
sep. 19
7237
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now