Ir al contenido
Odoo Menú
  • Inicia sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Inteligencia artificial
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de propiedades
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Comunidad
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
odoo12
1 Responder
6901 Vistas
Avatar
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
Avatar
Descartar
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.

Avatar
Marcel Trotzek
Mejor respuesta

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
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Survey User
odoo12
Avatar
1
abr 26
3717
Odoo Mail Sending Limit Resuelto
odoo12
Avatar
Avatar
Avatar
2
dic 23
18294
(Document type: Invoice, Operation: write) - (Records: [], User: 2)
odoo12
Avatar
0
oct 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
Avatar
Avatar
Avatar
Avatar
3
oct 23
790
Remove duplicate record when importing data from excel to Odoo
odoo12
Avatar
Avatar
1
oct 23
569
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

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