Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Can we give sequence to action?

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
viewsactions
3 Réponses
6792 Vues
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
Ignorer
Sahar Dagher

You can add sequence to server action :)

Avatar
Ana Zurabashvili
Meilleure réponse

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
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

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
Ignorer
Avatar
Ashish Hirpara
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
[10] Action menu item in form/tree view only Résolu
views actions 10
Avatar
Avatar
Avatar
Avatar
Avatar
4
mars 24
15983
How to get relation fields M2O list option "Search more..." popup with button?
views actions v14
Avatar
0
mai 21
3013
Error to render custom views from menu Résolu
views actions Odoo13.0
Avatar
Avatar
2
sept. 20
4030
next/prev on form view by ir.actions.act_window [odoo 12]
views domain actions
Avatar
Avatar
1
janv. 20
5041
Unable to display CogMenuItem only in specific views
javascript views actions odoo 17
Avatar
0
avr. 25
1474
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

Website made with

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