Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
1756 Vues

   _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
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
août 17
4206
1
mars 15
5049
1
mai 25
1050
2
févr. 25
6006
1
déc. 24
1527