Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
1544 Представления

Good evening,

I have made a custom report and it works fine. What I would like is to have only the stockable products on my report and not all products, no it also shows service products and We don't need that. Is there a easy way to do this.








/

.product_id.categ_id.name or ''"/>


I hope someone can help me.

Giel van Maarseveen

Аватар
Отменить
Автор

<t t-if="len(o.order_line)&gt;0">
<span id="t1f_1_m" class="t s4"><strong><t t-esc="int(o.order_line[0].product_uom_qty)"/></strong></span>
<span id="t1e_1_m" class="t s4"><strong><t t-esc="o.order_line[0].product_id.display_name[:47]"/></strong></span>
<span id="t1g_1_m" class="t s4"><strong><t t-esc="o.order_line[0].product_packaging.name or ''"/></strong><strong> / </strong><strong><t t-esc="o.order_line[0].product_packaging.qty or ''"/></strong></span>
<span id="t1h_1_m" class="t s4"><strong><t t-esc="o.order_line[0].product_id.categ_id.name or ''"/></strong></span>
</t>

Лучший ответ

Hi,

At any moment you will be fetching all the products for generating the report values.Instead of taking all the products in the current database you should filter it.For products there is a selection type field named Product Type.Technical name for the field is detailed_type (Odoo V15).So you should fetch only those products for which the Product Type is set as Storable Product.Or if your requirement is to remove Service Type products you can also apply the corresponding domain.

Eg:  ('detailed_type', '=', 'product')  OR ('detailed_type', '!=', 'service') 

Regards

Аватар
Отменить
Лучший ответ

Hey Giel van Maarseveen,

    you have to check product type first if its stockable product then and then it will further.

Аватар
Отменить
Автор

In the way it is now it shows all the products, Service products and stockable products. I want the report only to show/print the stockable products. Is there a easy way to do this.