Przejdź do zawartości
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Sztuczna inteligencja
    • IoT
    • VoIP
    • Wiedza
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

ValueError: ("Can't load unknown file type %s.", 'models/shift_model.py')

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
odoo12
1 Odpowiedz
6893 Widoki
Awatar
lisa

Hi,

I am trying to create a module that extends hr_payroll odoo12. When I install the module extension I get this error.

Error:
Odoo Server Error

Traceback (most recent call last):
File "/home/viscar/odoo12/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/viscar/odoo12/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/viscar/odoo12/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/home/viscar/odoo12/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/home/viscar/odoo12/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/viscar/odoo12/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/home/viscar/odoo12/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/home/viscar/odoo12/odoo/http.py", line 941, in __call__
return self.method(*args, **kw)
File "/home/viscar/odoo12/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/viscar/odoo12/addons/web/controllers/main.py", line 966, in call_button
action = self._call_kw(model, method, args, {})
File "/home/viscar/odoo12/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/home/viscar/odoo12/odoo/api.py", line 749, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "/home/viscar/odoo12/odoo/api.py", line 736, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "<decorator-gen-61>", line 2, in button_immediate_install
File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
return method(self, *args, **kwargs)
File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install
return self._button_immediate_function(type(self).button_install)
File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
modules.registry.Registry.new(self._cr.dbname, update_module=True)
File "/home/viscar/odoo12/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/viscar/odoo12/odoo/modules/loading.py", line 421, in load_modules
loaded_modules, update_module, models_to_check)
File "/home/viscar/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/viscar/odoo12/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package, report=report)
File "/home/viscar/odoo12/odoo/modules/loading.py", line 68, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
File "/home/viscar/odoo12/odoo/tools/convert.py", line 806, in convert_file
raise ValueError("Can't load unknown file type %s.", filename)
ValueError: ("Can't load unknown file type %s.", 'models/shift_model.py')


1
Awatar
Odrzuć
lisa
Autor

Here is my __manifest__.py

{'name': 'Shift Allowance',

'version': '12.0.1.0.0',

'summary': 'Calculates shift allowance for external empoloyees',

'category': 'Tools',

'author': 'Eliza ',

'depends': ['base'],

'external_dependencies': {"python": ['numpy']},

'data': ['models/shift_model.py', 'views/shift_views.xml'],

'installable': True,

'application': False,

'auto_install': False,

}

I have an init within models, and alongside manifest with imports just as recommended.

lisa
Autor

Here is the shift_model.py

# -*- coding: utf-8 -*-

from odoo import models, fields, api

import numpy as np

class ShiftAllowance(models.Model):

# _name ='shift.allowance'

_description = 'Shift Allowance'

_inherit = 'hr.contract'

# field types working shifts

BasicPayRate = fields.Integer(default=0)

WeekdayDay = fields.Integer(default=0)

WeekdayNight = fields.Integer(default=0)

WeekendDay = fields.Integer(default=0)

WeekendNight = fields.Integer(default=0)

ShiftAllowance = fields.Float()

@api.multi

def userDetails(self):

"""

This function prompts the user for input variables and

returns a dictionary of said varibales

"""

# picks data provided by user and saves it in a dict.

# A dictionary to hold the input variables

work_details = {}

current_user = self.env.user.user_id.id

if current_user:

# work_details["weekdayDay"] = int(self.env['hr.contract.weekdayDay'])

work_details["weekdayDay"] = int(self.weekdayDay)

work_details["weekdayNight"] = int(self.weekdayNight)

work_details["weekendDay"] = int(self.weekendDay)

work_details["weekendNight"] = int(self.weekendNight)

return work_details

# ,WeekdayDay, WeekdayNight, WeekendDay, WeekendNight

# import pdb; pdb.set_trace()

@api.multi

def basic_pay_rate(self):

# picks the basic pay rate as provided by the user

basic_rate = int(self.BasicPayRate)

return basic_rate

# create two arrays weekday and weekend

@api.multi

def shiftWorked(self, work_details):

# Get user work details first

# weekdayShift

WDS = np.array([work_details["weekdayDay"], work_details["weekdayNight"]]).reshape(2, 1)

# WeekendShift

WES = np.array([work_details["weekendDay"], work_details["weekendNight"]]).reshape(2, 1)

# print (WDS,WES)

return WDS, WES

@api.multi

def matrix(self, WDS, WES):

# Get shifts worked

WDS, WES = shiftWorked()

# our constant matrix

OurMatrix = np.array([[1, 9, 2], [7, 0, 5]])

# multiply it by our weekday shifts

WDMatrix = OurMatrix * WDS

# Get the total for the weekdays

WDTotal = WDMatrix.sum(axis=0)

# multiply it by our weekend shifts

WEMatrix = OurMatrix * WES

# Get the total for the weekends

WETotal = WEMatrix.sum(axis=0)

return WDTotal, WETotal

@api.multi

def ratesCalc(self, WDTotal, WETotal):

# Get shift totals

WDTotal, WETotal = matrix()

# our weekday rates

WDRates = np.array([22/100, 0/100, 15/100])

# our weekend rates

WERates = np.array([27/100, 10/100, 20/100])

# multiply weekdayTotals by weekday rates

effectiveWDHrs = WDTotal * WDRates

# multiply weekendTotals by weekend rates

effectiveWEHrs = WETotal * WERates

# Get the total effective hours

effectiveHours = np.concatenate((effectiveWDHrs, effectiveWEHrs), axis=None)

# Get the sum of the hours

totalEffectiveHours = np.sum((effectiveHours), dtype=np.float)

return totalEffectiveHours

# Calculate the amount payable per employee

@api.multi

def amountPayable(self, basic_rate, totalEffectiveHours):

# Get user's basic pay rate

# Get total effective hours

# A constant

Anumber = 21/8

# to get the hourly rate multiply the two

HrlyRate = basic_rate * Anumber

# now get the amount payable

AmountPayable = HrlyRate * totalEffectiveHours

return AmountPayable

# link to the button compute shift allowance so that on click it performs this function

@api.multi

def final_calc(amountPayable):

return amountPayable()

Marcel Trotzek

This confirms my original assumption: You need to remove "'models/shift_model.py'" from your __manifest__.py and instead reference it by using the described __init__.py files.

lisa
Autor

Something like this?

'data': ['models/__init__.py', 'views/shift_views.xml'],

lisa
Autor

I have made the above change, yet I am still getting the same error.

Error:

Odoo Server Error

Traceback (most recent call last):

File "/home/viscar/odoo12/odoo/http.py", line 656, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/viscar/odoo12/odoo/http.py", line 314, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "/home/viscar/odoo12/odoo/tools/pycompat.py", line 87, in reraise

raise value

File "/home/viscar/odoo12/odoo/http.py", line 698, in dispatch

result = self._call_function(**self.params)

File "/home/viscar/odoo12/odoo/http.py", line 346, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/viscar/odoo12/odoo/service/model.py", line 97, in wrapper

return f(dbname, *args, **kwargs)

File "/home/viscar/odoo12/odoo/http.py", line 339, in checked_call

result = self.endpoint(*a, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 941, in __call__

return self.method(*args, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 519, in response_wrap

response = f(*args, **kw)

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 966, in call_button

action = self._call_kw(model, method, args, {})

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 954, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 749, in call_kw

return _call_kw_multi(method, model, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 736, in _call_kw_multi

result = method(recs, *args, **kwargs)

File "<decorator-gen-61>", line 2, in button_immediate_install

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 74, in check_and_log

return method(self, *args, **kwargs)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install

return self._button_immediate_function(type(self).button_install)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function

modules.registry.Registry.new(self._cr.dbname, update_module=True)

File "/home/viscar/odoo12/odoo/modules/registry.py", line 86, in new

odoo.modules.load_modules(registry._db, force_demo, status, update_module)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 421, in load_modules

loaded_modules, update_module, models_to_check)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules

perform_checks=perform_checks, models_to_check=models_to_check

File "/home/viscar/odoo12/odoo/modules/loading.py", line 222, in load_module_graph

load_data(cr, idref, mode, kind='data', package=package, report=report)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 68, in load_data

tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

File "/home/viscar/odoo12/odoo/tools/convert.py", line 806, in convert_file

raise ValueError("Can't load unknown file type %s.", filename)

ValueError: ("Can't load unknown file type %s.", 'models/__init__.py')

Marcel Trotzek

You should not reference any Python file in the 'data' attribute. Just having the __init__.py files in these folders is already enough for your modified model to be found. Your data attribute should look like this:

'data': ['views/shift_views.xml'],

lisa
Autor

I have enforced the change and this is the error I am getting.

Despite the file being present

Error:

Odoo Server Error

Traceback (most recent call last):

File "/home/viscar/odoo12/odoo/http.py", line 656, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/viscar/odoo12/odoo/http.py", line 314, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "/home/viscar/odoo12/odoo/tools/pycompat.py", line 87, in reraise

raise value

File "/home/viscar/odoo12/odoo/http.py", line 698, in dispatch

result = self._call_function(**self.params)

File "/home/viscar/odoo12/odoo/http.py", line 346, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/viscar/odoo12/odoo/service/model.py", line 97, in wrapper

return f(dbname, *args, **kwargs)

File "/home/viscar/odoo12/odoo/http.py", line 339, in checked_call

result = self.endpoint(*a, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 941, in __call__

return self.method(*args, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 519, in response_wrap

response = f(*args, **kw)

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 966, in call_button

action = self._call_kw(model, method, args, {})

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 954, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 749, in call_kw

return _call_kw_multi(method, model, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 736, in _call_kw_multi

result = method(recs, *args, **kwargs)

File "<decorator-gen-61>", line 2, in button_immediate_install

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 74, in check_and_log

return method(self, *args, **kwargs)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install

return self._button_immediate_function(type(self).button_install)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function

modules.registry.Registry.new(self._cr.dbname, update_module=True)

File "/home/viscar/odoo12/odoo/modules/registry.py", line 86, in new

odoo.modules.load_modules(registry._db, force_demo, status, update_module)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 421, in load_modules

loaded_modules, update_module, models_to_check)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules

perform_checks=perform_checks, models_to_check=models_to_check

File "/home/viscar/odoo12/odoo/modules/loading.py", line 222, in load_module_graph

load_data(cr, idref, mode, kind='data', package=package, report=report)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 68, in load_data

tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

File "/home/viscar/odoo12/odoo/tools/convert.py", line 796, in convert_file

with file_open(pathname, 'rb') as fp:

File "/home/viscar/odoo12/odoo/tools/misc.py", line 199, in file_open

return _fileopen(name, mode=mode, basedir=rtp, pathinfo=pathinfo, basename=basename)

File "/home/viscar/odoo12/odoo/tools/misc.py", line 257, in _fileopen

raise IOError('File not found: %s' % basename)

OSError: File not found: new_shift_test/views/shift_views.xml

lisa
Autor

My bad, there was a typo.

It works!

The error is no longer there.

lisa
Autor

This is my shift_view.xml.

<?xml version="1.0"?>

<data>

<xpath expr="//page[@name='information']" position="after">

<page string="Shift Allowance" name="shift_allowance">

<group>

<group name="shift_allowance" string="Shift Allowance Details">

<button string="Compute Allowance" class="oe_highlight" name="Compute Allowance" type="object"/>

<field name="weekdayDay"/>

<field name="weekdayNight"/>

<field name="weekendDay"/>

<field name="weekendNight"/>

<field name="BasicPayRate"/>

<field name="ShiftAllowance"/>

</group>

</group>

</page>

</xpath>

</data>

I get an assertion error:

I have had this error before on a different project and each time there has been no direct fix. Most of the time there ends up being something wrong with the code.

Do you spot anything odd with the code.

Odoo Server Error

Traceback (most recent call last):

File "/home/viscar/odoo12/odoo/http.py", line 656, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/home/viscar/odoo12/odoo/http.py", line 314, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "/home/viscar/odoo12/odoo/tools/pycompat.py", line 87, in reraise

raise value

File "/home/viscar/odoo12/odoo/http.py", line 698, in dispatch

result = self._call_function(**self.params)

File "/home/viscar/odoo12/odoo/http.py", line 346, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/home/viscar/odoo12/odoo/service/model.py", line 97, in wrapper

return f(dbname, *args, **kwargs)

File "/home/viscar/odoo12/odoo/http.py", line 339, in checked_call

result = self.endpoint(*a, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 941, in __call__

return self.method(*args, **kw)

File "/home/viscar/odoo12/odoo/http.py", line 519, in response_wrap

response = f(*args, **kw)

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 966, in call_button

action = self._call_kw(model, method, args, {})

File "/home/viscar/odoo12/addons/web/controllers/main.py", line 954, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 749, in call_kw

return _call_kw_multi(method, model, args, kwargs)

File "/home/viscar/odoo12/odoo/api.py", line 736, in _call_kw_multi

result = method(recs, *args, **kwargs)

File "<decorator-gen-61>", line 2, in button_immediate_install

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 74, in check_and_log

return method(self, *args, **kwargs)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install

return self._button_immediate_function(type(self).button_install)

File "/home/viscar/odoo12/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function

modules.registry.Registry.new(self._cr.dbname, update_module=True)

File "/home/viscar/odoo12/odoo/modules/registry.py", line 86, in new

odoo.modules.load_modules(registry._db, force_demo, status, update_module)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 421, in load_modules

loaded_modules, update_module, models_to_check)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 313, in load_marked_modules

perform_checks=perform_checks, models_to_check=models_to_check

File "/home/viscar/odoo12/odoo/modules/loading.py", line 222, in load_module_graph

load_data(cr, idref, mode, kind='data', package=package, report=report)

File "/home/viscar/odoo12/odoo/modules/loading.py", line 68, in load_data

tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

File "/home/viscar/odoo12/odoo/tools/convert.py", line 802, in convert_file

convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

File "/home/viscar/odoo12/odoo/tools/convert.py", line 852, in convert_xml_import

relaxng.assert_(doc)

File "src/lxml/lxml.etree.pyx", line 3501, in lxml.etree._Validator.assert_ (src/lxml/lxml.etree.c:184715)

AssertionError: Element data has extra content: xpath, line 3

Marcel Trotzek

I'm glad your original error could be fixed this way. I think in this case the question should be marked as solved and a new one should be created concerning your view, because the topic is completely different. Currently your new question is hard to find for people who could answer it as well as others with similar issues in the future.

On first sight, your view looks like it is meant to override some other view, but it lacks the required <record> definition to tell the system which view to override.

lisa
Autor

Where can I specify that it is solved?

Well, I am trying to extend an existing page by adding a group of fields.

Marcel Trotzek

You should be able to click the checkmark icon on the left side of an answer.

To override an existing view you should check how this is done by Odoo itself (e.g. here: https://github.com/odoo/odoo/blob/12.0/addons/sale_stock/views/sale_order_views.xml ). If you need specific help, I would suggest to create a separate question, so this can be answered in more detail than here in the comments.

lisa
Autor

Hi,

Thank you for the fix, by the way, there are no assertion errors.

I am concerned that odoo can't find my python file. because now I am getting the error below.

I have defined the fields in the py file, the one above.(I wish the formatting was better tho)

raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))

odoo.tools.convert.ParseError: "Error while validating constraint

Field `weekdayDay` does not exist

Marcel Trotzek

You have defined your fields with a leading uppercase character in your Python file. You should change it to "weekdayDay" instead of "WeekdayDay" (and similar for all other fields). Keep in mind that you always need to restart your Odoo instance after modifying Python files.

lisa
Autor

Bless you! Marcel,

Everything works fine, the view is visible. All that is left is checking if my code actually works.

This is a win, I had spent two months on it.

lisa
Autor

I have a different blocker. It's about creating a qweb for 'printing individual leave'. I had posted the question a while back, the answers helped but I am still stuck. If you could help me, please. I am updating my current progress on the question.

Awatar
Marcel Trotzek
Najlepsza odpowiedź

Hi,

Can you show us the __manifest__.py file of your module? Just judging from the stacktrace it sounds like you have referenced a Python file from there (e.g. in the "data" field), which should not be the case. Following e.g. the develeloper docs, you should have a file __init__.py next to your __manifest__.py like this:

# -*- coding: utf-8 -*-
from . import models

Then within your "models" folder, there would be another __init__.py file like this:

# -*- coding: utf-8 -*-
from . import shift_model
0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Survey User
odoo12
Awatar
1
kwi 26
3712
Odoo Mail Sending Limit Rozwiązane
odoo12
Awatar
Awatar
Awatar
2
gru 23
18292
(Document type: Invoice, Operation: write) - (Records: [], User: 2)
odoo12
Awatar
0
paź 23
33
Error while importing data in Odoo12: An unknown issue occurred during import (possibly lost connection, data limit exceeded or memory limits exceeded)
odoo12
Awatar
Awatar
Awatar
Awatar
3
paź 23
790
Remove duplicate record when importing data from excel to Odoo
odoo12
Awatar
Awatar
1
paź 23
569
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now