This question has been flagged
1 Reply
4671 Views

I could show uom next to the price at products list on shop, product page and shopping cart, but I can't do it on the modal window that it's shown after pressing the button "add to cart" at products page. Wich is the name of that modal window? Thanks in advice


    

<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

<-- shows shows uom at shop -->

<template id="products_item" inherit_id="website_sale.products_item" name="Products Item Show UOM">

<xpath expr="//span[@t-field='product.price']" position="after">

<label>/</label>

<span t-field="product.uom_id.name" style="white-space: nowrap;"/>

</xpath>

</template>


<!-- shows uom at product page -->

<template id="product_price" inherit_id="website_sale.product_price" name="Product Price Show UOM">

<xpath expr="//b[@class='oe_price']" position="after">

<b>

<label>/</label>

<span t-field="product.uom_id.name" style="white-space: nowrap;"/>

</b>

</xpath>

</template>


<!-- shows uom at shopping cart -->

<template id="cart" inherit_id="website_sale.cart" name="Shopping Cart Show UOM">

<xpath expr="//span[@t-field='line.discounted_price']" position="after">

<label>/</label>

<span t-field="line.product_id.uom_id.name" style="white-space: nowrap;"/>

</xpath>

</template>

</data>

</openerp>

***

EDITED ON 29-01-2016

Take a look at this screen shots:

On this screen shot, uom it's shown, catalog price it's removed by another addon I made, and buttons are right translated. This view is website_sale.cart:

https://www.flickr.com/photos/136510940@N06/24684935235/in/dateposted-public/

This is the modal window of shopping cart. Uom its not show next to discounted price, catalog price it's not removed by my other addon (so this is not website_sale.cart view), and the button "Continue shopping" it's not translated. I need to know the name of this view:

 https://www.flickr.com/photos/136510940@N06/24058110133/in/dateposted-public/

***

Avatar
Discard

You need to see in your "Other addon" from which this view is pop up.

Author

My other addon doesn't pops up that view, it only hiddes public price, as seen on first screen shot. My problem it's to know the name of the view shown on my second screen shot, it's and standard view from odoo.

Edited my answer.

Best Answer

Hi Roberto,


I think following code will help you.

EDITED:

The window model is "modal", Found in the website_sale_options module.

<template id="cart_uom" inherit_id="website_sale_options.modal" name="Products Item Show UOM">

<xpath expr="//span[@t-field='product.price']" position="after">

<label>/</label>

<span t-field="product.uom_id.name" style="white-space: nowrap;"/>

</xpath>

</template>

Avatar
Discard
Author

The view website_sale.cart, it is not the same view as the view shown after pressing "add to cart" button on a product page. See that the last template of my code , inhertis website_sale.cart. At least, my code does nothing on that view, but it works clicking on "my cart", there it shows uom next to discounted price, as I spected. So, I know at leat 3 views related to cart (website_sale.cart, website_sale.products_add_to_cart and website_sale_options.products_add_to_cart). No one of them it's the view I'm looking for.

Can you post screen shot for which screen you want uom ?

Author

Yep, image links posted right now.

Author

Thanks dude! This is just what i'm looking for. Now I could modify that view. I will take a look to website_sale_options module to try to learn how to identify modal windows.

If you like this answer, you can do 1 up vote too.