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

Can't set default email template in sales.order (not even as a default parameter)

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
defaultparameters
4 Respostas
21127 Visualizações
Avatar
Nico Sap

I set up a default parameter to load, when i email a quotation. I see it added in my users default parameters, but it still picks nr 5 (portal template) as the default, instead of id:=4.


Any idea on how i can solve this?

0
Avatar
Cancelar
Pascal Tremblay

users default parameters? Where do you find it?

Pascal Tremblay

ok! I fave found users default parameters in Settings->Actions->User-Defined defaults Thanks

Avatar
PY
Melhor resposta

Here is a working and cleaner solution, I think.

Check out addons/portal_sale/portal_sale.py and search the function action_invoice_sent in the account_invoice class.

If the module portal_sale is installed, this function makes sure the portal version of the email.template for invoices is set dy default.

I just copy pasted this function/class in my module and changed the reference call to point towards my own version.

Hope that helps soemone.

1
Avatar
Cancelar
Raffaele

this is a more logical solution, but didn't work for me. The invoice template introduced by the portal_sale module remains the default selected. I even specified a "sequence: 90" directive in the manifest, to make sure that my custom module got loaded after the portal_sale, but nothing changed.

Avatar
Pascal Tremblay
Melhor resposta

Here is our solution to change the default mail template when we click on « send by email » in the sale order form.

  • I have changed the view sale.order.form to modify the « send by email » button. I have changed action for action_quotation_send_pt.

  • I had created a new method with a new name action_quotation_send_pt method. This method is still in the class sale_order (we inherit sale_order). This method is almost the same than the original action_quotation_send but we will change it soon.

import pdb
from openerp.osv import osv
import openerp.pooler
class sale_order(osv.osv):
    _inherit = 'sale.order'

    def action_quotation_send_pt(self, cr, uid, ids, context=None):

        assert len(ids) == 1, 'This option should only be used for a single id at a time.'
        irmodeldataaa = self.pool.get('ir.model.data')
        try:
            template_id = irmodeldataaa.get_object_reference(cr, uid, 'sale', 'email_template_edi_sale')[1]
        except ValueError:
            template_id = False
        try:
            compose_form_id = irmodeldataaa.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
        except ValueError:
            compose_form_id = False        ctx = dict()

        ctx.update({
            'default_model': 'sale.order',
            'default_res_id': ids[0],
            'default_use_template': bool(template_id),
            'default_template_id': template_id,
            'default_composition_mode': 'comment',
            'mark_so_as_sent': True
        })
        return {
            'type': 'ir.actions.act_window',
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'mail.compose.message',
            'views': [(compose_form_id, 'form')],
            'view_id': compose_form_id,
            'target': 'new',
            'context': ctx,
        }

  • We search for the ID of the mail template that we want by default. Here is 24.
  • We have changed external identifier record id in sale.email_template_edi_sale. The new record ID is now 24. The id of our default mail template that we want.

 

  • Now, you can see the new « Devis - par courriel », by default, in the « use template » field. It is great!

We are happy!

 

1
Avatar
Cancelar
Raffaele

this solved for me

Stephane Oechslin

I didn't have the external identifier. I just created as explained above and it solved my problem

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
Pass default field values in URL as a parameter Resolvido
default parameters URL v17
Avatar
Avatar
1
fev. 24
4071
Unable to Delete Company Parameter Resolvido
parameters
Avatar
Avatar
1
mai. 24
3043
Set default columns for projects in OODO
default
Avatar
Avatar
Avatar
2
jan. 23
3344
How to set a condition on default values in model ir.default Resolvido
default
Avatar
Avatar
1
ago. 22
6806
problem with default
default
Avatar
Avatar
1
jan. 19
4585
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