Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2460 Weergaven

Hello, I am looking at the code of the invoice form view but haven't been able to find it. I want to learn how does Odoo disables de edit of a validated invoice, if I click the edit button on a validated invoice I can modify only a few fields like the incoterm and the sales team. thanks ✌️

Avatar
Annuleer
Auteur Beste antwoord

The answer is in the python code, in the fields definition there is the states parameter that the account.invoice uses on its fields to disable modifying validated invoices, actually it only allows to modify those fields while in draft state.


states={'draft': [('readonly', False)]}


Example field definition from account.invoice:

date_invoice = fields.Date(string='Invoice Date', readonly=True, states={'draft': [('readonly', False)]}, index=True, help="Keep empty to use the current date", copy=False)


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
feb. 23
5668
2
apr. 22
4697
3
mrt. 19
3408
0
apr. 23
1876
0
jan. 23
1647