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
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • 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
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • 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

Workflows status bar doesn't show colors and states

S'inscrire

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

Cette question a été signalée
workflows
1 Répondre
9578 Vues
Avatar
Shabeeh Kazmi

Hi folks

i'm working on OpenERP workflows. All flows are working fine except status bar widget doesnt show states and doesnt reflect colors that i have writen in view. Can anyone help me out please?

<!---- My class-->

class workflow_example2(osv.osv):
    def mymod_new(self, cr, uid, ids):
        self.write(cr, uid, ids, { 'state' : 'new' })
        return True

    def mymod_assigned(self, cr, uid, ids):
        self.write(cr, uid, ids, { 'state' : 'assigned' })
        return True
    
    def mymod_negotiation(self, cr, uid, ids):
        self.write(cr, uid, ids, { 'state' : 'negotiation' })
        return True
    
    def mymod_won(self, cr, uid, ids):
        self.write(cr, uid, ids, { 'state' : 'won' })
        return True
    
    def mymod_lost(self, cr, uid, ids):
        self.write(cr, uid, ids, { 'state' : 'lost' })
        return True

    _name = 'workflow.example2'
    _columns = {
        'abc':fields.char('abc', size=20),
       'state': fields.selection([
        ('new','New'),
        ('assigned','Assigned'),
        ('negotiation','Negotiation'),
        ('won','Won'),
        ('lost','Lost')], 'Stage', readonly=True, track_visibility='onchange'),
        'field_1': fields.char('Field_1', size=20),
        'field_2': fields.char('Field_2', size=16),        
    }
   
workflow_example2()


<!Workflow xlm>

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record model="workflow" id="wkf_mymod2">
            <field name="name">workflow.wkf</field>
            <field name="osv">workflow.example2</field>
            <field name="on_create">True</field>
        </record>
        
        <record model="workflow.activity" id="act_new">
            <field name="wkf_id" ref="wkf_mymod2" />
            <field name="flow_start">True</field>
            <field name="name">new</field>
            <field name="kind">function</field>
            <field name="action">mymod_new()</field>
        </record>

        <record model="workflow.activity" id="act_assigned">
            <field name="wkf_id" ref="wkf_mymod2" />
            <field name="name">assigned</field>
            <field name="kind">function</field>
            <field name="action">mymod_assigned()</field>
        </record>

        <record model="workflow.activity" id="act_negotiation">
            <field name="wkf_id" ref="wkf_mymod2" />
            <field name="name">negotiation</field>
            <field name="kind">function</field>
            <field name="action">mymod_negotiation()</field>
        </record>

        <record model="workflow.activity" id="act_won">
            <field name="wkf_id" ref="wkf_mymod2" />
            <field name="name">won</field>
            <field name="kind">function</field>
            <field name="action">mymod_won()</field>    
            <field name="flow_stop">True</field>            
        </record>

        <record model="workflow.activity" id="act_lost">
            <field name="wkf_id" ref="wkf_mymod2" />
            <field name="name">lost</field>
            <field name="kind">function</field>
            <field name="action">mymod_lost()</field>
            <field name="flow_stop">True</field>
        </record>
                
        <record model="workflow.transition" id="t1">
            <field name="act_from" ref="act_new" />
            <field name="act_to" ref="act_assigned" />
            <field name="signal">mymod_assigned</field>
        </record>

        <record model="workflow.transition" id="t2">
            <field name="act_from" ref="act_assigned" />
            <field name="act_to" ref="act_negotiation" />
            <field name="signal">mymod_negotiation</field>
        </record>

        <record model="workflow.transition" id="t3">
            <field name="act_from" ref="act_negotiation" />
            <field name="act_to" ref="act_won" />
            <field name="signal">mymod_won</field>
        </record>

        <record model="workflow.transition" id="t4">
            <field name="act_from" ref="act_negotiation" />
            <field name="act_to" ref="act_lost" />
            <field name="signal">mymod_lost</field>
        </record>
        
    </data>
</openerp>

 

<!View>
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <record id="view_wf_example_form2" model="ir.ui.view">
            <field name="name">workflow.example.form</field>
            <field name="model">workflow.example2</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Workflow Example" version="7.0">
                <header>
                        <button name="mymod_assigned" string="New" class="oe_highlight oe_view_mode_only"  states="new" />
                        <button name="mymod_negotiation" string="In negotiation" class="oe_highlight oe_view_mode_only"  states="assigned" />
                        <button name="mymod_won" string="won" states="negotiation" class="oe_highlight oe_view_mode_only"  />
                        <button name="mymod_lost" string="lost" states="negotiation" class="oe_highlight oe_view_mode_only"  />
                        <label string="Draft Invoice" attrs="{'invisible': ['|',('status','&lt;&gt;','new')]}"/>                        
                        <field name="status" widget="statusbar" statusbar_visible="new,assigned,negotiation" statusbar_colors='{"new":"blue","assigned":"blue"}'/>
                        <field name="status" invisible="1"/>                        
                </header>
                <sheet string ="Workflow">
                    <group col="2" colspan="0">    
                        <field name="field_1"/>
                        <field name="field_2"/>                        
                    </group>                   
                </sheet>
                <div class="oe_chatter">
                    <div>
                        <H2>
                        <label string="History and Comments"/>                
                        </H2>
                    </div>
                </div>
                </form>
            </field>
        </record>
        
        <record id="view_wf_example_tree" model="ir.ui.view">
            <field name="name">workflow.example.tree</field>
            <field name="model">workflow.example2</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Workflow Example">
                        <field name="field_1"/>
                </tree>
            </field>
        </record>
        
        <!-- ACTIONS -->
        <record id="act_wf_form" model="ir.actions.act_window">
            <field name="name">Form workflow</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">workflow.example2</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="view_id" ref="view_wf_example_form2"/>
        </record>
        <!--  MENUITEM -->
        <menuitem name="workflow" action="act_wf_form" id="menu_wf_form" sequence="1" />
        
    </data>
</openerp>

 

regards
polaris.

 

0
Avatar
Ignorer
Avatar
dirk
Meilleure réponse

Your field name must be state and not status in:

<field name="status" widget="statusbar" statusbar_visible="new,assigned,negotiation" statusbar_colors='{"new":"blue","assigned":"blue"}'/>
                        <field name="status" invisible="1"/>   

1
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é
workflow of modules in odoov16
workflows
Avatar
Avatar
Avatar
2
juil. 23
3758
Where can I find Odoo Workflow and User Process Résolu
workflows
Avatar
Avatar
1
févr. 23
7226
inheriting workflows
workflows
Avatar
Avatar
1
juin 15
3899
Many workflows on same record
workflows
Avatar
0
avr. 15
4108
General Workflow Application
workflows GUI
Avatar
0
juil. 22
2905
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