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 display result WSDL in list view xml odoo?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
treeviewwebservicesparseodoo8.0
4 Respostes
10140 Vistes
Avatar
Salma

Hi ! please can someone tell me how to parse an WSDL file in python and how to display the result in a tree view ?

0
Avatar
Descartar
Thanh Loyal

Hello, I think your question is too short, you should describle your problem in more details like: How is your WSDL file got read by Odoo? is it in your server file system? To display data in a tree view, after parsing wsdl file, you may create a set of records and display it like other models.

Salma
Autor

Hi Thanh Loyal ! Thank you for your response : ) so I connect to the url of my WSDL with the suds library (Python 2.7.9) and this is the code : import suds from suds.client import Client from suds.transport.https import WindowsHttpAuthenticated ntlm = WindowsHttpAuthenticated(username='xxxxx', password='yyyyy') url = 'http://xxxxxxx' client = Client(url, transport=ntlm) print (client) # this will return the methods and types available from the codeunit result = client.service.ReadMultiple() client.service.ReadMultiple() return an array that contain objects and I want to display this list of object in a tree view, that's why I create a new class which its attributs are computed fields that contain the fields of the object returned by the web service . Code : class ProductImpo(models.Model): _name = 'product.impo' ...... Serial_No = fields.Char(string="N° de série", compute='_compute_serial_no') ....... And the function code is : @api.multi def _compute_serial_no(self): i=-1 for record in self: i=i+1 record.Serial_No=result.Stock_Vehicule[i].Serial_No And the view : product.impo.tree product.impo ..... .... For this exemple the array returned contain 14 rows so those 14 rows are displayed in the tree view only if I create manually 14 rows empty just with ID in the table ProductImpo in PostgreSQL so my question is how to create a new row in the table by using python adding rows = len(result.Stock_Vehicule) PS : Stock_Vehicule is the arry returned which is 14 in this example

Avatar
Thanh Loyal
Best Answer

Hi,

Your question is clearer now.

I dont know when your first python code section runs? I usually write functions in a model class or in a controller.

And I think you may follow these steps:

1. Retrieve the model

   1.1 In case of a model class

     product_impo = self.env['product.impo']

   1.2 In case of a controller:

     product_impo = http.request.env['product.impo']


2. Write data that your client retrieved to DB using the above model:

     # for each row in 14 rows

   product_impo.sudo().write({   # think more about sudo() for more secure

     'Serial_No': self.Serial_No # If your method is in a Model class

  })


OR


   product_impo.sudo().write({

     'Serial_No': row.Serial_No # If your method is in a controller

  })

0
Avatar
Descartar
Avatar
Salma
Autor Best Answer

Hi Thanh Loyal ! Thank you for your response : ) so I connect to the url of my WSDL with the suds library (Python 2.7.9) and this is the code :

import suds

from suds.client import Client

from suds.transport.https import WindowsHttpAuthenticated

 ntlm = WindowsHttpAuthenticated(username='xxxxx', password='yyyyy')

url = 'http://xxxxxxx'

client = Client(url, transport=ntlm)

print (client) # this will return the methods and types available from the codeunit

result = client.service.ReadMultiple()

client.service.ReadMultiple() return an array that contain objects and I want to display this list of object in a tree view, that's why I create a new class which its attributs are computed fields that contain the fields of the object returned by the web service . Code :

class ProductImpo(models.Model):

_name = 'product.impo'

......

Serial_No = fields.Char(string="N° de série", compute='_compute_serial_no')

.......

and the function code is :

@api.multi

def _compute_serial_no(self):

i=-1

for record in self:

i=i+1

record.Serial_No=result.Stock_Vehicule[i].Serial_No

and the view :

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

<field name="name">product.impo.tree</field>

<field name="model">product.impo</field>

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

<tree string="Disponibilité">

.....

<field name="Serial_No"/>

....

</tree>

</field>

</record>

For this exemple the array returned contain 14 rows so those 14 rows are displayed in the tree view only if I create manually 14 rows empty just with ID in the table ProductImpo in PostgreSQL so my question is how to create a new row in the table by using python adding rows = len(result.Stock_Vehicule)

PS : Stock_Vehicule is the arry returned which is 14 in this example

0
Avatar
Descartar
Salma
Autor

when I try to retrieve the model I obtain this error : impo_obj = self.env['product.impo'] NameError: name 'self' is not defined and this is the code : class ProductImpo(models.Model): _name = 'product.impo' ..... Serial_No = fields.Char(string="N° de série", compute='_compute_serial_no') ...... impo_obj = self.env['product.impo'] ...... When I try to put it in a function like : def _tester(self): impo_obj = self.env['product.impo'] ...... after that when I call the function self still inknown

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 display invoice lines items in tree view - Odoo8
treeview odoo8.0
Avatar
Avatar
1
de jul. 19
4152
Internal reference column sortable Solved
treeview column odoo8.0 sortable
Avatar
Avatar
Avatar
3
d’ag. 23
10929
Odoo8 incoming email parse html
email html parse odoo8.0
Avatar
Avatar
1
de gen. 16
3973
Vertical labels in tree view Solved
treeview labels odoo8.0 vertical
Avatar
Avatar
1
de nov. 15
6681
Account Invoice subtotal comes on top side. Is it possible to shift bottom?
accounting invoice treeview odooV8 odoo8.0
Avatar
0
de febr. 16
3800
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