[IMP] stock: improved the constraint error message to be more clear
bzr revid: qdp-launchpad@openerp.com-20130516133041-yvh5cug4idbme3gk
This commit is contained in:
parent
fb927c08bb
commit
c3d4b82b36
|
@ -1630,9 +1630,9 @@ class stock_move(osv.osv):
|
|||
def _check_company_location(self, cr, uid, ids, context=None):
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
if record.location_id.company_id and (record.company_id.id != record.location_id.company_id.id):
|
||||
raise osv.except_osv(_('Error'), _('The company of the source location %s of %s and the company of the stock move %s %s should be the same') % (record.location_id.name, record.location_id.company_id.name, record.name, record.company_id))
|
||||
raise osv.except_osv(_('Error'), _('The company of the source location (%s) and the company of the stock move (%s) should be the same') % (record.location_id.company_id.name, record.company_id.name))
|
||||
if record.location_dest_id.company_id and (record.company_id.id != record.location_dest_id.company_id.id):
|
||||
raise osv.except_osv(_('Error'), _('The company of the destination location %s of %s and the company of the stock move %s %s should be the same') % (record.location_dest_id.name, record.location_dest_id.company_id.name, record.name, record.company_id.name))
|
||||
raise osv.except_osv(_('Error'), _('The company of the destination location (%s) and the company of the stock move (%s) should be the same') % (record.location_dest_id.company_id.name, record.company_id.name))
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
|
|
Loading…
Reference in New Issue