Skip to Content
Menu
This question has been flagged
1 Reply
3802 Views

I am creating products on odoo based on json data from outside but they are not showing in the products view

but when i take the count of products and print the name of those records it is there in the list of products records.


def order_to_odoo(self):

    url = 'http://htel.com/order_odoo.php'

    response = urllib.urlopen(url)

    data = json.loads(response.read())

    for majorkey,subdict in data.iteritems():

        for index,value in subdict.iteritems():

             if index=='order_hotel_name':

                    pr_name=value

         valsproduct = {'name': pr_name,

            'categ_id': 1,

            'public_categ_ids':[(6,0,[1,4])],

            'status':'approved'

        }

        self.env['product.template'].create(valsproduct)

Avatar
Discard
Best Answer

Hi,

If the product exist in the db and not showing in the view means,  may be the value in the active field may be false.

The records having the active value True will be shown in the view

Just go to the Odoo UI of the product and try to filter the archieved and check whether you can see your product in the archieved list or not.




If you can find the product in this list, just on creating the product add 'active' : True, along with the other values.

Thanks

Avatar
Discard
Author

Thanks it worked.

Related Posts Replies Views Activity
1
Nov 24
18017
1
Sep 23
1200
3
May 23
4088
7
Apr 23
47087
1
Dec 22
6432