Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
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

TypeError: argument of type 'bool' is not iterable in openerp

Suscribirse

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

Se marcó esta pregunta
openerpfields_view_get
2 Respuestas
19566 Vistas
Avatar
Group ODOO

Here is the thing: I wanted to inherit the tree view(id is "view_employee_tree") of the moudle --hr: in the hr_contract module. Here is my code:

 <record id="hr_contract_hr_employee_tree" model="ir.ui.view">
                <field name="name">hr.contract.hr.employee.tree</field>
                <field name="model">hr.employee</field>
                <field name="inherit_id" ref="hr.view_employee_tree"/>
                <field name="arch" type="xml">
                    <field name="work_phone" position="after">
                        <field name="contract_ids"/>
                    </field>
                </field>
            </record>

After I update modules(hr,hr_contract),I get the error as follows:)

OpenERP Server Error Client Traceback (most recent call last): File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\controllers\main.py", line 1128, in call_kw File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\controllers\main.py", line 1120, in _call_kw File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 42, in proxy File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 30, in proxy_method File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 103, in send

Server Traceback (most recent call last): File "d:\Program Files\OpenERP 7.0-20130726-231403\Server\server\openerp\addons\web\session.py", line 89, in send File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\netsvc.py", line 292, in dispatch_rpc File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\service\web_services.py", line 626, in dispatch File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 188, in execute_kw File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 131, in wrapper File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 197, in execute File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\osv.py", line 185, in execute_cr File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\orm.py", line 2290, in fields_view_get File "D:\Program Files\OpenERP 7.0-20130726-231403\Server\server.\openerp\osv\orm.py", line 2270, in clean TypeError: argument of type 'bool' is not iterable

I have been tracking the bug for a whole day. i went to the file:\openerp\osv\orm.py,and get the codes near the line 2270:

            ir_values_obj = self.pool.get('ir.values')
            resprint = ir_values_obj.get(cr, user, 'action',
                    'client_print_multi', [(self._name, False)], False,
                    context)
            resaction = ir_values_obj.get(cr, user, 'action',
                    'client_action_multi', [(self._name, False)], False,
                    context)

            resrelate = ir_values_obj.get(cr, user, 'action',
                    'client_action_relate', [(self._name, False)], False,
                    context)

            #I added this for output
            for action in resaction:
                print 'orm debug : '
                print 'action[1]:',action[1]
                print 'action[2]',action[2]

            resaction = [clean(action) for action in resaction
                         if view_type == 'tree' or not action[2].get('multi')]
            resprint = [clean(print_) for print_ in resprint
                        if view_type == 'tree' or not print_[2].get('multi')]
            #When multi="True" set it will display only in More of the list view 
            resrelate = [clean(action) for action in resrelate
                         if (action[2].get('multi') and view_type == 'tree') or (not action[2].get('multi') and view_type == 'form')]

            for x in itertools.chain(resprint, resaction, resrelate):
                x['string'] = x['name']

And I added print code to output the var:resaction, and this is the output:

#output: orm_debug: Subordinate Hierarchy False

Excellent! It seems that the error:TypeError: argument of type 'bool' is not iterable makes sense. Subordinate Hierarchy is the name of an act_window in the file hr_view.xml:

<record id="action2" model="ir.actions.act_window">
        <field name="name">Subordinate Hierarchy</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">hr.employee</field>
        <field name="domain">[('id','in',active_ids)]</field>
        <field name="view_type">tree</field>
        <field name="view_id" ref="view_partner_tree2"/>
        <field name="view_id" ref="view_employee_tree"/>
</record>

But what is the real problem?? what did I do wrong ?

Any help is highly appreciated!! Thanks in advance!!

1
Avatar
Descartar
Avatar
Anil Kesariya
Mejor respuesta

Hello Letitgo,

What you exactly want ?

you want to add one2many field on of Contract object(hr.contract) to th Employee object (hr.employee) ?

for that you need to add this this code in your custom module.

Code in your py file....

class hr_employee(osv.osv)

    _inherit = 'hr.employee'
    _columns = { 
    'contract_ids' : fields.one2many('hr.contract', 'emp_id' string="Contracts")
   }

hr_employee()

class hr_contract(osv.osv)

    _inherit = 'hr.contract'

    _columns = { 
      'emp_id':fields.many2one('hr.employee', string="Employee"),
      }

hr_contract()

Now you can add your contracts in to employee objects. by using xpath.

This is the relationship fields scenario to add on object.

Check it will work.

Or else you need different thing tell me your exact requirement what you needed

Regards,

Anil Kesariya.

1
Avatar
Descartar
Avatar
Qutechs, Ahmed M.Elmubarak
Mejor respuesta

Hi,

you didn't want to go to the ORM, it is a python error, I thing you're trying to make a loop with not [iterable] variable , you can try this on your python

for i in True:
print 'hello'

you 'll get the same error msg ...

so you can check your .py file for something like this ...

Thanks..

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

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

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
2 beginner questions about function(fields_view_get)
v7 openerp fields_view_get
Avatar
Avatar
1
mar 15
8045
Create selection type field dynamically?
openerp
Avatar
Avatar
Avatar
2
sept 23
8463
How to hide the create button dynamical tree view in openerp ? Resuelto
openerp
Avatar
Avatar
2
mar 23
47703
ProgrammingError: can't adapt type 'dict' [SOLVED]
openerp
Avatar
Avatar
Avatar
2
dic 23
58839
How to use the audit app
openerp
Avatar
0
mar 22
3017
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 ภาษาไทย 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 totalmente integrado.

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