0
votes

I have added many products with different Unit of Measure and weight. In Sales Order line when customer confirm's the order e.g. visits the https:///shop/confirmation page after checkout.

The page shows quantity & Unit of Measure along with the price but, it doesn't show the product weight

Lets say I have a product called Katal fish which has a weight of 500.00 gm. Here, unit of measure is set to gm (Gram) Now, if any user buy 3 units of Katal fish the Sales order line shows

quantity UOM
3.000 gm 

But, it should be 3 * 500 gm or, 1500 gm.

It seems like in the quantity field odoo is showing number of products on the cart only without any weight.

I just want to show the weight along with the quantity.

Quantity Weight UOM
3 X 500gm 
7 X 1KG 

etc.

Please check the screenshots for more clarification of the issue: https://imgur.com/a/qVkaIwn

Order Confirmation Page

Product Weight is set

Note that, Odoo's QWeb Report For Quotation of the order has the same problem! I tried to modify the template by adding

<t field='line.product_weight'> 

but, it seems like there are no such fields.

2

2 Answers

2
votes

you need to inherit template confirmation.

<template id="your_id" inherit_id="website_sale.confirmation" name="name template">
<xpath expr="//div[@class='oe_cart']/table[1]/thead/tr/th[2]" position="after">
    <th>Weight</th>
</xpath>
<xpath expr="//div[@class='oe_cart']/table[1]/tbody/tr/td[2]" position="after">
    <td>
        <div id="product_weight">
            <span t-field="line.product_id.product_weight"/>
        </div>
    </td>
</xpath>
<xpath expr="//div[@class='oe_cart']/table[1]/tfooter/tr[1]/td[1]" position="replace">
    <td class='noborder' colspan="3"></td>
</xpath>
<xpath expr="//div[@class='oe_cart']/table[1]/tfooter/tr[2]/td[1]" position="replace">
    <td class='noborder' colspan="3"></td>
</xpath>
<xpath expr="//div[@class='oe_cart']/table[1]/tfooter/tr[3]/td[1]" position="replace">
    <td class='noborder' colspan="3"></td>
</xpath>
</template>

hope this is help....

0
votes

I was able to solve the issue by modifying Mihir's answer

Replacing line.product_id.product_weight with line.product_id.weight like below:

<xpath expr="//div[@class='oe_cart']/table[1]/tbody/tr/td[2]" position="after">
    <td>
        <div id="product_weight">
            <span t-field="line.product_id.weight"/>
        </div>
    </td>
</xpath>