[FIX] stock: proper api.multi
Mixup withf7dcabf(saas-11.1) anda496ca9(11.0) that was not properly ported Avoid undefined variable if self is empoty (e.g. when reinstall stock)
This commit is contained in:
@@ -28,11 +28,11 @@ class Company(models.Model):
|
||||
location.sudo().write({'company_id': company.id})
|
||||
company.write({'internal_transit_location_id': location.id})
|
||||
|
||||
warehouses = self.env['stock.warehouse'].search([('partner_id', '=', self.partner_id.id)])
|
||||
warehouses.mapped('partner_id').with_context(force_company=self.id).write({
|
||||
'property_stock_customer': location.id,
|
||||
'property_stock_supplier': location.id,
|
||||
})
|
||||
warehouses = self.env['stock.warehouse'].search([('partner_id', '=', location.partner_id.id)])
|
||||
warehouses.mapped('partner_id').with_context(force_company=location.id).write({
|
||||
'property_stock_customer': location.id,
|
||||
'property_stock_supplier': location.id,
|
||||
})
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
||||
Reference in New Issue
Block a user