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 we give sequence to action?

Inscrever

Seja notificado quando houver atividade nesta publicação

Esta pergunta foi sinalizada
viewsactions
3 Respostas
6866 Visualizações
Avatar
Yagami

Want to put "Delete" action in the last, is there any way to do it?
I tried sequence=1, action is report one,

Not working in my report action, throwing error:
ValueError: Invalid field 'sequence' on model 'ir.actions.report'

See the image: https://imgur.com/a/NXAtFgt


(If image link is blocked by forum because of my karma, kindly paste it in new tab)


2
Avatar
Cancelar
Sahar Dagher

You can add sequence to server action :)

Avatar
Ana Zurabashvili
Melhor resposta

Hey,
I have almost the same answer, but if you need to rewrite already existing reports order / add new ones here is few steps.
1. add sequence int field in 'ir.actions.report' model
2. override get_bindings function in 'ir.actions.actions' model, to order by sequences: 

class IrActions(models.Model):
    _inherit = 'ir.actions.actions'

    @api.model
    def get_bindings(self, model_name):
        result = super(IrActions, self).get_bindings(model_name)
        if result.get('report'):
            result['report'] = sorted(result.get('report'),
                                      key=lambda x: x['sequence'])
        return result

3. after implementing this function the only thing is to do is to add sequence values to the report, add sequence field in 'ir.actions.report' model and set sequence for each report object ( which you need). Ofc you can use already existing reports by using its id


Hope will help :) 

0
Avatar
Cancelar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Melhor resposta

Hi,

Yes it is possible to add sequence to the custom server action created.Please refer

<record id="action_set_export_contacts" model="ir.actions.server">


    <field name="name">Export Contact to Google Connector</field>


    <field name="model_id" ref="model_res_partner"/>


    <field name="binding_model_id" ref="base.model_res_partner"/>


    <field name="sequence">4</field>


    <field name="state">code</field>


    <field name="code">


            action = model.action_export_contacts()


    </field>


</record>


Regards

0
Avatar
Cancelar
Avatar
Ashish Hirpara
Melhor resposta

To change the order of actions on a form, you can use the sequence field. However, the sequence field is not available on the ir.actions.report model, which is the model for report actions.

As a workaround, you can try to create a new action that inherits from the ir.actions.report model and adds the sequence field. You can then use this new action for your reports and set the sequence value to control the order of the actions.

Here is an example of how you can do this:

  1. Create a new model that inherits from ir.actions.report and adds the sequence field:
class ReportAction(models.Model):
    _inherit = 'ir.actions.report'

    sequence = fields.Integer()
  1. Update the ir.actions.act_window model to use the new ReportAction model instead of the default ir.actions.report model:
class ActWindow(models.Model):
    _inherit = 'ir.actions.act_window'

    report_id = fields.Many2one('report.action', 'Report')
  1. When creating a new report action, use the ReportAction model instead of the ir.actions.report model and set the sequence value to control the order of the actions:
ReportAction.create({
    'name': 'My Report',
    'model': 'my.model',
    'report_type': 'qweb-pdf',
    'sequence': 1,
})

This should allow you to control the order of the actions on the form using the sequence field.

-3
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
[10] Action menu item in form/tree view only Resolvido
views actions 10
Avatar
Avatar
Avatar
Avatar
Avatar
4
mar. 24
16063
How to get relation fields M2O list option "Search more..." popup with button?
views actions v14
Avatar
0
mai. 21
3057
Error to render custom views from menu Resolvido
views actions Odoo13.0
Avatar
Avatar
2
set. 20
4030
next/prev on form view by ir.actions.act_window [odoo 12]
views domain actions
Avatar
Avatar
1
jan. 20
5124
Unable to display CogMenuItem only in specific views
javascript views actions odoo 17
Avatar
0
abr. 25
1547
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