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

I want to set hundreds of account move lines of one specific account to draft status.

I created a contextual action based on mass cancel/draft for journal entries, but I cannot find the right command for mass drafting multiple account move lines.

The error message states: 

AttributeError: 'account.move.line' object has no attribute 'abc'

For mass drafting journal entries, this code works:

for record in records:

    record.button_draft()

What is the correct code for account move lines?

アバター
破棄
最善の回答

Hi,

The error is happening because account.move.line (the account move lines) does not have a method like button_draft(). The button_draft() method exists for account.move (journal entries), but not for individual account move lines.

To set the account move lines to draft, you first need to operate on the corresponding account.move (journal entry).

Thanks.

アバター
破棄
関連投稿 返信 ビュー 活動
1
2月 25
2299
1
12月 24
2702
2
4月 24
4093
2
4月 24
5508
0
3月 24
1732