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

Printing different reports with a same button based on journal type.(odoo 11)

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
pythonaccount.movebuttonqweb-reportodoo11
8 Respostas
4572 Visualizações
Avatar
Abdullah

I have two reports for journal entries and i want to print a report based on the journal type. if journal type is bank then the report1 must print and if journal type is cash then report2 must print. kindly help me with the python code for implying this condition i have already made reports and button but struggling with the conditional statement. Thanks in advance  

0
Avatar
Cancelar
Avatar
Vishnu Vanneri
Melhor resposta

There will be 2 Report option available to print in Print menu if you added two reports in code.

So firstly hide this report from print option by clicking " Remove from the 'Print' menu " in report form.

Then You can add a button in journal entry form view and in button action we can define which report to be printed.

in View and PY  //

Code

2
Avatar
Cancelar
Abdullah
Autor

thanks for replying. I do have two reports in the print menu but i want odoo to check if the journal type is "Bank" then after pressing print button it print report 1 and if journal type is "Cash" print report 2. How should i write for that?

Vishnu Vanneri

Yes i got your intuition that's why i said you can remove the 2 print option from print menu and you can add a button in form view . then in py we can check the journal type. Please check the code.

Abdullah
Autor

sir m really sorry as i am bothering you again but it is giving key error "report". kindly check my code. Actually my pasted code :D

class AccountMove(models.Model):

_inherit = 'account.move'

@api.multi

def print_journal_entry(self):

self.ensure_one()

if self.journal_id.type == 'bank':

return self.env['report'].get_action(self,'bi_print_journal_entries.bank_journal_entry_report_id')

elif self.journal_id.type == 'cash':

return self.env['report'].get_action(self, 'bi_print_journal_entries.journal_entry_report_id')

else:

pass

Vishnu Vanneri

No problem, actually that was my issue So sorry. I have used code for V12 , now i have updated the code please check it.

Abdullah
Autor

Hey man! you are a life saver. Thank you soo much :) it works 100%

Vishnu Vanneri

Glad You find your Solution. Have a Great Day dude!

Avatar
danainao@hotmail.com
Melhor resposta

No problem, actually that was my issue So sorry. I have used code for V12 , now i have updated the code please check it.


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
How to live rtsp camera in Odoo
python odoo11
Avatar
Avatar
Avatar
2
jul. 24
15310
Odoo 11 : _start_new_thread(self._bootstrap, ()) RuntimeError: can't start new thread
python odoo11
Avatar
Avatar
1
jul. 21
9423
(Automated Action) Problem with write() and do for loop
python odoo11
Avatar
0
abr. 20
5835
how can i add multiple fields to invoice_vals['name_field'] =self.name_field(changing _prepare_invoice(self) in sale_order.py)? Resolvido
python odoo11
Avatar
Avatar
1
mai. 18
4153
Odoo11- Script: two classes in the same models.py
python odoo11
Avatar
0
abr. 18
4675
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