Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
4044 Visualizações

I have company_id field in stock.location which is many2one. When I change the field type from many2one to many2many by inheriting the model in custom addon, it shows the following error- 


My code:


class Location(models.Model):
_inherit = "stock.location"

company_id = fields.Many2many("res.company", string='Company12345', required=True

The error:

TypeError: Type of related field stock.quant.company_id is inconsistent with stock.location.company_id - - -


Any idea?

Avatar
Cancelar
Melhor resposta

Hi,

Try as follows:

company_id = fields.Many2many("res.company", string="Company", required=True, related='')

Thanks

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
out. 21
1937
1
mar. 23
2357
1
ago. 21
2996
0
ago. 25
164
1
ago. 25
2122