[IMP] Use display_name instead of partner_ref
This commit is contained in:
@@ -519,7 +519,7 @@ class ProductChangeMixin(object):
|
|||||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)
|
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, product_obj.taxes_id)
|
||||||
|
|
||||||
result['name'] = product_obj.partner_ref
|
result['name'] = product_obj.display_name
|
||||||
result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
|
result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id or False
|
||||||
if not pricelist:
|
if not pricelist:
|
||||||
warning = {
|
warning = {
|
||||||
|
|||||||
@@ -1007,9 +1007,10 @@ class product_product(osv.osv):
|
|||||||
sellers = filter(lambda x: x.name.id == partner_id, product.seller_ids)
|
sellers = filter(lambda x: x.name.id == partner_id, product.seller_ids)
|
||||||
if sellers:
|
if sellers:
|
||||||
for s in sellers:
|
for s in sellers:
|
||||||
|
seller_variant = s.product_name and "%s (%s)" % (s.product_name, variant) or False
|
||||||
mydict = {
|
mydict = {
|
||||||
'id': product.id,
|
'id': product.id,
|
||||||
'name': s.product_name or name,
|
'name': seller_variant or name,
|
||||||
'default_code': s.product_code or product.default_code,
|
'default_code': s.product_code or product.default_code,
|
||||||
}
|
}
|
||||||
result.append(_name_get(mydict))
|
result.append(_name_get(mydict))
|
||||||
|
|||||||
@@ -679,11 +679,12 @@ class purchase_order(osv.osv):
|
|||||||
def action_cancel(self, cr, uid, ids, context=None):
|
def action_cancel(self, cr, uid, ids, context=None):
|
||||||
for purchase in self.browse(cr, uid, ids, context=context):
|
for purchase in self.browse(cr, uid, ids, context=context):
|
||||||
for pick in purchase.picking_ids:
|
for pick in purchase.picking_ids:
|
||||||
if pick.state not in ('draft', 'cancel', 'confirmed'):
|
for move in pick.move_lines:
|
||||||
raise osv.except_osv(
|
if pick.state == 'done':
|
||||||
_('Unable to cancel the purchase order %s.') % (purchase.name),
|
raise osv.except_osv(
|
||||||
_('First cancel all receipts related to this purchase order.'))
|
_('Unable to cancel the purchase order %s.') % (purchase.name),
|
||||||
self.pool.get('stock.picking').action_cancel(cr, uid, map(attrgetter('id'), purchase.picking_ids), context=context)
|
_('You have already received some goods for it. '))
|
||||||
|
self.pool.get('stock.picking').action_cancel(cr, uid, [x.id for x in purchase.picking_ids if x.state != 'cancel'], context=context)
|
||||||
for inv in purchase.invoice_ids:
|
for inv in purchase.invoice_ids:
|
||||||
if inv and inv.state not in ('cancel', 'draft'):
|
if inv and inv.state not in ('cancel', 'draft'):
|
||||||
raise osv.except_osv(
|
raise osv.except_osv(
|
||||||
@@ -691,7 +692,6 @@ class purchase_order(osv.osv):
|
|||||||
_('You must first cancel all invoices related to this purchase order.'))
|
_('You must first cancel all invoices related to this purchase order.'))
|
||||||
self.pool.get('account.invoice') \
|
self.pool.get('account.invoice') \
|
||||||
.signal_workflow(cr, uid, map(attrgetter('id'), purchase.invoice_ids), 'invoice_cancel')
|
.signal_workflow(cr, uid, map(attrgetter('id'), purchase.invoice_ids), 'invoice_cancel')
|
||||||
self.set_order_line_status(cr, uid, ids, 'cancel', context=context)
|
|
||||||
self.signal_workflow(cr, uid, ids, 'purchase_cancel')
|
self.signal_workflow(cr, uid, ids, 'purchase_cancel')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -1284,7 +1284,7 @@ class procurement_order(osv.osv):
|
|||||||
product = prod_obj.browse(cr, uid, procurement.product_id.id, context=new_context)
|
product = prod_obj.browse(cr, uid, procurement.product_id.id, context=new_context)
|
||||||
taxes_ids = procurement.product_id.supplier_taxes_id
|
taxes_ids = procurement.product_id.supplier_taxes_id
|
||||||
taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
|
taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
|
||||||
name = product.partner_ref
|
name = product.display_name
|
||||||
if product.description_purchase:
|
if product.description_purchase:
|
||||||
name += '\n' + product.description_purchase
|
name += '\n' + product.description_purchase
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user