Odoo Help

0

How to get value in set() odooV8

By
Ajeng Shilvie
on 1/19/15, 10:22 PM 457 views

i want to get value from collecting_line from this code :

 

                    collecting_line = []

                    collecting_line.append({
                                                 'collecting_id','=',collecting_id,
                                                 'categ','=',nilai_browse.name,
                                                 'kpb_ke','=',nilai_browse_jasa.kpb_ke,
                                                 'jasa','=',nilai_browse_jasa.jasa,
                                                 'oli','=',nilai_browse_jasa.oli
                                                 }) 

                   self.write(cr, uid, collecting_id, {
                              'collecting_line':collecting_line
                              }, context=context)

i try to print collecting_line and the output like this [set([u'A', 1, 196, 'categ', 'oli', 2220.0, 'kpb_ke', 'jasa', 33330.0, 'collecting_id', '='])

how to get that value ? because i have to insert it in one to many field , but it didn't work. Normally i didn't see [set()] but now it appears

 

 

0

If you want to write in one2many field, try the following:

collecting_line=[]

collecting_line.append((0,0,{ 'collecting_id':collecting_id,
                 'categ':nilai_browse.name,
                 'kpb_ke':nilai_browse_jasa.kpb_ke,
                 'jasa':nilai_browse_jasa.jasa,
                 'oli':nilai_browse_jasa.oli}))

self.write(cr, uid, collecting_id, {
              'collecting_line':collecting_line
              }, context=context)

  • set() is function for working on collection, specifically on unordered collection, used to remov duplicate items.

Hope this helps !!.

 

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/19/15, 10:22 PM
Seen: 457 times
Last updated: 3/16/15, 8:10 AM