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

How to feeding a field with template by selecting a drop down list

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
v8dropdownlistemail_template
5181 Visualizações
Avatar
NASHMIN YEGANEH

Hello!

Actually i would try to feeding a field (the field is "note = fields.Text") with email templates, so to do this i need to a drop down field + a templates data made in email.templates module + codes to putting it in my field in custom module.
so please any one know how to do this in that way?

version is 8

Many thanks for your kindly answers friends :)

this is part of my code to help get what i meant

********************************************************

class ResLetter(models.Model):
"""A register class to log all movements regarding letters"""
_name = 'res.letter'
_description = "Log of Letter Movements"
_inherit = 'mail.thread'

number = fields.Char(
help="Auto Generated Number of letter.",
default="/")
name = fields.Text(
string='Subject',
help="Subject of letter.")
move = fields.Selection(
[('in', 'و'), ('out', 'OUT')],
help="Incoming or Outgoing Letter.",
readonly=True,
default=lambda self: self.env.context.get('move', 'in'))

state = fields.Selection(
[
('draft', 'Draft'),
('sent', 'Sent'),
('rec', 'Received'),
('rec_bad', 'Received Damage'),
('rec_ret', 'Received But Returned'),
('cancel', 'Cancelled'),
],
default='draft',
readonly=True,
copy=False,
track_visibility='onchange',
help="""
* Draft: not confirmed yet.\n
* Sent: has been sent, can't be modified anymore.\n
* Received: has arrived.\n
* Received Damage: has been received with damages.\n
* Received But Returned: has been received but returned.\n
* Cancel: has been cancelled, can't be sent anymore."""
)

date = fields.Date(
string='Letter Date',
help='The letter\'s date.',
default=fields.Date.today)
snd_date = fields.Date(
string='Sent Date',
help='The date the letter was sent.')
rec_date = fields.Date(
string='Received Date',
help='The date the letter was received.')

def default_recipient(self):
move_type = self.env.context.get('move', False)
if move_type == 'in':
return self.env.user.company_id.partner_id

def default_sender(self):
move_type = self.env.context.get('move', False)
if move_type == 'out':
return self.env.user.company_id.partner_id

recipient_partner_id = fields.Many2one(
'res.partner',
string='Recipient',
track_visibility='onchange',
# required=True, TODO: make it required in 9.0
default=default_recipient)
sender_partner_id = fields.Many2one(
'res.partner',
string='Sender',
track_visibility='onchange',
# required=True, TODO: make it required in 9.0
default=default_sender)
note = fields.Text(
string='Delivery Notes',
help='Indications for the delivery officer.')

channel_id = fields.Many2one(
'letter.channel',
string="Channel",
help='Sent / Receive Source')

category_ids = fields.Many2many(
'letter.category',
string="Tags",
help="Classification of Document.")

folder_id = fields.Many2one(
'letter.folder',
string='Folder',
help='Folder which contains letter.')

type_id = fields.Many2one(
'letter.type',
string="Type",
help="Type of Letter, Depending upon size.")

weight = fields.Float(help='Weight (in KG)')
size = fields.Char(help='Size of the package.')

track_ref = fields.Char(
string='Tracking Reference',
help="Reference Number used for Tracking.")
orig_ref = fields.Char(
string='Original Reference',
help="Reference Number at Origin.")
expeditor_ref = fields.Char(
string='Expeditor Reference',
help="Reference Number used by Expeditor.")

parent_id = fields.Many2one(
'res.letter',
string='Parent',
groups='lettermgmt.group_letter_thread')
child_line = fields.One2many(
'res.letter',
'parent_id',
string='Letter Lines',
groups='lettermgmt.group_letter_thread')

reassignment_ids = fields.One2many(
'letter.reassignment',
'letter_id',
string='Reassignment lines',
help='Reassignment users and comments',
groups='lettermgmt.group_letter_reasignment')

# This field seems to be unused. TODO: Remove it?
extern_partner_ids = fields.Many2many(
'res.partner',
string='Recipients')

@api.model
def create(self, vals):
if ('number' not in vals) or (vals.get('number') in ('/', False)):
sequence = self.env['ir.sequence']
move_type = vals.get('move', self.env.context.get(
'default_move', self.env.context.get('move', 'in')))
vals['number'] = sequence.get('%s.letter' % move_type)
return super(ResLetter, self).create(vals)

@api.one
def action_cancel(self):
""" Put the state of the letter into Cancelled """
self.write({'state': 'cancel'})
return True

@api.one
def action_cancel_draft(self):
""" Go from cancelled state to draf state """
self.write({'state': 'draft'})
return True

@api.one
def action_send(self):
""" Put the state of the letter into sent """
self.write({
'state': 'sent',
'snd_date': self.snd_date or fields.Date.today()
})
return True

@api.one
def action_received(self):
""" Put the state of the letter into Received """
self.write({
'state': 'rec',
'rec_date': self.rec_date or fields.Date.today()
})
return True

@api.one
def action_rec_ret(self):
""" Put the state of the letter into Received but Returned """
self.write({
'state': 'rec_ret',
'rec_date': self.rec_date or fields.Date.today()
})
return True

@api.one
def action_rec_bad(self):
""" Put the state of the letter into Received but Damaged """
self.write({
'state': 'rec_bad',
'rec_date': self.rec_date or fields.Date.today()
})
return True
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 call email templates with a custom module Resolvido
v8 email_template selectable
Avatar
Avatar
Avatar
Avatar
4
nov. 19
14603
Email template is failed to render ? [SOLVED] Resolvido
v8 sale.order email_template
Avatar
Avatar
Avatar
Avatar
4
jan. 19
33082
is it possible to use QWeb template when define a email template?
v8 qweb email_template
Avatar
Avatar
1
set. 16
4634
Default Outgoing server can't be recognize while using email templates in Odoo V8.
v8 email_template outgoing_server
Avatar
0
mar. 15
4462
How to send Partner Mass Mail to partner and parters contacts, v8. Resolvido
mail v8 emailtemplate email_template
Avatar
Avatar
Avatar
Avatar
4
jun. 18
10925
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