[IMP]: purchase: Improvment in code product supplier code name display in purchase line
bzr revid: ron@tinyerp.com-20101118120627-7150ordmsx038omu
This commit is contained in:
+17
-13
@@ -646,10 +646,7 @@ class purchase_order_line(osv.osv):
|
||||
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '',
|
||||
'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
|
||||
prod= self.pool.get('product.product').browse(cr, uid, product)
|
||||
if prod.product_tmpl_id.seller_ids:
|
||||
seller_get_id = prod.product_tmpl_id.seller_ids[0].name.id
|
||||
else:
|
||||
seller_get_id = False
|
||||
|
||||
|
||||
lang=False
|
||||
if partner_id:
|
||||
@@ -680,15 +677,22 @@ class purchase_order_line(osv.osv):
|
||||
'date': date_order,
|
||||
})[pricelist]
|
||||
dt = (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
if seller_get_id == partner_id:
|
||||
prod_suppl_name = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_name
|
||||
prod_suppl_code = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_code
|
||||
if prod_suppl_name == False or prod_suppl_code == False:
|
||||
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
|
||||
else:
|
||||
prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
|
||||
else:
|
||||
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
|
||||
|
||||
seller_get_id = False
|
||||
|
||||
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
|
||||
|
||||
for seller_id in prod.product_tmpl_id.seller_ids:
|
||||
if seller_id.name.id == partner_id:
|
||||
prod_suppl_name = seller_id.product_name
|
||||
prod_suppl_code = seller_id.product_code
|
||||
if not (prod_suppl_name or prod_suppl_code):
|
||||
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
|
||||
elif (not prod_suppl_name) or (not prod_suppl_code):
|
||||
prod_name= '[' + (prod_suppl_code or prod.default_code or '') + '] '+ (prod_suppl_name or prod.name or '')
|
||||
else:
|
||||
prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
|
||||
|
||||
|
||||
res = {'value': {'price_unit': price, 'name': name or prod_name,
|
||||
'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
|
||||
|
||||
Reference in New Issue
Block a user