[FIX] stock: lot default company.
closes odoo/odoo#39464 X-original-commit: d0cd57c90bcfdcf98698a68acabdc72001406d13 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -475,7 +475,11 @@ class Product(models.Model):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('stock.action_production_lot_form').read()[0]
|
||||
action['domain'] = [('product_id', '=', self.id)]
|
||||
action['context'] = {'default_product_id': self.id, 'set_product_readonly': True}
|
||||
action['context'] = {
|
||||
'default_product_id': self.id,
|
||||
'set_product_readonly': True,
|
||||
'default_company_id': (self.company_id or self.env.company).id,
|
||||
}
|
||||
return action
|
||||
|
||||
# Be aware that the exact same function exists in product.template
|
||||
@@ -779,7 +783,10 @@ class ProductTemplate(models.Model):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('stock.action_production_lot_form').read()[0]
|
||||
action['domain'] = [('product_id.product_tmpl_id', '=', self.id)]
|
||||
action['context'] = {'default_product_tmpl_id': self.id}
|
||||
action['context'] = {
|
||||
'default_product_tmpl_id': self.id,
|
||||
'default_company_id': (self.company_id or self.env.company).id,
|
||||
}
|
||||
if self.product_variant_count == 1:
|
||||
action['context'].update({
|
||||
'default_product_id': self.product_variant_id.id,
|
||||
|
||||
Reference in New Issue
Block a user