This question has been flagged
3 Replies
3050 Views

I am not getting my own pricelist inside the shop in website only public pricelist is visible in odoo12 community version

How to get my own pricelist visible..

Here is the code ...<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!--Adds pricelist above the product price in the website  -->
    <template id="product_inherit" inherit_id="website_sale.product">
        <xpath expr="//t[@t-call='website_sale.product_price']" position="before">
            <strong>Price List</strong>
            <table>
                <tr>
                    <th>Price List</th>
                       <th>Minimum Quantity</th>
                    <th>Product Discount</th>
                    <t t-set="website_sale_pricelists" t-value="product.env['product.pricelist.item'].search([('product_tmpl_id','=',product.id)])">
                           <t t-if="price_list.product_tmpl_id.id==product.id">
                          <th t-if="price_list.compute_price=='percentage'">Percent Price</th>
                          <th t-elif="price_list.compute_price=='fixed'">Fixed Price</th>
                    </t>
                    </t>
                    <th>Minimum Margin</th>
                    <th>Maximum Margin</th>
                </tr>
                <t t-foreach="website_sale_pricelists" t-as="price_list">
                    <t t-if="price_list.product_tmpl_id.id==product.id">
                        <tr>
                            <td><t t-esc="price_list.pricelist_id.name"/></td>
                            <td><t t-esc="price_list.min_quantity"/></td>
                            <td><t t-esc="price_list.price_discount"/></td>
                            <td t-if="price_list.compute_price=='percentage'"><t t-esc="price_list.percent_price"/></td>
                            <td t-elif="price_list.compute_price=='fixed'"><t t-esc="price_list.fixed_price"/></td>
                            <td><t t-esc="price_list.price_min_margin"/></td>
                            <td><t t-esc="price_list.price_max_margin"/></td>
                        </tr>                              
                    </t>
                </t>
            </table>  
        </xpath>
    </template>
</odoo>


Please help...

Thanks in ADVANCE

Avatar
Discard
Best Answer

please try this code and also check in user mode

 <t t-set="website_sale_pricelists" t-value="website.get_current_pricelist()"/>
                <t t-foreach="website_sale_pricelists" t-as="pricelist">
                    <t t-foreach="pricelist.item_ids" t-as="offer">
                        <t t-if="offer.product_tmpl_id.id==product.id">
                            <table>
                                <tr>
                                    <th>Price List</th>
                                    <th>Minimum Quantity</th>
                                    <th>Product Discount</th>
                                    <th t-if="offer.compute_price=='percentage'">Percent Price</th>
                                    <th t-elif="offer.compute_price=='fixed'">Fixed Price</th>
                                   
                                </tr>
                                <tr>
                                    <td><t t-esc="pricelist.name"/></td>
                                    <td><t t-esc="offer.min_quantity"/></td>
                                    <td><t t-esc="offer.price_discount"/></td>
                                    <td t-if="offer.compute_price=='percentage'"><t t-esc="offer.percent_price"/></td>
                                    <td t-elif="offer.compute_price=='fixed'"><t t-esc="offer.fixed_price"/></td>
                                </tr>
                            </table>                                           
                      </t>
                </t>
            </t>

Avatar
Discard
Best Answer

thanks

Avatar
Discard