Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
659 Vizualizări

Hi, Have this issue with Odoo 10 CE ( very old but we love it!)

My account_invoice.py looks like this 


import qrcode
import requests
import base64
import cStringIO

from odoo import api, fields, models, _


class AccountInvoice(models.Model):
_inherit = "account.invoice"

invoice_qr_code = fields.Binary(string="Invoice QR Code", attachment=True)
invoice_extension = fields.Char(string="Invoice Extension")
messages = fields.Text(string="Messages")
total_amount = fields.Float(string="Total Amount")

@api.multi
def action_datecs_access(self):
for record in self:
try:

 ......etc






and my account_invoice_view_inherit.xml looks like this;






"\ rel="ugc">ir\.ui\.view">
\ \ \ \ \ \ \ \ account.invoice.form
account.invoice














 

 

 




And i keep on getting this error;




ParseError: "Error while validating constraint Field `total_amount` does not exist 


The same happens for all the fields I had defined I the account_invoice.py  



I use notepad ++ an the indentation looks ok.  Kindly help help help!

Regards,

Austin

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Make sure that the python file is imported inside the init file and service has been restarted after adding the field.


Thanks

Imagine profil
Abandonează