Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
218 Visualizzazioni

Hello everybody!!

Please who can give me an answer.

Why when i do this:

services.create(cr,uid,value) (where services = self.pool.get('project.service.line') )

It add the recordset but without displaying it in the @api v8 of odoo

Avatar
Abbandona
Risposta migliore

The create method of the old API will only return the id of the record. To view the full record you may use:

new_id = services.create(cr, uid, value) # where services = self.pool.get('project.service.line')
record = services.browse(cr, uid, new_id)

Avatar
Abbandona
Autore

Thanks a lot for the answer. but, it doesnt work :/

Autore

new_id = services.create(cr, uid, value) print new_id record = services.browse(cr, uid, new_id) print record return record I got: 57 callim.project.service.line(57,) But it doesnt display anything. please need an answer

Hi Abdelwahed. This is exactly as expected. If you print record you will get project.service.line(57, ). If you need to print a field, you can do print record.field_name.

Post correlati Risposte Visualizzazioni Attività
2
ago 25
2632
1
lug 25
1020
1
ago 25
1151
0
mag 25
1479
2
apr 25
3626