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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • 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 sort projects in Kanban view by name?

Odebírat

Get notified when there's activity on this post

This question has been flagged
projectkanbansortingodoo8.0
1 Odpovědět
8500 Zobrazení
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi guys,

What is the correct way to order the Kanban from projects?
The first thing I did was to add a default_order in the arch (project_view.xml) but this didn't change anything:

<record model="ir.ui.view" id="view_project_kanban">
            <field name="name">project.project.kanban</field>
            <field name="model">project.project</field>
            <field name="arch" type="xml">
                <kanban class="oe_background_grey">
                   <kanban default_order="name" />
                  //irrelevant code

               </kanban>
            </field>

Then I went into project.py and found the method _get_type_common which orders the projects in kanban view. By default its like this:

def _get_type_common(self, cr, uid, context):
        ids = self.pool.get('project.task.type').search(cr, uid, [('case_default','=',1)], context=context)
        return ids
    _order = "sequence, id"
    //irrelevant code

So I thought I'd change the _order="sequence,id" to _order="name" but the field 'name' is not in the model project.project..So I thought I'd change it to this:

_order = "type_ids.name"

But then I get the following error:

AccessError

Invalid "order" specified. A valid "order" specification is a comma-separated list of valid field names (optionally followed by asc/desc for the direction) 

So, what is the correct way to order on the name of the project in the Kanban view then?

 

Update: New code now looks like this:

class project(osv.osv):
    _name = "project.project"
    _description = "Project"
    _inherits = {'account.analytic.account': "analytic_account_id",
                 "mail.alias": "alias_id"}
    _inherit = ['mail.thread', 'ir.needaction_mixin','project.project']
    _order = 'name asc'
    name = fields.char('Account/Contract Name', required=True, track_visibility='onchange')

With kind regards,

Yenthe

0
Avatar
Zrušit
Avatar
Zbik
Nejlepší odpověď

Try this:

class project(models.Model):
    _name = "project.project"
    _inherit = ['project.project']
    _order = "name asc"

    name = fields.Char('Account/Contract Name', required=True, track_visibility='onchange')

 UPDATED:

### name = fields.Char('Account/Contract Name', required=True, track_visibility='onchange')

1
Avatar
Zrušit
Yenthe Van Ginneken (Mainframe Monkey)
Autor

Thanks for the answer zbik! I've tried this but it gives me KeyError: 'project.project'. I've updated my question with the new code.

Zbik

depends?

Zbik

PS. you inherit only _inherit = ['project.project']

Yenthe Van Ginneken (Mainframe Monkey)
Autor

Zbik I believe your example code is for in a custom module? I would like to simply replace/modify the code in the current project module. In the current module I'd need the 'mail.thread', 'ir.needaction_mixin', too.

Zbik

You inherit project.project -> project.project inherit mail.thread and ir.needaction_mixin = you inherit all

Yenthe Van Ginneken (Mainframe Monkey)
Autor

Sorry for the late reply Zbik! So I've created a new module and installed this. Everything works fine until I try to open up any of the projects. I then get a programmingError saying the column doesn't exist. As you can see here: http://i.imgur.com/YSCwmJh.png why is my Odoo throwing this up? The field does exist..

Yenthe Van Ginneken (Mainframe Monkey)
Autor

You can find the module here in case you want to test it / see whats wrong: https://github.com/Yenthe666/order_projects_by_name

Zbik

In my test system, I have oher error when create new project and when name = fields.Char() is defined (??? hmmm ???). When I comment this line and update module all works ok.

Yenthe Van Ginneken (Mainframe Monkey)
Autor

I already removed the name field Zbik, as you can see here: https://github.com/Yenthe666/order_projects_by_name/blob/master/order_projects_by_name/models.py but even then I get errors. It only happens when you open up project tasks by clicking on a project, not when showing the project overview etc.

Zbik

Strange, I do not have such a issue. Try to remove and re-install the module.

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
Kanban and calendar views disappeared from Project.task
project kanban
Avatar
0
bře 22
3697
Project Kanban Columns Vyřešeno
project kanban
Avatar
Avatar
1
pro 19
5647
Kanban - change action in project
project kanban
Avatar
Avatar
Avatar
3
pro 17
7567
how to open new form (poupup) to create new project from kanban view in odoo9
project kanban
Avatar
0
zář 17
4305
On Premise: Project Task kanban auto update doesn't work
project kanban tasks
Avatar
0
zář 25
829
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