diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 59542eefc90..7b3791bfcee 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -195,7 +195,7 @@ class delivery_grid(osv.osv): for line in order.order_line: if not line.product_id or line.is_delivery: continue - q = product_uom_obj._compute_qty(cr, uid, line.product_uom.id, line.product_uos_qty, line.product_id.uom_id.id) + q = product_uom_obj._compute_qty(cr, uid, line.product_uom.id, line.product_uom_qty, line.product_id.uom_id.id) weight += (line.product_id.weight or 0.0) * q volume += (line.product_id.volume or 0.0) * q total = order.amount_total or 0.0 diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 922f6cd3af5..279294d49ff 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -361,7 +361,10 @@ class mail_thread(osv.AbstractModel): # automatic logging unless asked not to (mainly for various testing purpose) if not context.get('mail_create_nolog'): - self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context) + ir_model_pool = self.pool['ir.model'] + ids = ir_model_pool.search(cr, uid, [('model', '=', self._name)], context=context) + name = ir_model_pool.read(cr, uid, ids, ['name'], context=context)[0]['name'] + self.message_post(cr, uid, thread_id, body=_('%s created') % name, context=context) # auto_subscribe: take values and defaults into account create_values = dict(values) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 34a24354508..b94199746b8 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1480,7 +1480,7 @@ class stock_production_lot(osv.osv): 'product_id': lambda x, y, z, c: c.get('product_id', False), } _sql_constraints = [ - ('name_ref_uniq', 'unique (name, ref)', 'The combination of Serial Number and internal reference must be unique !'), + ('name_ref_uniq', 'unique (name, ref, product_id, company_id)', 'The combination of Serial Number, internal reference, Product and Company must be unique !'), ] def action_traceability(self, cr, uid, ids, context=None): """ It traces the information of a product