Pular para o conteúdo
Odoo Menu
  • Entrar
  • Experimente grátis
  • Aplicativos
    Finanças
    • Financeiro
    • Faturamento
    • Despesas
    • Planilhas (BI)
    • Documentos
    • Assinar Documentos
    Vendas
    • CRM
    • Vendas
    • PDV Loja
    • PDV Restaurantes
    • Assinaturas
    • Locação
    Websites
    • Criador de Sites
    • e-Commerce
    • Blog
    • Fórum
    • Chat ao Vivo
    • e-Learning
    Cadeia de mantimentos
    • Inventário
    • Fabricação
    • PLM - Ciclo de Vida do Produto
    • Compras
    • Manutenção
    • Qualidade
    Recursos Humanos
    • Funcionários
    • Recrutamento
    • Folgas
    • Avaliações
    • Indicações
    • Frota
    Marketing
    • Redes Sociais
    • Marketing por E-mail
    • Marketing por SMS
    • Eventos
    • Automação de Marketing
    • Pesquisas
    Serviços
    • Projeto
    • Planilhas de Horas
    • Serviço de Campo
    • Central de Ajuda
    • Planejamento
    • Compromissos
    Produtividade
    • Mensagens
    • Aprovações
    • Internet das Coisas
    • VoIP
    • Conhecimento
    • WhatsApp
    Aplicativos de terceiros Odoo Studio Plataforma Odoo Cloud
  • Setores
    Varejo
    • Loja de livros
    • Loja de roupas
    • Loja de móveis
    • Mercearia
    • Loja de ferramentas
    • Loja de brinquedos
    Comida e hospitalidade
    • Bar e Pub
    • Restaurante
    • Fast Food
    • Hospedagem
    • Distribuidor de bebidas
    • Hotel
    Imóveis
    • Imobiliária
    • Escritório de arquitetura
    • Construção
    • Administração de propriedades
    • Jardinagem
    • Associação de proprietários de imóveis
    Consultoria
    • Escritório de Contabilidade
    • Parceiro Odoo
    • Agência de marketing
    • Escritório de advocacia
    • Aquisição de talentos
    • Auditoria e Certificação
    Fabricação
    • Têxtil
    • Metal
    • Móveis
    • Alimentação
    • Cervejaria
    • Presentes corporativos
    Saúde e Boa forma
    • Clube esportivo
    • Loja de óculos
    • Academia
    • Profissionais de bem-estar
    • Farmácia
    • Salão de cabeleireiro
    Comércio
    • Handyman
    • Hardware e Suporte de TI
    • Sistemas de energia solar
    • Sapataria
    • Serviços de limpeza
    • Serviços de climatização
    Outros
    • Organização sem fins lucrativos
    • Agência Ambiental
    • Aluguel de outdoors
    • Fotografia
    • Aluguel de bicicletas
    • Revendedor de software
    Navegar por todos os setores
  • Comunidade
    Aprenda
    • Tutoriais
    • Documentação
    • Certificações
    • Treinamento
    • Blog
    • Podcast
    Empodere a Educação
    • Programa de educação
    • Scale Up! Jogo de Negócios
    • Visite a Odoo
    Obtenha o Software
    • Baixar
    • Comparar edições
    • Releases
    Colaborar
    • Github
    • Fórum
    • Eventos
    • Traduções
    • Torne-se um parceiro
    • Serviços para parceiros
    • Cadastre seu escritório contábil
    Obtenha os serviços
    • Encontre um parceiro
    • Encontre um Contador
    • Conheça um consultor
    • Serviços de Implementação
    • Referências de Clientes
    • Suporte
    • Upgrades
    Github YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Faça uma demonstração
  • Preços
  • Ajuda

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

  • CRM
  • e-Commerce
  • Financeiro
  • Inventário
  • PoS
  • Projeto
  • MRP
All apps
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
É necessário estar registrado para interagir com a comunidade.
Todas as publicações Pessoas Emblemas
Marcadores (Ver tudo)
odoo accounting v14 pos v15
Sobre este fórum
Ajuda

Odoo 8 - wizard cannot sent back editable input after submit

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
wizardodooV8odoo8.0odoo8
1 Responder
4335 Visualizações
Avatar
Salim Rahal

I'm trying to validate an editable input defined in an object with many2many relationship with a Wizard, but the new value is not received when I have one item in the list. Whereas when the list is more then one item, all new values are received in backend except the last item!

The Scenario is:

case-1: when I have ONE item in list

1- when I open the Wizard and I hit on a button (fill_product_category) it fills the list of product category in the tree view

2- insert data in the new_price (editable input)

3- hit the compute_result button

4- the updated parameter is not received in the backend, the id of the item is kept normally

5- the wizard is not refreshed with the new value for editable input (it's normal since it's not sent at first submit)

case-2: when I have MORE than one item in the list of products:

- After inserting values in the editable fields and hitting compute_result-> all updated values are received except the last item

Explanation:

-Hitting the button will build a list of product category in Backend and then assign it to the Wizard-Hitting the compute_result will call the backend function and retrieve the list of product-inside this function I iterate thru products and fetch the new_price, I need to know how to edit and submit accordingly an input in wizard

thank you,

1- The Wizard includs one2many relationship

  class wizard(models.TransientModel):

    _name = 'simulator.wizard'

    y_product_category_disc_ids = fields.many2many("category.model", "id",string="Product Category")

  class CategoryModel(models.Model):

       _name = "category.model"

        y_product = fields.Char(string="Product Cat",readonly=True)

       new_price= fields.Integer(string="New Price")

 

2- Snippet of the Wizard Data file

       <field name="y_product_category_disc_ids">

<tree string="Product Category Tree" editable="true">

<field name="y_product"/> <field name="new_price"/> </tree> </field>

<button name="fill_product_category" string="Fill product category" type="object" />

3- function that handle the button fill_product_category

@api.multi def fill_product_category(self):

    self.ensure_one()

    res_record1 = self.env["purchase.product.categorydisc"].\

   create({"y_product": p1,"new_price":0 })

  listProdIds.append(res_record1.id)

  #adding the second product can be omitted in order to add only one item to wizard

  res_record2 = self.env["purchase.product.categorydisc"].\

 create({"y_product": p2, "new_price":0})

  listProdIds.append(res_record2.id)


self.y_product_category_disc_ids = listProdIds

return {

'context': self.env.context,

'view_type': 'form',

'view_mode': 'form',

'res_model': 'simulator.wizard',

'res_id': self.id, 'view_id': False,

'type': 'ir.actions.act_window',

'target': 'new',

}

4- function that receives the new prices per items and make computation, where new_price is not received for first item

@api.multi def compute_result(self):

         self.ensure_one()

       product_category_disc_ids = self.y_product_category_disc_ids

       for prod in product_category_disc_ids:

             print("compute_result prod category={} new price={}").format(prod.y_product, prod.new_price)

  return {

   'context': self.env.context,

    'view_type': 'form',

   'view_mode': 'form',

  'res_model': 'simulator.wizard',

  'res_id': self.id, 'view_id': False,

 'type': 'ir.actions.act_window',

  'target': 'new',

  }

0
Avatar
Cancelar
Avatar
Salim Rahal
Autor Melhor resposta

My solution is to follow what is feasible in Odoo-8 framework, hence I omitted the use of a datatable within a Wizard , on the otherhand I have added the Datatable within a tab (example of a Sales order editable lines). and it works.

0
Avatar
Cancelar
Está gostando da discussão? Não fique apenas lendo, participe!

Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!

Inscreva-se
Publicações relacionadas Respostas Visualizações Atividade
Return a wizard
wizard odoo odooV8 odoo8.0 odoo8
Avatar
Avatar
1
mai. 16
8989
High Availability Odoo 8.0 on Windows
odooV8 odoo8.0 odoo8
Avatar
0
fev. 21
4508
Product received Administrator in Odoo 8 purchase module
odooV8 odoo8.0 odoo8
Avatar
0
fev. 18
3268
blockUI requires jQuery v1.2.3 or later! You are using v1.11.1 error when installing Odoo 8 on Windows 10
odooV8 odoo8.0 odoo8
Avatar
Avatar
Avatar
3
jun. 17
6630
Values are reset on save
odooV8 odoo8.0 odoo8
Avatar
0
jan. 16
4362
Comunidade
  • Tutoriais
  • Documentação
  • Fórum
Open Source
  • Baixar
  • Github
  • Runbot
  • Traduções
Serviços
  • Odoo.sh Hosting
  • Suporte
  • Upgrade
  • Desenvolvimentos personalizados
  • Educação
  • Encontre um Contador
  • Encontre um parceiro
  • Torne-se um parceiro
Sobre nós
  • Nossa empresa
  • Ativos da marca
  • Contato
  • Empregos
  • Eventos
  • Podcast
  • Blog
  • 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) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo é um conjunto de aplicativos de negócios em código aberto que cobre todas as necessidades de sua empresa: CRM, comércio eletrônico, contabilidade, estoque, ponto de venda, gerenciamento de projetos, etc.

A proposta de valor exclusiva Odoo é ser, ao mesmo tempo, muito fácil de usar e totalmente integrado.

Site feito com

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