Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
7642 Visualizzazioni

Hello i have a custom module that work on odoo 11 but when i installed it @odoo12 it give me this error

model not found: account.invoice
Error Context :
View `account.invoice form`
[view_id: 751, xml_id: n/a, model: account.invoice, parent_id: 538]

this is the model file
from odoo import models, fields,api,tools
from num2words import num2words
import math
import odoo.addons.decimal_precision as dp

class AccountInvoice(models.Model):
    _name = 'account.invoice'
    _inherit = 'account.invoice'
    Timbre_fiscal = fields.Monetary(string="Timbre", required=True, store=True, readonly=True)
    amount_in_word = fields.Char(string="Montant en toute lettre", readonly=True)

and this is the xml file
<odoo>
  <data>
    <record id="account_invoice_form_view" model="ir.ui.view">
      <field name="model">account.invoice</field>
      <field name="inherit_id" ref="account.invoice_form"/>
      <field name="arch" type="xml">
          <xpath expr="//page[1]/group/field[@name='amount_total']" position="before">
<field name="Timbre_fiscal"/>
  </xpath>      
      </field>
    </record>
</data>
</odoo>

Please help me

Avatar
Abbandona
Risposta migliore

Have you added account module dependency on your custom module?

and remove _name='account.invoice'     _inherit='account.invoice' is enough

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 22
1772
6
ago 19
9925
1
dic 16
5605
1
feb 24
2529
0
feb 24
1272