Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3141 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 25
2245
1
thg 12 24
2645
Cost of goods sold Đã xử lý
2
thg 4 24
4026
2
thg 4 24
5453
0
thg 3 24
1714