跳至內容
選單
此問題已被標幟
1 回覆
7770 瀏覽次數

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

頭像
捨棄
最佳答案

Have you added account module dependency on your custom module?

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
2月 22
1945
6
8月 19
10142
1
12月 16
5720
1
2月 24
2739
0
2月 24
1456