Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1129 Переглядів

Hi everyone,

I’m working with Odoo 17 and would like to create a filter in the delivery orders view to show only records that contain exactly one order line (i.e. deliveries with a single product).

So far, I couldn’t find a field like "Move Line Count" or similar to filter by the number of items in the delivery.

Does anyone know if there's a built-in field or workaround via the UI (no coding) to achieve this?

Thanks in advance for your help!

Аватар
Відмінити
Автор Найкраща відповідь

Thanks

Аватар
Відмінити
Найкраща відповідь

Without code, it is a bit difficult to achieve the desired result, because in Odoo, when filtering a One2many field with move_line_ids, we cannot directly use the number of records from that table in a simple way, since move_line_ids is a One2many field and the operation of counting rows/IDs is not directly supported in a domain in this manner.

In my perception, what you can do is create an auxiliary field with Odoo Studio to store the number of lines you will have within the move_line_ids linked to stock_picking and then use that field to filter; anymay, you will have to use base automation with Python Code to accomplish this.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
лип. 25
118
1
трав. 25
1159
ADD PROPERTIES Вирішено
1
трав. 25
1179
1
бер. 25
1170
1
лют. 25
1213