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 pass values in lead to sales through action Button?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
actionbuttonodoo10
7 Respostes
24844 Vistes
Avatar
MUHAMMED ASLAM

models

class Lead(models.Model):

    _inherit = 'crm.lead'

    service_id = fields.Many2one('lmc.service', required=True, string="Service")

class SaleOrder(models.Model):

    _inherit = "sale.order"

   service_id = fields.Many2one('lmc.service', required=True, string="Service")

Notes

I want to pass service_id of lead to sale order when the New Quotation button(action) button is clicked.I worked in similar situation, but sometimes I pass values from one module to another using object button.please help me how it is possible through action button

Reference

This is the button in lead 

<button string="New Quotation" name="%(sale_action_quotations_new)d" type="action" class="oe_highlight"

                        context="{'search_default_partner_id': partner_id,

                                  'default_partner_id': partner_id,

                                  'default_team_id': team_id}"/>

that id used in sale order and defined like this


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

        <field name="name">Quotation</field>

        <field name="res_model">sale.order</field>

        <field name="view_mode">form,tree,graph</field>

        <field name="domain">[('opportunity_id', '=', active_id)]</field>

        <field name="context">{'search_default_opportunity_id': active_id, 'default_opportunity_id': active_id}</field>

    </record>

How to pass values through this button.Thanks in advance

0
Avatar
Descartar
Avatar
Denis Baranov
Best Answer

Hello,

just add to/ redefine the context in a button required parameter with 'default_' prefix. E.g.:

<button string="New Quotation" name="%(sale_action_quotations_new)d" type="action" class="oe_highlight"
                        context="{
        'default_service_id': service_id,
       'search_default_partner_id': partner_id,
        'default_partner_id': partner_id,
        'default_team_id': team_id}"/>



4
Avatar
Descartar
MUHAMMED ASLAM
Autor

Thanks IT Libertas for the answer.

MUHAMMED ASLAM
Autor

I try to hide New Quotation button like this

<xpath expr="//button[@name='%(sale_action_quotations_new)d']" position="attributes">

<attribute name="invisible">1</attribute>

But there is an error external id not found.is possible to hide action button like object button

Avatar
Marcel Savegnago
Best Answer

I did not create a new button. However, I had to overwrite the context of the original button and in fact I would just like to increment the context of the button without having to overwrite.

<record id="workshop_vehicle_crm_opportunity_form_view_inherit" model="ir.ui.view">
<field name="name">workshop.vehicle.crm.opportunity.form.inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">

<button name='%(sale_crm.sale_action_quotations_new)d' position='attributes'>
<attribute name="context">{
'search_default_partner_id': partner_id,
'default_partner_id': partner_id,
'default_team_id': team_id,
'default_campaign_id': campaign_id,
'default_medium_id': medium_id,
'default_source_id': source_id,
'default_vehicle_id': vehicle_id,
}
</attribute>
</button>

<xpath expr="//field[@name='partner_id']" position="after">
<field name="vehicle_id" string="Vehicle"/>
</xpath>
</field>
</record>
0
Avatar
Descartar
Avatar
Annadurai
Best Answer

Hello Muhammed. for Your action button hiding query -->  You may replace it with attributes="replace" . eg:   <xpath expr="//button[@name='%(sale.action_quotations_salesteams)d']" position="replace"/>
I have not seen action hiding button in the base code itself. 

0
Avatar
Descartar
MUHAMMED ASLAM
Autor

Thanks Annadurai

Annadurai

welcome :)

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
action button is disabled in the list view Solved
action button
Avatar
1
de març 21
5438
Error using a button
button odoo10
Avatar
Avatar
2
de jul. 18
4115
How set STATE=DONE? (Action & Button)
action button
Avatar
Avatar
Avatar
3
de març 15
10948
how to add more then one default filter?
action filter odoo10
Avatar
Avatar
2
d’abr. 24
5621
How to change string of the button without altering its action
action button string
Avatar
Avatar
Avatar
2
de febr. 23
4179
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