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
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    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

How to restrict dragging of kanban stages?

Abonare

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

Această întrebare a fost marcată
stageskanbankanban_state
7 Răspunsuri
29173 Vizualizări
Imagine profil
Deborah Joy Adeva

For example:

the officer can only drag from

Draft > Confirmed

and the manager can drag from

Confirmed > Approved or Rejected


If they are not permitted to for the stages they can't drag any data from one stage to another.

Is there a way for this?

3
Imagine profil
Abandonează
Imagine profil
Niyas Raphy (Walnut Software Solutions)
Cel mai bun răspuns

Hi,

To Restrict drag and drop in the kanban view in Odoo10, 11 and 12, you can use this free module from the store: https://apps.odoo.com/apps/modules/11.0/kanban_draggable/


To disable drag drop record between columns add:
    disable_drag_drop_record="true" into the <kanban> tag.

To disable drag drop and sorting records add :
    disable_sort_record="true" into the <kanban> tag.

To disable sorting columns add :
    disable_sort_column="true" into the <kanban> tag.

Example:
    <kanban disable_sort_column='true' disable_sort_record='true' disable_drag_drop_record='true'>
    ...
    ...
    </kanban>


From odoo13, we have an option by default to do this. Set records_draggable to False.

``records_draggable``
whether it should be possible to drag records when kanban is grouped. Default: true.


See the Video Explaining the same:  How to Disable Drag and Drop in Odoo Kanban View

Thanks

3
Imagine profil
Abandonează
Imagine profil
Bréndou Serge Eric
Cel mai bun răspuns

Hello! Here is an example for the case your stage field is a Selection with this values [('draft','Draft'), ('confirm','Confirmed'), ('approved','Approved'),('rejected','Rejected')]:

@api.multi
def write(self, values):
if 'state' in values:
        previous_state = self.state
        new_state = values.get('state')
if (new_state in ['approved','rejected']) and (not self.env.user.has_group('your_module.your_group_xml_id')):
            raise ValidationError(_("Only Managers can perform that move !"))
#elif some other_conditions:
            #some other logics
return super(YOUR CLASS, self).write(values)
for stages of type Many2one, you would need to use the ids for comparison. eg:
current_stage = self.stage_id
new_stage_id = values.get('stage_id')
if new_stage_id == self.env.ref('your_module.xml_id_of_your_stage').id:
     raise UserError(_('Message here'))

1
Imagine profil
Abandonează
Imagine profil
Chris TRINGHAM
Cel mai bun răspuns

It's also possible with Automated Actions, as explained here (this is a more complex example with validation, but it could be simplified):

This example has a “Financial Viability” check and a “Legal Approval” check that are mandatory before the Lead / Opportunity can be moved to one of the later stages.

Start by creating an Automated Action:

Python Code

# Require Financial Viability
if record.stage_id.name in ['Qualified', 'Proposition', 'Won'] and not record.x_studio_financial_viability:
    raise Warning('Please check Financial Viability for this Opportunity!')

# Require Legal Approval
if record.stage_id.name in ['Proposition', 'Won'] and not record.x_studio_legal_approval:
    raise Warning('Please check Legal Approval for this Opportunity!')

Odoo 14

Note that the syntax is slightly different in Odoo 14

raise UserError('Please check Legal Approval for this Opportunity!')

Results

Set the “Financial Viability” as checked, and stage can be changed:

 

Validation is done when the stage is changed in the Kanban view (as above).

It’s also done in the Form View:

The check will be done everywhere and cannot be overridden. 

1
Imagine profil
Abandonează
Imagine profil
Avinash Nk
Cel mai bun răspuns

Hi,

You can check that in the write function of the model. and raise an error.

for eg:

@api.multi
def write(self, values):
if (YOUR CONDITION):
            raise ValidationError(_("You can't perform that move !"))
return super(YOUR CLASS, self).write(values)

Thank you.

0
Imagine profil
Abandonează
Deborah Joy Adeva
Autor

can you give me an example of condition to put. I don't know how to start. thank you in advance

Niyas Raphy (Walnut Software Solutions)

check this module : https://www.odoo.com/apps/modules/10.0/crm_drag_back_permission/

Imagine profil
Rachid
Cel mai bun răspuns

you can stop that by modifying the attribute of stage_id for example

   


<field name="stage_id" position="attributes">
<attribute name="readonly">True</attribute>
</field>
0
Imagine profil
Abandonează
Imagine profil
Pedro Vagner
Cel mai bun răspuns

What about:

<field name="stage" attrs="{'readonly': [('group_ids','in',[g.id for g in user.groups_id])]}"/> 
0
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
How to give user permission in kanban stages
stages kanban kanban_state
Imagine profil
Imagine profil
1
dec. 17
6545
How to give a group of users access to create and edit kanban stages in odoo?
stages kanban
Imagine profil
Imagine profil
2
iul. 24
2491
Move through the stages of kanban
stages kanban
Imagine profil
Imagine profil
1
ian. 24
2452
Conditionally hide kanban stage based on view
kanban kanban_state
Imagine profil
Imagine profil
3
apr. 20
7223
Limit kanban box Rezolvat
kanban limit kanban_state
Imagine profil
Imagine profil
Imagine profil
2
sept. 25
567
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