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
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • 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
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • 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

How to change the view in a creation modal

Subscriure's

Get notified when there's activity on this post

This question has been flagged
uiview_listmodalodoo13CE
3 Respostes
6157 Vistes
Avatar
ALBRAHMS

Hi,

From the expense report form view, I can add a new expense line by clicking on "add a line". This open a search form, then I have to click on "Create"  to access to the creation form.

I want to skip the search view and show the create form when the modal open.

Is there a way to do this ?



EDIT:

I tried to add a control to the list with no success.


    <record id="view_hr_expense_sheet_form" model="ir.ui.view">
        <field name="model">hr.expense.sheet</field>
        <field name="inherit_id" ref="hr_expense.view_hr_expense_sheet_form" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='expense_line_ids']/tree" position="after">
                <control>
                    <create string="Add new line" />
                </control>
            </xpath>
        </field>
    </record>

According to the documentation this should shows a button and remove the "Add a line" link.

regards








0
Avatar
Descartar
Avatar
ALBRAHMS
Autor Best Answer

I solved my problem.

I replaced the widget "many2many" by "one2many", now when I click on "add a line" it's open the creation form.



0
Avatar
Descartar
Avatar
Muhammed Fasil
Best Answer

update view_mode  and view_id in record

<field name="view_mode">form</field>
<field
name="view_id" ref="sample_form_view"/>
0
Avatar
Descartar
ALBRAHMS
Autor

Fasil,

Thank you for your answer.

I'm not sure how I can use those tags. I can't find the related action.

The view I'm talking about is "hr_expense.view_hr_expense_sheet_form".

...

<notebook>

<page name="expenses" string="Expense">

<field name="expense_line_ids" nolabel="1" widget="many2many"

domain="[('state', '=', 'draft'), ('employee_id', '=', employee_id), ('company_id', '=', company_id)]"

options="{'reload_on_button': True}"

context="{'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header', 'default_company_id': company_id}">

<tree decoration-danger="is_refused">

<field name="date" />

<field name="name" />

<field name="state" invisible="1" />

<field name="analytic_account_id"

domain="['|', ('company_id', '=', parent.company_id), ('company_id', '=', False)]"

groups="analytic.group_analytic_accounting" />

<field name="analytic_tag_ids" widget="many2many_tags"

groups="analytic.group_analytic_tags" />

<field name="message_unread" invisible="1" />

<field name="attachment_number" string=" " />

<button name="action_get_attachment_view" string="View Attachments" type="object"

icon="fa-paperclip" />

<field name="tax_ids" widget="many2many_tags" groups="account.group_account_user"

context="{'default_company_id': company_id}" />

<field name="company_id" />

<field name="currency_id" invisible="1" />

<field name="total_amount" />

<field name="company_currency_id" invisible="1" />

<field name="total_amount_company" groups="base.group_multi_currency" />

<field name="is_refused" invisible="True" />

</tree>

</field>

...

The "Add a line" button in the tree view seems to be generated dynamically.

Regards

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
how can i set a field default value on a form depends on the active company Solved
odoo13CE
Avatar
Avatar
Avatar
2
de set. 23
4920
Field `state` does not exist
odoo13CE
Avatar
Avatar
1
de des. 22
2934
UI issues in version 16
ui
Avatar
Avatar
1
de des. 22
3799
odoo 13: inverse name in comodel Solved
odoo13CE
Avatar
Avatar
Avatar
3
de nov. 22
5371
Contacts visible to all users in a multi-company setup Odoo 13 CE Solved
odoo13CE
Avatar
Avatar
1
de nov. 22
5714
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