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
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    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 open a pop-up with a fields.text inside?

Abonare

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

Această întrebare a fost marcată
textpopup
2 Răspunsuri
7525 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
ankita
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Yannick Gerard
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Yannick Gerard
Autor

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
Autor
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 make pop ups after actions? Rezolvat
popup
Imagine profil
Imagine profil
Imagine profil
2
iul. 25
9987
Translate pop up in Odoo 14
popup
Imagine profil
0
nov. 23
2136
Edit Time Off Popup from dashboard
popup
Imagine profil
Imagine profil
1
sept. 23
3112
Amount to text
text
Imagine profil
Imagine profil
Imagine profil
2
mai 23
3212
automatic popup newsletter in odoo website
popup
Imagine profil
Imagine profil
1
iul. 22
1125
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