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

   _inherit = 'sale.order'
​proposal_id = fields.Many2one(
        'proposals',
        string='Proposal',
        readonly=True,
        states={'draft': [('readonly', False)]}
    )


I'm trying to understand what is states​ in Many2one field. Proposal​ is a class module that I made. There is state​ field in it but since the flow is to create the proposal first then automatically create sale.order​, why there is states​ in Many2one field? I try to remove it and nothing change. I want to know what states​ do here

アバター
破棄
最善の回答

Hi,


states={'draft': [('readonly', False)]} specifies that when the sale order is in the 'draft' state, the readonly attribute is removed, making the field editable.


Hope this helps

アバター
破棄
関連投稿 返信 ビュー 活動
1
8月 17
4459
1
3月 15
5248
3
9月 25
1806
1
5月 25
1284
2
2月 25
6342