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

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 ✌️

アバター
破棄
著作者 最善の回答

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)


アバター
破棄
関連投稿 返信 ビュー 活動
2
2月 23
5693
2
4月 22
4712
3
3月 19
3414
0
4月 23
1893
0
1月 23
1669