Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Can we give sequence to action?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
viewsactions
3 Răspunsuri
6852 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Sahar Dagher

You can add sequence to server action :)

Imagine profil
Ana Zurabashvili
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Ashish Hirpara
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
[10] Action menu item in form/tree view only Rezolvat
views actions 10
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
mar. 24
16055
How to get relation fields M2O list option "Search more..." popup with button?
views actions v14
Imagine profil
0
mai 21
3046
Error to render custom views from menu Rezolvat
views actions Odoo13.0
Imagine profil
Imagine profil
2
sept. 20
4030
next/prev on form view by ir.actions.act_window [odoo 12]
views domain actions
Imagine profil
Imagine profil
1
ian. 20
5102
Unable to display CogMenuItem only in specific views
javascript views actions odoo 17
Imagine profil
0
apr. 25
1532
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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