Skip to Content
Menú
This question has been flagged
1 Respondre
1539 Vistes

   _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

Avatar
Descartar
Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
d’ag. 17
4021
1
de març 15
4903
1
de maig 25
883
2
de febr. 25
5791
1
de des. 24
1372