Skip to content

Commit

Permalink
Merge pull request #3 in ODOO/sale from release/9.0/LABS-166-add-medi…
Browse files Browse the repository at this point in the history
…cament-context-to-website to 9.0

* commit '99aced2885f3116fe0d932a2cbe6786fa920c942':
  [FIX] Update ReadMe in website_sale_product_display_name
  [FIX] Overrides in website_sale_product_display_name
  • Loading branch information
lasley committed Jun 10, 2016
2 parents 5d53c9d + 99aced2 commit 9685284
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
13 changes: 5 additions & 8 deletions website_sale_product_display_name/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===========================
Website Sale Pricelist Hide
===========================
=================================
Website Sale Product Display Name
=================================

This module hides items from website sale view that are not within the
current pricelist, instead of the default behavior of showing non-discounted
price.
Shows Product Template display name on Website sale views, instead of name

Installation
============
Expand All @@ -22,8 +20,7 @@ Usage
Known Issues / Roadmap
======================

* No tests - have to write a tour based one, it seems
* Does not account for expired, or not yet actives pricelists
* Add tests

Bug Tracker
===========
Expand Down
53 changes: 31 additions & 22 deletions website_sale_product_display_name/views/website_sale_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,35 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->

<openerp>
<data noupdate="1">

<template id="products_item" inherit_id="website_sale.products_item" name="Products item display name">
<xpath expr="//span[@t-field='product.image']" position="attributes">
<attribute name="t-att-alt" t-value="product.display_name" />
</xpath>
<xpath expr="//*[@t-field='product.name']" position="attributes">
<attribute name="t-field" t-value="product.display_name" />
</xpath>
</template>

<template id="product" inherit_id="website_sale.product" name="Product display name">
<xpath expr="//t[@t-value='product.name']" position="replace">
<t t-set="additional_title" t-value="product.display_name"/>
</xpath>
<xpath expr="//*[@t-field='product.name']" position="attributes">
<attribute name="t-field" t-value="product.display_name" />
</xpath>
</template>
<odoo>

<template id="products_item" inherit_id="website_sale.products_item" name="Products item display name">
<xpath expr="//span[@t-field='product.image']" position="attributes">
<attribute name="t-att-alt" t-value="product.display_name" />
</xpath>
<xpath expr="//a[@t-field='product.name']" position="replace">
<a itemprop="name"
t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']>1 else None))"
t-field="product.display_name"
/>
</xpath>
</template>

<template id="product" inherit_id="website_sale.product" name="Product display name">
<xpath expr="//t[@t-value='product.name']" position="replace">
<t t-set="additional_title" t-value="product.display_name"/>
</xpath>
<xpath expr="//span[@t-field='product.name']" position="replace">
<span t-field="product.display_name"/>
</xpath>
<xpath expr="//span[@t-field='product.image']" position="attributes">
<attribute name="t-field-options">
{"widget": "image", "class": "product_detail_img", "alt-field": "display_name"}
</attribute>
</xpath>
<xpath expr="//h1[@t-field='product.name']" position="replace">
<h1 itemprop="name" t-field="product.display_name">Product Name</h1>
</xpath>
</template>

</data>
</openerp>
</odoo>

0 comments on commit 9685284

Please sign in to comment.