Skip to Content
Menu
This question has been flagged
1 Reply
6744 Views

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
Discard
Best Answer

Have you added account module dependency on your custom module?

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

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 22
1114
6
Aug 19
8551
1
Dec 16
4881
1
Feb 24
772
0
Feb 24
291