コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3860 ビュー

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?

アバター
破棄
最善の回答

Hi,

Try as follows:

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

Thanks

アバター
破棄
関連投稿 返信 ビュー 活動
0
10月 21
1774
1
3月 23
2198
1
8月 21
2816
1
7月 25
1960
2
7月 25
7501