Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to restrict dragging of kanban stages?

Odebírat

Get notified when there's activity on this post

This question has been flagged
stageskanbankanban_state
7 Odpovědi
29191 Zobrazení
Avatar
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
Avatar
Zrušit
Avatar
Niyas Raphy (Walnut Software Solutions)
Nejlepší odpověď

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
Avatar
Zrušit
Avatar
Bréndou Serge Eric
Nejlepší odpověď

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
Avatar
Zrušit
Avatar
Chris TRINGHAM
Nejlepší odpověď

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
Avatar
Zrušit
Avatar
Avinash Nk
Nejlepší odpověď

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
Avatar
Zrušit
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/

Avatar
Pedro Vagner
Nejlepší odpověď

What about:

<field name="stage" attrs="{'readonly': [('group_ids','in',[g.id for g in user.groups_id])]}"/> 
0
Avatar
Zrušit
Avatar
Rachid
Nejlepší odpověď

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
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to give user permission in kanban stages
stages kanban kanban_state
Avatar
Avatar
1
pro 17
6554
How to give a group of users access to create and edit kanban stages in odoo?
stages kanban
Avatar
Avatar
2
čvc 24
2498
Move through the stages of kanban
stages kanban
Avatar
Avatar
1
led 24
2461
Conditionally hide kanban stage based on view
kanban kanban_state
Avatar
Avatar
3
dub 20
7235
Limit kanban box Vyřešeno
kanban limit kanban_state
Avatar
Avatar
Avatar
2
zář 25
571
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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