[MERGE] Sync with trunk

bzr revid: rim@openerp.com-20140207163324-0fj6qsqs79bvutx6
This commit is contained in:
Richard Mathot (OpenERP) 2014-02-07 17:33:24 +01:00
commit 1a7d7a3f55
20 changed files with 120 additions and 49 deletions

View File

@ -1601,7 +1601,6 @@
<label for="value_amount" string="Amount To Pay" attrs="{'invisible':[('value','=','balance')]}"/>
<div attrs="{'invisible':[('value','=','balance')]}">
<field name="value_amount" class="oe_inline"/>
<label string="%%" class="oe_inline" attrs="{'invisible':['!',('value','=','procent')]}" />
</div>
</group>
<group string="Due Date Computation">

View File

@ -96,6 +96,55 @@
<field name="factor">1.0</field>
</record>
<!--Americanization of units of measure-->
<record id="product_uom_lb" model="product.uom">
<field name="name">lb(s)</field>
<field name="category_id" ref="product_uom_categ_kgm"/>
<field name="factor">2.20462</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_oz" model="product.uom">
<field name="name">oz(s)</field>
<field name="category_id" ref="product_uom_categ_kgm"/>
<field name="factor">35.274</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_inch" model="product.uom">
<field name="name">inch(es)</field>
<field name="category_id" ref="uom_categ_length"/>
<field name="factor">39.3701</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_foot" model="product.uom">
<field name="name">foot(ft)</field>
<field name="category_id" ref="uom_categ_length"/>
<field name="factor">3.28084</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_mile" model="product.uom">
<field name="name">mile(s)</field>
<field name="category_id" ref="uom_categ_length"/>
<field name="factor_inv" eval="1609.34"/>
<field name="uom_type">bigger</field>
</record>
<record id="product_uom_floz" model="product.uom">
<field name="name">fl oz</field>
<field name="category_id" ref="product_uom_categ_vol"/>
<field name="factor">33.814</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_qt" model="product.uom">
<field name="name">qt</field>
<field name="category_id" ref="product_uom_categ_vol"/>
<field name="factor">1.05669</field>
<field name="uom_type">smaller</field>
</record>
<record id="product_uom_gal" model="product.uom">
<field name="name">gal(s)</field>
<field name="category_id" ref="product_uom_categ_vol"/>
<field name="factor_inv" eval="3.78541"/>
<field name="uom_type">bigger</field>
</record>
<!--
... to here, it should be in product_demo but we cant just move it

View File

@ -12,4 +12,15 @@
qty = self._compute_qty(cr, uid, from_uom_id, qty, to_uom_id)
assert qty == 1.02, "Qty is not correspond."
assert price == 2000000.0, "Price is not correspond."
-
I convert Liters into Gallons with price.
-
!python {model: product.uom}: |
from_uom_id = ref("product_uom_litre")
to_uom_id = ref("product_uom_gal")
price = 2
qty = 30.28
price = self._compute_price(cr, uid, from_uom_id, price, to_uom_id)
qty = self._compute_qty(cr, uid, from_uom_id, qty, to_uom_id)
assert qty == 8, "Qty does not correspond."
assert round(price,2) == 7.57, "Price does not correspond."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -12,8 +12,8 @@
website.BannerTour = website.Tour.extend({
id: 'banner',
name: "Insert a banner",
path: '/',
name: "Build a page",
path: '/page/website.homepage',
init: function (editor) {
var self = this;
self.steps = [
@ -48,12 +48,13 @@
{
waitFor: '.oe_overlay_options .oe_options:visible',
element: '#wrap [data-snippet-id=carousel]:first .carousel-caption',
sampleText: 'My Title',
placement: 'top',
title: "Customize banner's text",
content: "Click in the text and start editing it. Click continue once it's done.",
template: self.popover({ next: "Continue" }),
},
{
waitNot: '#wrap [data-snippet-id=carousel]:first .carousel-caption:contains("Your Banner Title")',
element: '.oe_overlay_options .oe_options',
placement: 'left',
title: "Customize the banner",

View File

@ -213,7 +213,7 @@
</html>
</template>
<template id="layout_logo_show" inherit_option_id="website.layout" name="Show Logo">
<template id="layout_logo_show" inherit_id="website.layout" inherit_option_id="website.layout" name="Show Logo">
<xpath expr="//header//a[@class='navbar-brand']" position="replace">
<a href="/" class="navbar-brand logo">
<img src="/logo.png"/>
@ -638,11 +638,11 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
</template>
<template id="company_description" name="Company Description">
<address>
<div t-field="res_company.name">Name</div>
<address itemscope="itemscope" itemtype="http://schema.org/Organization">
<div itemprop="name" t-field="res_company.name">Name</div>
<br />
<div><i class="fa fa-phone"/> <span t-field="res_company.phone"/></div>
<div><i class="fa fa-envelope"/> <span t-field="res_company.email"/></div>
<div><i class="fa fa-phone"/> <span itemprop="telephone" t-field="res_company.phone"/></div>
<div><i class="fa fa-envelope"/> <span itemprop="email" t-field="res_company.email"/></div>
</address>
<a t-att-href="res_company.google_map_link()" target="_BLANK">
<img class="thumbnail img-responsive" t-att-src="res_company.google_map_img()" />
@ -724,18 +724,20 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
</template>
<template id="contact">
<address t-ignore="true" class="mb0">
<div t-att-class="'name' not in fields and 'css_non_editable_mode_hidden'"><span t-esc="name"/></div>
<div t-if="address and 'address' in fields" class='css_editable_mode_hidden'>
<i class='fa fa-map-marker'/> <span t-raw="address.replace('\n', options.get('no_tag_br') and ', ' or '&lt;br/&gt; &amp;nbsp; &amp;nbsp; ')"/>
<address t-ignore="true" class="mb0" itemscope="itemscope" itemtype="http://schema.org/Organization">
<div t-att-class="'name' not in fields and 'css_non_editable_mode_hidden'"><span itemprop="name" t-esc="name"/></div>
<div itemprop="address" itemscope="itemscope" itemtype="http://schema.org/PostalAddress">
<div t-if="address and 'address' in fields" class='css_editable_mode_hidden'>
<i class='fa fa-map-marker'/> <span itemprop="streetAddress" t-raw="address.replace('\n', options.get('no_tag_br') and ', ' or '&lt;br/&gt; &amp;nbsp; &amp;nbsp; ')"/>
</div>
<div t-if="city and 'city' in fields" class='css_editable_mode_hidden'>
<i class='fa fa-map-marker'/> <span itemprop="addressLocality" t-raw="city"/>, <span itemprop="addressCountry" t-raw="country_id"/>
</div>
<div t-if="phone and 'phone' in fields" class='css_editable_mode_hidden'><i class='fa fa-phone'/> <span itemprop="telephone" t-esc="phone"/></div>
<div t-if="mobile and 'mobile' in fields" class='css_editable_mode_hidden'><i class='fa fa-mobile-phone'/> <span itemprop="telephone" t-esc="mobile"/></div>
<div t-if="fax and 'fax' in fields" class='css_editable_mode_hidden'><i class='fa fa-file-text-o'/> <span itemprop="faxNumber" t-esc="fax"/></div>
<div t-if="email and 'email' in fields" class='css_editable_mode_hidden'><i class='fa fa-envelope'/> <span itemprop="email" t-esc="email"/></div>
</div>
<div t-if="city and 'city' in fields" class='css_editable_mode_hidden'>
<i class='fa fa-map-marker'/> <span t-raw="city"/>, <span t-raw="country_id"/>
</div>
<div t-if="phone and 'phone' in fields" class='css_editable_mode_hidden'><i class='fa fa-phone'/> <span t-esc="phone"/></div>
<div t-if="mobile and 'mobile' in fields" class='css_editable_mode_hidden'><i class='fa fa-mobile-phone'/> <span t-esc="mobile"/></div>
<div t-if="fax and 'fax' in fields" class='css_editable_mode_hidden'><i class='fa fa-file-text-o'/> <span t-esc="fax"/></div>
<div t-if="email and 'email' in fields" class='css_editable_mode_hidden'><i class='fa fa-envelope'/> <span t-esc="email"/></div>
</address>
</template>

View File

@ -48,9 +48,9 @@
</div>
<ul class="media-list">
<li t-foreach="event_ids" t-as="event" class="media">
<div class="media-body">
<div itemscope="itemscope" itemtype="http://schema.org/Event" class="media-body">
<h4 class="media-heading">
<a t-att-class="event.state == 'done' and 'text-success'" t-attf-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span t-field="event.name"> </span></a>
<a itemprop="url" t-att-class="event.state == 'done' and 'text-success'" t-attf-href="/event/#{ slug(event) }/#{(not event.menu_id) and 'register/' or ''}"><span itemprop="name" t-field="event.name"> </span></a>
<small t-if="not event.website_published" class="label label-danger">not published</small>
</h4>
<div>
@ -59,9 +59,9 @@
</t>
</div>
<div>
<i class="fa fa-clock-o"></i> <span t-field="event.date_begin"> </span> <i>to</i> <span t-field="event.date_end"> </span>
<i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin"> </span> <i>to</i> <span itemprop="endDate" t-field="event.date_end"> </span>
</div>
<div t-field="event.address_id" t-field-options='{
<div itemprop="location" t-field="event.address_id" t-field-options='{
"widget": "contact",
"fields": ["city"]
}'/>
@ -223,11 +223,11 @@
<template id="event_details">
<t t-call="website_event.layout">
<div class="container">
<h1 class="text-center" t-field="event.name"></h1>
<div itemscope="itemscope" itemtype="http://schema.org/Event" class="container">
<h1 itemprop="name" class="text-center" t-field="event.name"></h1>
<h4 class="text-center text-muted">
<i class="fa fa-clock-o"></i> <span t-field="event.date_begin"/> to
<span t-field="event.date_end"/>
<i class="fa fa-clock-o"></i> <span itemprop="startDate" t-field="event.date_begin"/> to
<span itemprop="endDate" t-field="event.date_end"/>
</h4>
<h4 class="text-center text-muted"
t-field="event.address_id" t-field-options='{
@ -258,7 +258,7 @@
<template id="event_description_full">
<t t-call="website_event.event_details">
<div class="col-md-8">
<div t-field="event.description"></div>
<div itemprop="description" t-field="event.description"></div>
<div class="clearfix"/>
<ul class="media-list" id="comment">
<li t-foreach="event.website_message_ids" t-as="comment" class="media">
@ -288,7 +288,7 @@
<a t-att-href="event.google_map_link()" target="_BLANK">
<img t-att-src="event.google_map_img()" width="100%%"/>
</a>
<div class="mt16 mb8" t-field="event.address_id" t-field-options='{
<div itemprop="location" class="mt16 mb8" t-field="event.address_id" t-field-options='{
"widget": "contact",
"fields": ["address", "phone", "mobile", "fax", "email"]
}'/>

View File

@ -22,7 +22,7 @@
<template id="event_description_full" inherit_id="website_event.event_description_full" inherit_option_id="website_event.event_description_full" name="Event's Ticket form">
<xpath expr="//div[@t-field='event.description']" position="before">
<form t-attf-action="/event/add_cart?event_id=#{ event.id }" method="post" t-if="event.event_ticket_ids">
<table class="table table-striped">
<table itemprop="offers" class="table table-striped">
<thead>
<tr>
<th>Ticket Type</th>
@ -33,17 +33,19 @@
</tr>
</thead>
<tbody>
<tr t-foreach="event.event_ticket_ids" t-as="ticket">
<td>
<div t-field="ticket.name"/>
<div><small t-field="ticket.product_id.description_sale"/></div>
<tr itemscope="itemscope" itemtype="http://data-vocabulary.org/Offer" t-foreach="event.event_ticket_ids" t-as="ticket">
<td itemscope="itemscope" itemtype="http://data-vocabulary.org/Product">
<div itemprop="name" t-field="ticket.name"/>
<div><small itemprop="description" t-field="ticket.product_id.description_sale"/></div>
</td>
<td><span t-field="ticket.deadline"/></td>
<td><span itemprop="priceValidUntil" t-field="ticket.deadline"/></td>
<td>
<t t-if="ticket.price or editable"><span t-field="ticket.price" t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
<meta itemprop="price" t-att-content="ticket.price"/>
<meta itemprop="priceCurrency" t-att-content="website.pricelist_id.currency_id.name"/>
</t>
<t t-if="not ticket.price and not editable">
<span>Free</span>

View File

@ -50,17 +50,18 @@
</template>
<template id="products_cart" name="Shopping cart">
<div itemscope="itemscope" itemtype="http://schema.org/Product">
<div class="ribbon-wrapper">
<div class="ribbon btn btn-danger">Sale</div>
</div>
<div class="oe_product_image">
<a t-attf-href="/shop/product/{{ slug(product) }}/?{{ keep_query('category', 'search', 'filters') }}">
<span t-field="product.image" t-field-options='{"widget": "image"}'/>
<a itemprop="url" t-attf-href="/shop/product/{{ slug(product) }}/?{{ keep_query('category', 'search', 'filters') }}">
<span itemprop="image" t-field="product.image" t-field-options='{"widget": "image"}'/>
</a>
</div>
<section>
<h5><strong><a t-attf-href="/shop/product/{{ slug(product) }}/?{{ keep_query('category', 'search', 'filters') }}" t-field="product.name"/></strong></h5>
<div class="product_price" t-if="product.product_variant_ids">
<h5><strong><a itemprop="name" t-attf-href="/shop/product/{{ slug(product) }}/?{{ keep_query('category', 'search', 'filters') }}" t-field="product.name"/></strong></h5>
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price" t-if="product.product_variant_ids">
<b>
<t t-if="abs(product.product_variant_ids[0].lst_price - product.product_variant_ids[0].price) &gt; 0.2">
<del class="text-danger"
@ -72,10 +73,14 @@
<span t-field="product.product_variant_ids[0].price" t-field-options='{
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
}'>
</span>
<meta itemprop="price" t-att-content="product.product_variant_ids[0].price"/>
<meta itemprop="priceCurrency" t-att-content="website.pricelist_id.currency_id.name"/>
</b>
</div>
</section>
</div>
</template>
<template id="products" name="Products">
@ -210,7 +215,7 @@
<template id="product_description" inherit_option_id="website_sale.products_cart" name="Product Description">
<xpath expr="//div[@class='product_price']" position="before">
<div class="text-info oe_subdescription oe_shadow" t-field="product.description_sale"/>
<div class="text-info oe_subdescription" t-field="product.description_sale"/>
<div itemprop="description" class="text-info oe_subdescription" t-field="product.description_sale"/>
</xpath>
</template>
@ -261,7 +266,7 @@
<link rel='stylesheet' href='/website_sale/static/src/css/website_mail.css'/>
</t>
<t t-set="additional_title" t-value="product.name"/>
<div id="wrap" class="js_sale">
<div itemscope="itemscope" itemtype="http://schema.org/Product" id="wrap" class="js_sale">
<section class="container mt8">
<div class="row">
@ -289,10 +294,10 @@
<section class="container oe_website_sale" id="product_detail">
<div class="row">
<div class="col-sm-7 col-md-7 col-lg-7">
<span t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
<span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
</div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
<h1 t-field="product.name">Product Name</h1>
<h1 itemprop="name" t-field="product.name">Product Name</h1>
<meta itemprop="url" t-attf-content="/shop/product/{{ slug(product) }}"/>
<form action="/shop/add_cart/" class="js_add_cart_json" method="POST">
<input type="hidden" t-if="len(product.product_variant_ids) == 1" name="product_id" t-att-value="product.product_variant_ids[0].id"/>
<t t-if="len(product.product_variant_ids) &gt; 1">
@ -308,7 +313,7 @@
</label>
</t>
<div class="product_price mt16" t-if="product.product_variant_ids">
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16" t-if="product.product_variant_ids">
<h4>
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<span class="text-danger" style="text-decoration: line-through;"
@ -324,6 +329,8 @@
"widget": "monetary",
"display_currency": "website.pricelist_id.currency_id"
}'/>
<meta itemprop="price" t-att-content="product.product_variant_ids[0].price"/>
<meta itemprop="priceCurrency" t-att-content="website.pricelist_id.currency_id.name"/>
</h4>
</div>
<button class="btn btn-primary btn-lg mt8">Add to Cart</button>
@ -339,7 +346,7 @@
</div>
</div>
</section>
<div t-field="product.website_description" class="oe_structure mt16" id="product_full_description"/>
<div itemprop="description" t-field="product.website_description" class="oe_structure mt16" id="product_full_description"/>
</div>
</t>
</template>