[FIX] stock: a company warehouse has the address of the company

For shipping reasons, a warehouse should not be created without an
address.
This commit is contained in:
Richard Mathot
2017-08-01 09:35:43 +02:00
parent 391a29dc42
commit 48bdcbd895
+1 -1
View File
@@ -34,6 +34,6 @@ class Company(models.Model):
# multi-company rules prevents creating warehouse and sub-locations
self.env['stock.warehouse'].check_access_rights('create')
self.env['stock.warehouse'].sudo().create({'name': company.name, 'code': company.name[:5], 'company_id': company.id})
self.env['stock.warehouse'].sudo().create({'name': company.name, 'code': company.name[:5], 'company_id': company.id, 'partner_id': company.partner_id.id})
company.create_transit_location()
return company