Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1789 Переглядів

   _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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
серп. 17
4234
1
бер. 15
5106
1
трав. 25
1098
2
лют. 25
6066
1
груд. 24
1565