Skip to Content
Menu
This question has been flagged

Hi!

I would like to add for all products in the ecommerce website the information of relevant suppliers maintained in the product template.

I maintained e.g. 3 suppliers for the product and I add in the view website_sale.product the field product.seller_ids but then I receive as result

product.supplierinfo(48, 49, 50)


How can I receive as result

supplier A

supplier B

supplier C?


Avatar
Discard

you have the ids for suppliers, run ["product.supplier"].browse(... [supplier ids], ...) render them in your xml.

Best Answer
Hello Der Emil GmbH,

you can achieve via using foreach loop in qweb like:
<t t-foreach="product.seller_ids" t-as="vendor">
    <h1><t t-esc="vendor.name" /></h1>
</t>

Avatar
Discard
Author Best Answer

Thanks for these information, but I am a beginner and I do not really know how to run ["product.supplier"].browse(... [supplier ids], ...) render them in your xml.
I add in the view website_sale.product the following part of code:

<div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1" id="product_details">
                <h1 itemprop="name" t-field="product.name">Product Name</h1>
                <h1 itemprop="name" t-field="product.seller_ids">vendor</h1>

but how can I run / browse and render in this view?
Avatar
Discard

As per your requirement you need to know about Qweb Reporting engine that how it works. Read how to create a report in odoo from scratch using Qweb reporting engine.

1- http://learnopenerp.blogspot.com/2016/11/how-to-create-qweb-reports-in-openerp.html

2- http://learnopenerp.blogspot.com/2016/09/how-to-create-custom-reports-in-odoo.html

I hope this will helps.

Thanks & Regard

Hello Der Emil GmbH

below line realce with my answered code, it will help you.

<h1 itemprop="name" t-field="product.seller_ids">vendor</h1>

Thanks

Related Posts Replies Views Activity
1
Oct 23
1460
4
Oct 23
2967
2
Oct 24
1816
1
Apr 23
804
1
Mar 22
1647