Skip to Content
Odoo Menu
  • Sign in
  • Teste-o gratuitamente
  • Aplicações
    Finanças
    • Contabilidade
    • Faturação
    • Despesas
    • Folha de cálculo (BI)
    • Documentos
    • Assinatura eletrónica
    Vendas
    • CRM
    • Vendas
    • POS para lojas
    • POS para restaurantes
    • Subscrições
    • Aluguer
    Sites
    • Criador de Sites
    • Comércio eletrónico
    • Blogue
    • Fórum
    • Chat em direto
    • e-Learning
    Cadeia de abastecimento
    • Inventário
    • Produção
    • PLM
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Colaboradores
    • Recrutamento
    • Ausências
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Marketing social
    • Marketing por e-mail
    • Marketing através de SMS
    • Eventos
    • Automação de Marketing
    • Inquéritos
    Serviços
    • Projeto
    • Registos de Horas
    • Assistência no local
    • Assistência
    • Planeamento
    • Agendamentos
    Produtividade
    • Conversas
    • Inteligência artificial
    • IoT
    • VoIP
    • Informação
    • WhatsApp
    Aplicações de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Retalho
    • Livraria
    • Loja de roupa
    • Loja de móveis
    • Mercearia
    • Loja de ferragens
    • Loja de brinquedos
    Alimentação e hotelaria
    • Bar e pub
    • Restaurante
    • Comida rápida
    • Casa de hóspedes
    • Distribuidor de bebidas
    • Hotel
    Imobiliário
    • Agência imobiliária
    • Gabinete de arquitectura
    • Construção
    • Gestão imobiliária
    • Jardinagem
    • Associação de proprietários
    Consultoria
    • Gabinete de contabilidade
    • Parceiro da Odoo
    • Agência de marketing
    • Sociedade de advogados
    • Aquisição de talentos
    • Auditoria e certificação
    Produção
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Brindes promocionais
    Saúde e bem-estar
    • Clube desportivo
    • Ótica
    • Ginásio
    • Profissionais de bem-estar
    • Farmácia
    • Cabeleireiro
    Ofícios
    • Handyman
    • Hardware e suporte técnico
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência do ambiente
    • Aluguer de painéis publicitários
    • Estúdio de fotografia
    • Aluguer de bicicletas
    • Revendedor de software
    Explorar todos os setores
  • Comunidade
    Aprender
    • Tutoriais
    • Documentação
    • Certificações
    • Treino
    • Blogue
    • Podcast
    Capacitar a educação
    • Programa de formação
    • Scale Up! O jogo de negócios
    • Visite a Odoo
    Obter o software
    • Transferir
    • Comparar Edições
    • Versões
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Registe a sua empresa contabilística
    • Programa de afiliados
    Obter serviços
    • Encontre um parceiro
    • Encontre um contabilista
    • Contacte um consultor
    • Serviços de implementação
    • Referências de clientes
    • Apoio
    • Atualizações
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar uma demonstração
  • Preços
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Attribute Error when calling fields_view_get

Subscribe

Get notified when there's activity on this post

This question has been flagged
python
2 Replies
6403 Views
Avatar
arsalan

Hi all, i am stuck in weird problem. i am trying to open my form view in button click event using

res = super(deg_form,self).fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)

but on clicking button i get

Server Traceback (most recent call last):
  File "/home/arsalan/openerp-7.0/openerp/addons/web/session.py", line 90, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/arsalan/openerp-7.0/openerp/netsvc.py", line 295, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/arsalan/openerp-7.0/openerp/service/web_services.py", line 614, in dispatch
    res = fn(db, uid, *params)
  File "/home/arsalan/openerp-7.0/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/arsalan/openerp-7.0/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/arsalan/openerp-7.0/openerp/osv/osv.py", line 198, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/arsalan/openerp-7.0/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/arsalan/openerp-7.0/openerp/addons/system/myform.py", line 131, in update_column
    res = super(deg_form,self).fields_view_get(cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
  File "/home/arsalan/openerp-7.0/openerp/osv/orm.py", line 2260, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/home/arsalan/openerp-7.0/openerp/osv/orm.py", line 1912, in __view_look_dom_arch
    fields = self.fields_get(cr, user, None, context)
  File "/home/arsalan/openerp-7.0/openerp/osv/orm.py", line 3511, in fields_get
    (field.groups and not self.user_has_groups(cr, user, groups=field.groups, context=context)):
AttributeError: 'unicode' object has no attribute 'groups'

Plz let me know what i am doing wrong here.

Thanks

Edit

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): 
       res = super(deg_form,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) 
       objn = self.pool.get('deg.form').browse(cr, uid, id) 
       if view_type=='form':
              str_fields=str(res['fields']) 
              str_fields=str_fields[:len(str_fields)-1]+ ", 'father_name' :{'selectable': True, 'views': {},'type':'char', 'string': 'father Name', 'store': True,'size': 128}}"
               res['fields']=eval(str_fields)
               temp_arch="""<field name="father">"""
0
Avatar
Discard
Prakash

can u post your fields_view_get full code?..

arsalan
Author

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): res = super(deg_form,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) objn = self.pool.get('deg.form').browse(cr, uid, id) if view_type=='form': str_fields=str(res['fields']) str_fields=str_fields[:len(str_fields)-1]+ ", 'father_name' :{'selectable': True, 'views': {},'type':'char', 'string': 'ather Name', 'store': True,'size': 128}}" res['fields']=eval(str_fields) temp_arch="""<field name="father

Avatar
Serpent Consulting Services Pvt. Ltd.
Best Answer

I sense the problem is with your variables used!

0
Avatar
Discard
Avatar
Prakash
Best Answer

In fields_view_get method Super class will at the end of the line.

Example, Refer the code in addons/stock/stock.py

def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
        if view_type == 'form' and not view_id:
            mod_obj = self.pool.get('ir.model.data')
       # Add Logic and finally return super class
        return super(class_name, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Display BOM version in Purchase order(for subcontracting) or in LOT/SN page
python
Avatar
0
jul. 26
10
new python env
python
Avatar
0
mar. 25
5719
What means "Too many values to unpack" message? Solved
python
Avatar
Avatar
Avatar
Avatar
Avatar
4
abr. 24
179850
have no data in screen. read data in my own module from different model
python
Avatar
0
dez. 23
5230
How to insert value to a one2many field in table with create method? Solved
python
Avatar
Avatar
Avatar
Avatar
Avatar
5
jul. 25
238179
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Código aberto
  • Transferir
  • Github
  • Runbot
  • Traduções
Serviços
  • Alojamento Odoo.sh
  • Apoio
  • Atualizar Versão
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um contabilista
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • A Nossa Empresa
  • Ativos da marca
  • Contacte-nos
  • Trabalhos
  • Eventos
  • Podcast
  • Blogue
  • Clientes
  • Legal • Privacidade
  • Segurança
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) Português română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

O Odoo é um conjunto de aplicações empresariais de código aberto que abrange todas as necessidades da sua empresa: CRM, comércio eletrónico, contabilidade, gestão de inventário, ponto de venda, gestão de projetos, etc.

A proposta de valor única do Odoo é ser, ao mesmo tempo, muito fácil de utilizar e 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