Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Show UOM at shop

By
Roberto Barreiro
on 1/28/16, 7:45 AM 644 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/

***

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

Hardikgiri Goswami
on 1/29/16, 4:48 AM

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.

Roberto Barreiro
on 1/29/16, 5:09 AM

Edited my answer.

Hardikgiri Goswami
on 1/29/16, 5:22 AM
2

Hardikgiri Goswami

--Hardikgiri Goswami--
1123
| 2 1 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 1/29/16, 3:12 AM

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>

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.

Roberto Barreiro
on 1/29/16, 3:50 AM

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

Hardikgiri Goswami
on 1/29/16, 4:28 AM

Yep, image links posted right now.

Roberto Barreiro
on 1/29/16, 4:49 AM

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.

Roberto Barreiro
on 1/29/16, 5:41 AM

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

Hardikgiri Goswami
on 1/29/16, 5:44 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/28/16, 7:45 AM
Seen: 644 times
Last updated: 1/29/16, 5:38 AM