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

Pass values to the list view by the wizard !? (Odoo 13)

Subscriure's

Get notified when there's activity on this post

This question has been flagged
wizardmany2oneone2manylistviewOdoo13
4101 Vistes
Avatar
Leon

Hello,

I have 3 models:

model_b.py :

time_b = fields.Datetime("Your time", default=fields.Date.today)

#get value from module planning

role_b = fields.Many2one("planning.role", "Your role")

o_2_m = fields.One2many('model.a', 'keya')

state = fields.Selection([

            ('draf', 'DRAF'),

            ('confirm', 'CONFIRMED'),

            (cancel', 'CANCEL'),

            ],default='draf')


model_a.py :

employee_id = fields.Many2one('hr.employee', 'Employee')

keya = fields.Many2one('model.b')


model_c.py:

name = fields.Many2one('hr.employee', 'Employee')

time_c = fields.Datetime('Your time')

role_c = fields.Many2one('planning.role', 'Your role)


XML of model_c.py :

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

            <field name="name">model.c.tree.view</field>

            <field name="model">model.c</field>

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

                <tree>

                    <field name="name"/>

                    <field name="role_c"/>

                    <field name="time_c"/>

                </tree>

            </field>

        </record>

I want to pass all values selected of the field: 'employee_id' of model_a.py in the o_2_m field, and field 'role_b' and 'time_b' of model_b.py to the list view of model_c.py via the wizard button.

I created the method of model_b.py like this:

def confirm(self):

        for rec in self:

            if rec.o_2_m:

                for line in rec.o_2_m:

                    bc = self.env["model.c"].search([])

                    if bc:

                        bc['name'] = line.employee_id.id

                        bc['role_c'] = self.role_b

                        bc['time_c'] = self.time_b                    

            rec.state = "confirmed"                      

        return True 


After click on the "Add a line" link in the o_2_m tree view, and selected records of model_a.py and selected value for two fields of in the form view of model_b.py, and click the 'confirm' button...  It still not work! 


Please help!

Thank you!        



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
Odoo 13 : Problems with one2many/many2one filters Solved
many2one one2many Filters Odoo13
Avatar
1
de febr. 24
2421
How can we create One2many field in a Transient Model ? Solved
wizard many2one one2many odoo11
Avatar
Avatar
2
de nov. 24
15899
Create/Update: a mandatory field is not set
error many2one one2many Odoo13 mandatory-field
Avatar
Avatar
1
d’oct. 23
4087
Automatically open many2one or one2many field without clicking external link icon
code many2one one2many Odoo13 odoo13
Avatar
0
d’oct. 22
2858
key = 'default_' + name TypeError: must be str, not int (Odoo 13)
treeview many2one one2many one2many_list Odoo13
Avatar
0
de febr. 21
4563
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