42
41
company_id = self.pool.get(
43
42
'res.users').browse(cr, uid, uid).company_id.id
44
43
product_obj = self.pool.get('product.template')
45
if super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context=context):
44
if super(purchase_order, self).wkf_confirm_order(cr, uid, ids,
46
46
for po in self.browse(cr, uid, ids, context=context):
47
47
partner_id = po.partner_id.id
48
48
for line in po.order_line:
49
49
product_id = line.product_id.product_tmpl_id.id
50
if not product_supp_obj.search(cr, uid, [('product_id', '=', product_id), ('name', '=', partner_id)]):
54
'seller_ids': [(0, 0, {'name': partner_id, 'min_qty': 1.0, 'delay': 1,
55
'sequence': 10, 'product_id': product_id, 'company_id': company_id, 'product_uom': line and line.product_id and line.product_id.uom_id and line.product_id.uom_id.id})]})
50
if not product_supp_obj.search(cr, uid,
53
('name', '=', partner_id)]):
54
product_obj.write(cr, uid, [product_id],