Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7717 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Have you added account module dependency on your custom module?

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 22
1868
6
sie 19
10067
1
gru 16
5694
1
lut 24
2700
0
lut 24
1393