Add partner_id on private stock
This commit is contained in:
@@ -23,8 +23,9 @@ class ResPartner(models.Model):
|
|||||||
help="Stock location route used by default in sale order lines"
|
help="Stock location route used by default in sale order lines"
|
||||||
"for this customer.")
|
"for this customer.")
|
||||||
|
|
||||||
@api.model
|
@api.multi
|
||||||
def _create_private_location_records(self, location_name):
|
def _create_private_location_records(self, location_name):
|
||||||
|
self.ensure_one()
|
||||||
assert location_name, 'missing arg location_name'
|
assert location_name, 'missing arg location_name'
|
||||||
slo = self.env['stock.location']
|
slo = self.env['stock.location']
|
||||||
swo = self.env['stock.warehouse']
|
swo = self.env['stock.warehouse']
|
||||||
@@ -44,6 +45,7 @@ class ResPartner(models.Model):
|
|||||||
'location_id': warehouse.view_location_id.id,
|
'location_id': warehouse.view_location_id.id,
|
||||||
'usage': 'internal',
|
'usage': 'internal',
|
||||||
'company_id': company.id,
|
'company_id': company.id,
|
||||||
|
'partner_id': self.id,
|
||||||
})
|
})
|
||||||
rule = pro.create({
|
rule = pro.create({
|
||||||
'name': _('From specific stock %s to customer') % location_name,
|
'name': _('From specific stock %s to customer') % location_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user