odoo/addons/website_sale_quote/views/website_sale_quote.xml

329 lines
18 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="pricing" name="Price">
<ul class="wizard pull-right">
<li></li>
</ul>
<section id="quote" class="container">
<table class="table table-hover">
<thead>
<tr>
<th>Products</th>
<th>Tax</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr t-foreach="quotation.order_line" t-as="line">
<td>
<div t-field="line.name"/>
</td>
<td>
<div id="quote_qty">
<t t-esc="line.product_uom_qty"/>
</div>
</td>
<td>
<strong>
<div t-field="line.price_unit"
t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'
t-att-style="line.discount and 'text-decoration: line-through' or ''"
t-att-class="line.discount and 'text-danger' or ''"/>
<!-- TODO: apply monetary widget formating -->
<div t-if="line.discount">
<t t-esc="'%.2f' % ((1-line.discount) * line.price_unit)"/>
</div>
</strong>
</td>
<td>
<div
t-field="line.price_subtotal"
t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
</td>
<td>
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;unlink=True" class="mb8 js_update_line_json pull-right">
<span class="fa fa-trash-o"></span>
</a>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><h3>Total</h3></td>
<td class="text-left" colspan="2">
<h3>
<strong data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/>
</h3>
</td>
</tr>
</tbody>
</table>
</section>
<section id="terms" class="container" t-if="quotation.note">
<h2>Terms &amp; Conditions</h2>
<p t-field="quotation.note"/>
</section>
</template>
<template id="change_quantity" inherit_option_id="website_sale_quote.pricing" name="Change Quantity">
<xpath expr="//div[@id='quote_qty']" position="replace">
<div class="input-group">
<span class="input-group-addon">
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;remove=True" class="mb8 js_update_line_json">
<span class="fa fa-minus"/>
</a>
</span>
<input type="text" class="js_quantity form-control" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
<span class="input-group-addon">
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }" class="mb8 js_update_line_json">
<span class="fa fa-plus"/>
</a>
</span>
</div>
</xpath>
</template>
<template id="chatter">
<div id="chat" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-comment fa-flip-horizontal"></i> Recent Comments
</h3>
</div>
<div class="panel-body">
<ul class="list-group">
<t t-foreach="quotation.message_ids" t-as="message">
<t t-if="message.subtype_id.name == 'Sales Order Confirmed' or message.subtype_id.name == 'Discussions'" >
<li class="list-group-item">
<div class="row">
<div class="col-xs-2 col-md-1" t-if="message.author_id.image_small">
<img t-att-src="'data:image/png;base64,' + message.author_id.image_small" class="img-circle img-responsive" alt="" /></div>
<div class="col-xs-10 col-md-11">
<div>
<a href="http://www.jquery2dotnet.com/2013/10/google-style-login-page-desing-usign.html"/>
<t t-raw="message.body"/>
<div class="mic-info">
By: <a href="#"><t t-esc="message.author_id.name"/></a> on <t t-esc="message.date"/>
</div>
</div>
</div>
</div>
</li>
</t>
</t>
</ul>
</div>
</div>
<form id="post" accept-charset="UTF-8" method="POST" t-att-action="'/quote/%%s/post#post' %% quotation.id">
<textarea rows="3" id="new_message" name="new_message" placeholder="Your Comment....." class="form-control span7"> </textarea>
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post your Comment</button>
</form>
</template>
<template id="so_quotation" name="Product Quotation">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_sale_quote/static/src/js/sale_quote.js"></script>
<t t-raw="head or ''"/>
</t>
<div class="container">
<div class="row mt16">
<div class="col-md-3 navbar">
<ul class="nav nav-pills nav-stacked mt32">
<li class="active">
<a href="#introduction" data-toggle="tab">Introduction</a>
</li>
<li t-foreach="quotation.order_line" t-as="line">
<a t-att-href="'#%s'% line.id" data-toggle="tab">
<t t-raw="line.product_id.name"/>
</a>
</li>
<li><a href="#quote" data-toggle="tab">Pricing</a></li>
<li><a href="#terms" data-toggle="tab">Terms &amp; Conditions</a></li>
</ul>
</div>
<div class="col-md-9">
<div class="text-center">
<div class="btn-group btn-group-lg" t-if="quotation.state in ('draft', 'sent', 'waiting_date')">
<a class="btn btn-success fa fa-check" type="submit" t-href="/quote/#{ quotation.id }/accept">
Accept
</a>
<a class="btn btn-info fa fa-comment" type="submit" href="#chat">
Feedback
</a>
<a class="btn btn-danger fa fa-times" data-toggle="modal" data-target="#modeldecline">
Refuse
</a>
</div>
</div>
<h1 class="page-header">
<span t-if="quotation.state in ('draft','sent','cancel')">Your Quotation</span>
<span t-if="quotation.state not in ('draft','sent','cancel')">Your Order</span>
<em t-esc="quotation.name"/>
<small t-field="quotation.state"/>
</h1>
<div class="alert alert-warning alert-dismissable" t-if="quotation.state == 'cancel'">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
<strong>This quotation has been canceled.</strong> Contact <t t-field="quotation.user_id"/> to ask a new one.
</div>
<div class="modal fade" id="modeldecline" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Reason</h4>
</div>
<form id="post" accept-charset="UTF-8" method="POST" t-att-action="'/quote/%%s/post#post' %% (quotation.id)">
<div class="modal-body">
<textarea rows="3" id="decline_message" name="decline_message" placeholder="Your Comment....." class="form-control span7"> </textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post</button>
</div>
</form>
</div>
</div>
</div>
<a id="introduction"/>
<div class="row mt32">
<div class="col-md-6">
<div>
<label class="col-sm-3 text-right">Bill To:</label>
<div class="col-sm-9">
<div t-field="quotation.partner_invoice_id" t-field-options='{
"widget": "contact",
"fields": ["address", "name", "phone", "email"]
}'/>
</div>
</div>
<div t-if="quotation.partner_shipping_id.id != quotation.partner_invoice_id.id">
<label class="col-sm-3 text-right">Ship To:</label>
<div class="col-sm-9">
<div t-field="quotation.partner_shipping_id" t-field-options='{
"widget": "contact",
"fields": ["address", "name", "phone"]
}'/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<label class="col-sm-5 text-right">Your Contact:</label>
<div class="col-sm-7">
<div t-field="quotation.user_id" t-field-options='{
"widget": "contact",
"fields": ["name", "phone", "email"]
}'/>
</div>
</div>
<div class="row">
<label class="col-sm-5 text-right">Quote Date:</label>
<div class="col-sm-7">
<span t-field="quotation.date_order"/>
</div>
<div class="clearfix"/>
<div t-if="quotation.client_order_ref">
<label class="col-sm-5 text-right">Your Reference:</label>
<div class="col-sm-7">
<span t-field="quotation.client_order_ref"/>
</div>
</div>
</div>
</div>
</div>
<a id="offer"/>
<div t-field="quotation.website_description"/>
<t t-foreach="quotation.order_line" t-as="line">
<a t-att-id="line.id"/>
<div t-field="line.website_description"/>
</t>
<a id="pricing"/>
<t t-call="website_sale_quote.pricing"/>
<a id="options"/>
<t t-call="website_sale_quote.optional_products"/>
<a id="discussion"/>
<t t-call="website_sale_quote.chatter"/>
</div>
</div>
</div>
</t>
</template>
<template id="optional_products">
<div class="container mt32" t-if="quotation.options">
<h3>Optional Products &amp; Services:</h3>
<div class='row mt16'>
<t t-foreach="quotation.options" t-as="option">
<t t-if="not option.add_to_line">
<div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
<div class='mt16 text-center'>
<a href="#" t-field="option.product_id.name"/>
<span t-field="option.product_id.image_small" t-field-options='{"widget": "image", "class": "img-rounded"}'/>
</div>
<a type="submit" t-href="./add_line/#{ option.id }/?order=#{ quotation.id }&amp;product=#{option.product_id.id}" class="btn btn-primary btn-xs js_add_line_json">Add To Quotation
</a>
</div>
</t>
</t>
</div>
</div>
</template>
<template id="so_template" name="SO Template">
<t t-call="website.layout">
<div class="container">
<div class="row">
<div class="col-md-4" id="sidebar">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#template_introduction" data-toggle="tab">Contact Data</a></li>
<li><a href="#template_introduction" data-toggle="tab">Our Offer</a></li>
<t t-foreach="template.quote_line" t-as="line">
<li><a t-att-href="'#%s'% line.id" data-toggle="tab"><t t-raw="line.product_id.name_template"/> </a></li>
</t>
<li><a href="#templateterms" data-toggle="tab">Terms &amp; Conditions</a></li>
</ul>
</div>
<div class="col-md-8 tab-content">
<div id="template_introduction" t-field="template.website_description"/>
<t t-foreach="template.quote_line" t-as="line">
<section class="tab-pane" t-att-id="line.id">
<div t-field="line.website_description" class="oe_structure"/>
</section>
</t>
<section id="templateterms" class="tab-pane">
<div class="container panel panel-default">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Terms &amp; Conditions</strong></h2>
<p class="lead" t-field="template.note"/>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</t>
</template>
</data>
</openerp>