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
    Restauration & Hôtellerie
    • 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
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Bricoleur
    • Matériel informatique & 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
    Parcourir toutes les 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 pour partenaires
    • 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

How to open a pop-up with a fields.text inside?

S'inscrire

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

Cette question a été signalée
textpopup
2 Réponses
7538 Vues
Avatar
Yannick Gerard

hello, here's my problem.

I installed hr_holidays module to manage employee's leaves and, what i want to do now is, when a leave is refused, open a pop-up where we can write why we refused that leave, then we have choices :continue or cancel.

I overrode the official hr_holidays.py to add my text field : 'refusal_explanation': fields.text('Refusal explanation') but i don't know how to use it afterwards.

Hope you can help me,


0
Avatar
Ignorer
Avatar
ankita
Meilleure réponse

Hello  Yannick ,

You need to create wizard for the solution this problem and create method in it. like

Python Code -

from openerp.osv import fields, osv

from openerp.tools.translate import _

class refuse_leave(osv.osv_memory):

_name = "refuse.leave"

_description = "Leave Refused"

_columns = {

'refusal_explanation': fields.text('Refusal explanation', required=True)

}

def refuse_leave(self, cr, uid, ids, context=None):

abc_obj = self.pool.get('hr.holiday')

record_id = context.get('active_id')

data = self.read(cr,uid,ids)[0]

print data

xyz = data['refusal_explanation']

print abc_obj.write(cr,uid,[record_id], {'refusal_explanation':xyz,'state':'refuse'})

abc_obj.write(cr,uid,[record_id], {'refusal_explanation':xyz,'state':'refuse'})

return True

refuse_leave()

Xml code -

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<record id="view_refuse_leave" model="ir.ui.view">

<field name="name">Leave Refuse</field>

<field name="model">refuse.leave</field>

<field name="arch" type="xml">

<form string="Refuse_Leave" version="7.0">

<group col="4">

<field name="refusal_explanation"/>

</group>

<footer>

<button string="Refused" type="object" name="refuse_leave" />

<button string="Cancel" class="oe_link" special="cancel"/>

</footer>

</form>

</field>

</record>

<record id="action_view_refuse_leave" model="ir.actions.act_window">

<field name="name">Leave Refuse</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">refuse.leave</field>

<field name="view_type">form</field>

<field name="view_mode">form</field>

<field name="target">new</field>

</record>

</data>

</openerp>

Hope it helps


0
Avatar
Ignorer
Avatar
Yannick Gerard
Auteur Meilleure réponse

Thanks, but I dont know how to link my button to your code :s

I guess i have to add/change an attribute to it but which one?

And my button is a workflow type, not Action, is it a problem ?

here's my button :

<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>


EDIT// here's the new button i'm talking about in my com below : <button attrs="{'invisible':[('state', 'in', ['draft', 'refuse'])] }" class="oe_highlight" groups="cesbron_hr13.group_holidays_validate" icon="gtk-apply" name="%(action_view_refuse_leave)d" string="Motif de refus" type="action"/>

0
Avatar
Ignorer
Yannick Gerard
Auteur

Ok so here some news ... we can't link a wizard to a workflow button, so I create an other button to fill my field with the wizard, and then, user have to clic and my worflow button. here's my new button: the name is the link to the wizard.

Yannick Gerard
Auteur
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é
How to make pop ups after actions? Résolu
popup
Avatar
Avatar
Avatar
2
juil. 25
10022
Translate pop up in Odoo 14
popup
Avatar
0
nov. 23
2138
Edit Time Off Popup from dashboard
popup
Avatar
Avatar
1
sept. 23
3115
Amount to text
text
Avatar
Avatar
Avatar
2
mai 23
3238
automatic popup newsletter in odoo website
popup
Avatar
Avatar
1
juil. 22
1125
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