Skip to Content
Menu
This question has been flagged

Hello Everyone.....

In Odoo 10, I have inherited product.template Class and in that I want to write value of custom field cost to field price that is in seller_ids One2many i.e. product.supplierinfo class.But I am not able to write value in One2many my code is below: -

class ProductTemplateInherit(models.Model):

    _inherit = "product.template"


@api.multi

def update_value(self):

     listPrice = self.cost

     list=[]

     for a in self.env['product.supplierinfo'].search([('product_tmpl_id','=',self.id)]):

            list.append({'price':listPrice})

     return {'value': {'seller_ids': list}}

Thanks in advance.

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 22
1010
4
May 18
9450
0
Mar 23
3773
1
Jul 20
6753
0
Apr 20
3285