Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3913 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Try as follows:

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

Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 21
1827
1
mar 23
2225
1
sie 21
2871
1
lip 25
2317
2
lip 25
7793