Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3915 Zobrazení

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
Zrušit
Nejlepší odpověď

Hi,

Try as follows:

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

Thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
říj 21
1827
1
bře 23
2226
1
srp 21
2871
1
čvc 25
2319
2
čvc 25
7797