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

Unable to display purchase order line in wizard

Abonare

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

Această întrebare a fost marcată
communitymodelswizardsodoo
4490 Vizualizări
Imagine profil
Mayank Parashar

################

Wizard method

################

def button_confirm (self): 
view = self.env.ref ('purchase_update_price.purchase_update_price_wizard_form')
return {
'name': _ ("Purchase Update Price"),
'view_mode': 'form',
'view_id': view.id,
'res_id': view.id,
'view_type': 'form',
'res_model': 'purchase.update.price .wizard ',
'type': 'ir.actions.act_window',
'target': 'new',
}

###################

purchase order line field

###################

def update_purchase_price (self):
active_pro = self.env ["purchase.order"]. browse (self.env.context.get ("active_id")). search ([]) [0]  
return active_pro.order_line

order_line = fields.Many2many ('purchase.order.line', string = 'Available Products'
, default = update_purchase_price)


#Still i am getting empty list with only labels not values in my wizard why?

0
Imagine profil
Abandonează
Niyas Raphy (Walnut Software Solutions)

are you expecting to show the purchase order lines in the order_line field ? if so how you tried to do it? if you are looking for the way, you can do it from the default_get method of the wizard model.

Mayank Parashar
Autor

Yes exactly thats what i am trying to do.

I fetched the order_line by

active_pro = self.env ["purchase.order"]. browse (self.env.context.get ("active_id")). search ([]) [0]

but its not apprearing in wizard i don't know why i set this function as a default value for a field order_line

Mayank Parashar
Autor

@api.model

def default_get(self, fields):

res = super(PurchaseUpdatePriceWizard, self).default_get(fields)

active_pro = self.env["purchase.order"].browse(self.env.context.get("active_id")).search([])[0]

new_line = []

for product in active_pro.order_line:

line = (0, 0, {

'order_id': product.order_id,

'product_id': product.product_id,

'name': product.name,

'company_id': product.company_id,

'product_uom_category_id': product.product_uom_category_id

})

new_line.append(line)

res.update({

'order_line': new_line

})

return res

order_line = fields.Many2many('purchase.order.line', string='Available Products')

#used default_get also still empty list

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
teps to Integrate "Product Low Stock Alert" Module into Odoo 17 Community Edition with PostgreSQL 12
community models odoo
Imagine profil
Imagine profil
1
iul. 24
1701
Call wizard by python code
community modules wizards odoo
Imagine profil
0
feb. 22
3274
Missing view architecture error while calling wizard
community module wizards odoo
Imagine profil
0
iun. 21
3821
When update/insert data one model also update/insert another model Rezolvat
models odoo
Imagine profil
Imagine profil
1
apr. 20
3847
Installing Odoo Community 9 on my website
community odoo
Imagine profil
Imagine profil
Imagine profil
2
aug. 16
6335
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