[FIX] Adding stock move constraint and changing warehouse in purchase requisition test meanwhile

bzr revid: jco@openerp.com-20130513133535-0g1e5pxfqzess7n9
This commit is contained in:
Josse Colpaert 2013-05-13 15:35:35 +02:00
parent c4cd05832e
commit 9a08f7a4ce
2 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@
product_id: product.product_product_13
qty: 15
uom_id: product.product_uom_unit
warehouse_id: stock.stock_warehouse_shop0
warehouse_id: stock.warehouse0
-
!python {model: make.procurement}: |
self.make_procurement(cr, uid, [ref('procurement_product_hdd3')], context)

View File

@ -1630,11 +1630,11 @@ class stock_move(osv.osv):
return True
#TODO: change demo data for this to be possible
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 and the company of the stock move should be the same') % record.location_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 and the company of the stock move should be the same') % record.location_dest_id.name)
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 should be the same') % (record.location_id.name, record.location_id.company_id.name, record.company_id))
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 should be the same') % (record.location_dest_id.name, record.location_dest_id.company_id.name, record.company_id.name))
return True
_constraints = [