Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consulting
    • Accounting Firm
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Solar Energy Systems
    • Shoe Maker
    • Serveis de neteja
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Open record in new tab

Subscriure's

Get notified when there's activity on this post

This question has been flagged
viewsviewnewtab
6 Respostes
28295 Vistes
Avatar
Lucio

When checking a tree view I want to be able to double click in a record and open the form view in a new tab.

Let's assume my model is something like:

class new_model(osv.osv):
    _name= model.name
    ...
new_model()

I tried this but it is not working!

<record id="action_view_model_new_tab" model="ir.actions.act_window">
  <field name="name">Open New Tab</field>
  <field name="type>ir.actions.act_window</field>
  <field name="res_model>model.name</field>
  <field name="view_type">form</field>
  <field name="view_mode">tree,form</field>
</record>
<record id="ir_open_model_new_tab" model="ir.values">
  <field name="key2">tree_but_open</field>
  <field name="model">model.name</field>
  <field name="name">Open in New Tab</field>
  <field name="value" eval="'ir.actions.act_window,+str(ref(action_view_model_new_tab))/>
  <field name="object>True</field>
</record>

ADDED INFO:

I also tried doing this:

<record id="action_view_model_tree" model="ir.actions.act_window">
  <field name="name">Open Tree View</field>
  <field name="type>ir.actions.act_window</field>
  <field name="res_model>model.name</field>
  <field name="view_type">form</field>
  <field name="view_mode">tree</field>
</record>
<record id="action_view_model_new_tab" model="ir.actions.act_window">
  <field name="name">Open New Tab</field>
  <field name="type>ir.actions.act_window</field>
  <field name="res_model>model.name</field>
  <field name="view_type">form</field>
  <field name="view_mode">form</field>
  <field name="target">new</field>
</record>
<record id="ir_open_model_new_tab" model="ir.values">
  <field name="key2">tree_but_open</field>
  <field name="model">model.name</field>
  <field name="name">Open in New Tab</field>
  <field name="value" eval="'ir.actions.act_window,+str(ref(action_view_model_new_tab))/>
  <field name="object>True</field>
</record>

Assuming that there is a way to open the tree view (e.g. a menu item or something else). But doing this, has the effect that the double click causes a refresh of the tree view and nothing else. And also, the form button is not clickable.

1
Avatar
Descartar
Cyril Gaspard (GEM)

Hi, thanks for th vote and edited answer for url, but now I have a bug on my rights to mark my answer as correct, see : http://help.openerp.com/question/4051/bug-on-this-forum-right-lost-for-function-mark-after-moderation-of-a-user-answer/

Avatar
Ray Carnes
Best Answer

Create a button that calls an action like this (v10):


WWW = the model/document you want to open

XXX = the menu you want to call

YYY = the action that you want to call

ZZZ = the human readable name of the model/document


Hint: Check the URL that is shown when you open the model/document in the existing tab to see the values for XXX, YYY and ZZZ.


@api.multi

        def action_open_new_tab(self):
                for rec in self:
                        base_url = self.env['ir.config_parameter'].get_param('web.base.url')
                        record_url = base_url + "/web#id=" + str(self.id) + "&view_type=form&model=WWW&menu_id=XXX&action=YYY"
                client_action = {
                        'type': 'ir.actions.act_url',
                        'name': "ZZZ",
                        'target': 'new',
                        'url': record_url,
                }
                return client_action
2
Avatar
Descartar
Avatar
Cyril Gaspard (GEM)
Best Answer

Hi,

in an action definition, target set to new open the view in a new window :

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

but this is for the action which dispaly the view tree or form.

I think you should add a button in tree line which will open a new window using a function.

you have an example here which open an url but to modify naturally (add the beginning of url h t t p : / /, I can't add actually link url because I have not enaugh Karma):

http://forum.openerp.com/forum/topic29798.html

Bye

3
Avatar
Descartar
Lucio
Autor

Thank for your answer. I am aware of the use of target>new. Moreover, I tried doing what I added to my question but it does not work either! It seems then, that it is not possible to do what I want? Open with the double click a new window/tab? I do not like adding a button to the view just for this! Anyway, thanks again for the answer!

Cyril Gaspard (GEM)

Hi, I think to do what you want you should be obliged to create a new type of tree view in web module ..., or try to overwrite action which open the form, but I don't no where. If somebody knows ... Bye

Avatar
Kevin McMenamin
Best Answer

just found this - sort of works

in the action code, set "target": "_blank"

It opens the action in a normal odoo window and leaves the source record in the breadcrumb trail

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
OpenERP 7 - Custom view for a especific user not working
views view
Avatar
1
de juny 21
4556
Wrong object when creating a dynamic view in OpenERP
views fields view
Avatar
Avatar
2
de set. 23
9232
Is it possible to redirect user an external url & open view at the same function ?
views view return
Avatar
0
d’abr. 20
4773
Display eternal duration in Gantt view (f. e. without end date)
views xml view
Avatar
0
de març 15
2597
Create a notice/tutorial for first time users in custom module?
views view notifications
Avatar
Avatar
Avatar
Avatar
3
de març 15
8317
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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