[MERGE] forward port of branch saas-3 up to 6feb5f7
[odoo/odoo.git] / addons / website_quote / views / website_quotation.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5   <template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Quote frontend assets">
6     <xpath expr="." position="inside">
7       <script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
8       <script type="text/javascript" src="/website_quote/static/lib/jSignature/jSignature.min.js"></script>
9       <link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
10     </xpath>
11   </template>
12
13   <template id="pricing" name="Price">
14       <section data-snippet-id="title">
15           <h1 class="page-header">Pricing</h1>
16       </section>
17       <section id="quote">
18           <table class="table">
19               <thead>
20                   <tr>
21                       <th>Products</th>
22                       <th>Quantity</th>
23                       <th>Taxes</th>
24                       <th></th>
25                       <th class="text-right">Unit Price</th>
26                       <th class="text-right">Price</th>
27                   </tr>
28               </thead>
29               <tbody>
30                   <tr t-foreach="quotation.order_line" t-as="line">
31                       <td>
32                           <div t-field="line.name"/>
33                       </td>
34                       <td>
35                           <div id="quote_qty">
36                               <span t-field="line.product_uom_qty"/>
37                               <span t-field="line.product_uom"/>
38                           </div>
39                       </td>
40                       <td>
41                           <div t-foreach="line.tax_id" t-as="tax">
42                               <t t-esc="tax.name"/>
43                           </div>
44                       </td>
45                       <td>
46                           <strong t-if="line.discount" class="text-info">
47                               <t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>% discount
48                           </strong>
49                       </td>
50                       <td>
51                           <strong class="text-right">
52                               <div t-field="line.price_unit"
53                                   t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'
54                                   t-att-style="line.discount and 'text-decoration: line-through' or ''"
55                                   t-att-class="line.discount and 'text-danger' or ''"/>
56                               <!-- TODO: apply monetary widget formating -->
57                               <div t-if="line.discount">
58                                   <t t-esc="'%.2f' % ((1-line.discount / 100.0) * line.price_unit)"/>
59                               </div>
60                           </strong>
61                       </td>
62                       <td>
63                           <div class="text-right"
64                               t-field="line.price_subtotal"
65                               t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
66                       </td>
67                       <td>
68                           <a t-attf-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;unlink=True&amp;token=#{ quotation.access_token }" class="mb8 js_update_line_json pull-right hidden-print" t-if="line.option_line_id">
69                               <span class="fa fa-trash-o"></span>
70                           </a>
71                       </td>
72                   </tr>
73                   <tr>
74                       <td></td><td></td><td></td><td></td>
75                       <td class="text-right"><strong>Subtotal:</strong></td>
76                       <td class="text-right">
77                           <strong data-id="total_amount" t-field="quotation.amount_untaxed" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/>
78                       </td>
79                   </tr>
80                   <tr>
81                       <td></td><td></td><td></td><td></td>
82                       <td class="text-right">Taxes:</td>
83                       <td class="text-right">
84                           <span data-id="total_amount" t-field="quotation.amount_tax" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/>
85                       </td>
86                   </tr>
87                   <tr>
88                       <td></td><td></td><td></td><td></td>
89                       <td class="text-right"><strong>Total:</strong></td>
90                       <td class="text-right">
91                           <strong data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "quotation.pricelist_id.currency_id"}'/>
92                       </td>
93                   </tr>
94               </tbody>
95           </table>
96       </section>
97       <t t-call="website_quote.quotation_toolbar"/>
98       <section id="terms" class="container" t-if="quotation.note">
99           <h2 class="page-header">Terms &amp; Conditions</h2>
100           <p t-field="quotation.note"/>
101       </section>
102   </template>
103
104   <template id="change_quantity" inherit_id="website_quote.pricing" active="False" customize_show="True" name="Change Quantity">
105       <xpath expr="//div[@id='quote_qty']" position="replace">
106           <div class="input-group oe_website_spinner">
107               <span class="input-group-addon hidden-print">
108                   <a t-attf-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;remove=True&amp;token=#{ quotation.access_token }" class="mb8 js_update_line_json">
109                       <span class="fa fa-minus"/>
110                   </a>
111               </span>
112               <input type="text" class="js_quantity form-control" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
113               <span class="input-group-addon hidden-print">
114                   <a t-attf-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;token=#{ quotation.access_token }" class="mb8 js_update_line_json">
115                       <span class="fa fa-plus"/>
116                   </a>
117               </span>
118           </div>
119       </xpath>
120   </template>
121
122   <template id="chatter">
123       <h1 class="page-header hidden-print">History</h1>
124       <ul class="media-list hidden-print" id="comments-list">
125           <t t-foreach="quotation.message_ids" t-as="message">
126               <li class="media" t-if="message.type &lt;&gt; 'comment' or message.subtype_id">
127                   <div class="media-body">
128                       <img class="media-object pull-left" t-att-src="website.image_url(message.author_id, 'image_small')" style="width: 50px; margin-right: 10px;"/>
129                       <div class="media-body">
130                           <h5 class="media-heading">
131                               <span t-field="message.author_id"/> <small>on <span t-field="message.date"/></small>
132                           </h5>
133                           <div t-field="message.body"/>
134                       </div>
135                   </div>
136               </li>
137           </t>
138       </ul>
139   </template>
140
141   <!-- Options:Quotation Chatter: user can reply -->
142   <template id="opt_quotation_chatter_post_complete_comment" name="Allow Comments" customize_show="True" inherit_id="website_quote.chatter">
143       <xpath expr="//h1" position="after">
144           <section class="mb32 css_editable_mode_hidden hidden-print">
145               <form id="comment" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/post" method="POST">
146                   <img class="img pull-left img-rounded" t-att-src="website.image_url(user_id.partner_id, 'image_small')" style="width: 50px; margin-right: 10px;"/>
147                   <div class="pull-left mb32" style="width: 75%%">
148                       <textarea rows="4" name="comment" class="form-control" placeholder="Send us a note..."></textarea>
149                       <button type="submit" class="btn btn-primary mt8">Send</button>
150                   </div>
151               </form>
152           </section>
153           <div class="clearfix"/>
154       </xpath>
155   </template>
156
157   <template id="quotation_toolbar">
158       <div class="text-center hidden-print" t-if="quotation.state in ('draft', 'sent', 'waiting_date')">
159           <a class="btn btn-success fa fa-check" data-toggle="modal" data-target="#modelaccept">
160               Accept
161           </a>
162           <a class="btn btn-info fa fa-comment" type="submit" href="#discussion">
163               Feedback
164           </a>
165           <a class="btn btn-danger fa fa-times" data-toggle="modal" data-target="#modeldecline">
166               Reject
167           </a>
168       </div>
169   </template>
170
171   <template id="so_quotation" name="Product Quotation">
172       <t t-call="website.layout">
173         <body data-spy="scroll" data-target=".navspy" data-offset="50">
174             <div class="container o_website_quote">
175               <div class="row mt16">
176                   <div class="col-md-3">
177                       <div class="bs-sidebar">
178                           <div class="text-center hidden-print" t-if="quotation.state in ('draft', 'sent', 'waiting_date')" style="padding: 10px">
179                               <a t-if="order_valid" class="btn btn-primary btn-block fa fa-check" data-toggle="modal" data-target="#modelaccept">
180                                   Accept Order
181                               </a>
182                               <a t-if="not order_valid" href="#discussion" class="btn btn-info btn-block">
183                                   <strong>This offer expired!</strong><br/>
184                                   Contact us for new quote.
185                               </a>
186                               <div class="mt8" t-if="order_valid">
187                                   <a type="submit" href="#discussion">
188                                       Ask Changes
189                                   </a> or 
190                                   <a data-toggle="modal" data-target="#modeldecline">
191                                       Reject
192                                   </a>
193                               </div>
194                           </div>
195                           <hr class="mt0 mb0"/>
196                           <t t-call="website_quote.navigation_menu"/>
197                           <hr class="mt0 mb0"/>
198                           <div t-if="order_valid" class="text-center hidden-print">
199                               <input type="hidden" t-att-value="quotation.validity_date" id="validity_date"/>
200                               <div class="mt8" t-if="days_valid &gt; 0">
201                                   <strong>This offer expires in</strong>
202                                   <div class="fa fa-clock-o fa-2x day_counter mt8 mb16">
203                                       <t t-esc="days_valid"/>
204                                       <t t-if="days_valid &gt; 1">
205                                           days
206                                       </t>
207                                       <t t-if="days_valid &lt;= 1">
208                                           day
209                                       </t>
210                                   </div>
211                               </div>
212
213
214                               <div class="text-center mb16" t-if="quotation.amount_undiscounted &gt; quotation.amount_untaxed">
215                                   <p class="text-muted mb8">Your advantage:</p>
216                                   <t t-if="quotation.amount_untaxed == quotation.amount_total">
217                                       <strong t-field="quotation.amount_total"
218                                           t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
219                                       <strong t-field="quotation.amount_undiscounted"
220                                           t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'
221                                           style="text-decoration: line-through"
222                                           class="text-danger"/>
223                                   </t>
224                                   <t t-if="quotation.amount_untaxed != quotation.amount_total">
225                                       <strong t-field="quotation.amount_untaxed"
226                                           t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
227                                       <strong t-field="quotation.amount_undiscounted"
228                                           t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'
229                                           style="text-decoration: line-through"
230                                           class="text-danger"/>
231                                       <br />
232                                       (<span t-field="quotation.amount_total"
233                                           t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/> Incl. tax)
234                                   </t>
235                               </div>
236                          </div>
237                       </div>
238                   </div>
239                   <div class="col-md-9">
240                       <div class="alert alert-success alert-dismissable" t-if="message==1">
241                           <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
242                           Your message has been successfully sent!
243                       </div>
244                       <div class="alert alert-warning alert-dismissable" t-if="message==2">
245                           <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
246                           This quotation has been rejected. <a href="#discussion">Contact us</a> if you want a new one.
247                       </div>
248                       <div class="alert alert-warning alert-dismissable" t-if="message==3">
249                           <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
250                           This order has been validated. Thanks for your trust
251                           and do not hesitate to <a href="#discussion">contact us</a> for
252                           any question.
253                       </div>
254                       <a id="introduction"/>
255                       <h1 class="page-header mt16">
256                           <span t-if="quotation.state in ('draft','sent','cancel')">Your Quotation</span>
257                           <span t-if="quotation.state not in ('draft','sent','cancel')">Your Order</span>
258                           <em t-esc="quotation.name"/>
259                           <small t-field="quotation.state"/>
260                           <div groups="base.group_website_publisher" t-ignore="true" class="pull-right css_editable_mode_hidden">
261                               <a class="btn btn-info hidden-print" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s' % (quotation._name, quotation.id)">Update Quote</a>
262                           </div>
263                       </h1>
264
265                       <div class="modal fade" id="modelaccept" role="dialog" aria-hidden="true">
266                         <div class="modal-dialog">
267                           <form id="accept" method="POST" t-attf-action="/quote/accept/#{quotation.id}/?token=#{quotation.access_token}" class="js_accept_json modal-content">
268                             <div class="modal-header">
269                               <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&amp;times;</button>
270                               <h4 class="modal-title">Validate Order</h4>
271                             </div>
272                             <div class="modal-body" id="sign-dialog">
273                               <p>
274                                   I agree that by signing this proposal, I
275                                   accept it on the behalf of <b t-field="quotation.company_id"/>,
276                                   for an amount of 
277                                   <b data-id="total_amount" t-field="quotation.amount_total"
278                                     t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'/>
279                                   with payment terms: <b t-field="quotation.payment_term"/>.
280                               </p>
281                               <div id="signer" class="form-group">
282                                   <label class="control-label" for="name">Your Name:</label>
283                                   <input type="text" name="signer" id="name" class="form-control"/>
284                               </div>
285                             </div>
286                             <div class="modal-footer">
287                                 <button type="submit" t-attf-class="btn btn-primary">Sign Order</button> or
288                                 <button type="button" class="btn btn-link" data-dismiss="modal" style="padding: 0">Cancel</button>
289                             </div>
290                           </form>
291                         </div>
292                       </div>
293
294                       <div class="alert alert-warning alert-dismissable" t-if="quotation.state == 'cancel'">
295                           <button type="button" class="close hidden-print" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
296                           <strong>This quotation has been canceled.</strong> Contact us to get a new quote.
297                       </div>
298
299                       <div class="modal fade" id="modeldecline" role="dialog" aria-hidden="true">
300                         <div class="modal-dialog">
301                           <form id="decline" method="POST" t-attf-action="/quote/#{quotation.id}/#{quotation.access_token}/decline" class="modal-content">
302                             <div class="modal-header">
303                               <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&amp;times;</button>
304                               <h4 class="modal-title">Reject This Quote</h4>
305                             </div>
306                             <div class="modal-body">
307                               <p>
308                                   Tell us why you are refusing this quotation, this will help us improve our services.
309                               </p>
310                               <textarea rows="4" name="decline_message" placeholder="Your feedback....." class="form-control"/>
311                             </div>
312                             <div class="modal-footer">
313                                 <button type="submit" t-att-id="quotation.id" class="btn btn-primary">Reject</button> or
314                                 <button type="button" class="btn btn-link" data-dismiss="modal" style="padding: 0">Cancel</button>
315                             </div>
316                           </form>
317                         </div>
318                       </div>
319
320                       <div class="row mt32">
321                           <div class="col-md-6">
322                               <div class="row">
323                                   <label class="col-sm-4 text-right">Customer:</label>
324                                   <div class="col-sm-8">
325                                       <div t-field="quotation.partner_id"/>
326                                   </div>
327                               </div>
328                               <div class="row">
329                                   <label class="col-sm-4 text-right">Bill To:</label>
330                                   <div class="col-sm-8">
331                                       <div t-field="quotation.partner_invoice_id" t-field-options='{
332                                           "widget": "contact",
333                                           "fields": ["address", "name", "phone", "email"]
334                                           }'/>
335                                   </div>
336                               </div>
337                               <div t-if="quotation.partner_shipping_id.id != quotation.partner_invoice_id.id" class="row">
338                                   <label class="col-sm-4 text-right">Ship To:</label>
339                                   <div class="col-sm-8">
340                                       <div t-field="quotation.partner_shipping_id" t-field-options='{
341                                         "widget": "contact",
342                                         "fields": ["address", "name", "phone"]
343                                         }'/>
344                                   </div>
345                               </div>
346                           </div>
347                           <div class="col-md-6">
348                               <div class="row">
349                                   <label class="col-sm-5 text-right">Your Contact:</label>
350                                   <div class="col-sm-7">
351                                       <div t-field="quotation.user_id" t-field-options='{
352                                           "widget": "contact",
353                                           "fields": ["name", "phone", "email"]
354                                           }'/>
355                                   </div>
356                               </div>
357                               <div class="row">
358                                   <label class="col-sm-5 text-right">Quote Date:</label>
359                                   <div class="col-sm-7">
360                                       <span t-field="quotation.date_order"/>
361                                   </div>
362                                   <div class="clearfix"/>
363                                   <div t-if="quotation.client_order_ref">
364                                       <label class="col-sm-5 text-right">Your Reference:</label>
365                                       <div class="col-sm-7">
366                                           <span t-field="quotation.client_order_ref"/>
367                                       </div>
368                                   </div>
369                               </div>
370                           </div>
371                       </div>
372
373                       <a id="offer"/>
374                       <div t-field="quotation.website_description"/>
375
376                       <t t-foreach="quotation.order_line" t-as="line">
377                           <a t-att-id="line.id"/>
378                           <div t-field="line.website_description"/>
379                       </t>
380     
381                       <div class="oe_structure"/>
382
383                       <a id="pricing"/>
384                       <t t-call="website_quote.pricing"/>
385                       
386                       <a id="options"/>
387                       <t t-call="website_quote.optional_products"/>
388
389                       <a id="discussion"/>
390                       <t t-call="website_quote.chatter"/>
391                   </div>
392               </div>
393             </div>
394         </body>
395       </t>
396   </template>
397
398   <template id="navigation_menu">
399     <div class="hidden-print navspy" t-ignore="true" role="complementary">
400         <ul class="nav bs-sidenav" data-id="quote_sidebar">
401             <li><a href="#introduction">Introduction</a></li>
402         </ul>
403     </div>
404   </template>
405
406   <!-- Options:Quotation Signature -->
407   <template id="opt_quotation_signature" name="Ask Signature" customize_show="True" inherit_id="website_quote.so_quotation">
408       <xpath expr="//div[@id='sign-dialog']" position="inside">
409         <div class="panel panel-default mt16 mb0" id="drawsign">
410             <div class="panel-heading">
411                 <div class="pull-right">
412                     <a id="sign_clean" class="btn btn-xs">Clear</a>
413                 </div>
414                 <strong>Draw your signature</strong>
415             </div>
416             <div id="signature" class="panel-body" style="padding: 0"/>
417         </div>
418       </xpath>
419   </template>
420
421   <template id="optional_products">
422     <div class="container mt32" t-if="option">
423         <section data-snippet-id="title">
424             <h1 class="page-header">Options</h1>
425         </section>
426         <section id="options">
427             <table class="table table-hover">
428                 <thead>
429                     <tr>
430                         <th>Products</th>
431                         <th>Description</th>
432                         <th></th>
433                         <th class="text-right">Price</th>
434                     </tr>
435                 </thead>
436                 <tbody>
437                     <tr t-foreach="quotation.options" t-as="option">
438                         <t t-if="not option.line_id">
439                             <td>
440                                 <div t-field="option.product_id.name"/>
441                             </td>
442                             <td>
443                                 <div t-field="option.name"/>
444                             </td>
445                             <td>
446                                 <strong t-if="option.discount" class="text-info">
447                                     <t t-esc="((option.discount % 1) and '%s' or '%d') % option.discount"/>% discount
448                                 </strong>
449                             </td>
450                             <td>
451                                 <strong class="text-right">
452                                     <div t-field="option.price_unit"
453                                     t-field-options='{"widget": "monetary", "display_currency": "quotation.pricelist_id.currency_id"}'
454                                     t-att-style="option.discount and 'text-decoration: line-through' or ''"
455                                     t-att-class="option.discount and 'text-danger' or ''"/>
456                                     <div t-if="option.discount">
457                                         <t t-esc="'%.2f' % ((1-option.discount / 100.0) * option.price_unit)"/>
458                                     </div>
459                                 </strong>
460                             </td>
461                             <td class="pull-right">
462                                 <a t-attf-href="/quote/add_line/#{ option.id }/#{ quotation.id }/#{ quotation.access_token }" class="mb8 hidden-print">
463                                     <span class="fa fa-shopping-cart"/>
464                                 </a>
465                             </td>
466                         </t>
467                     </tr>
468                 </tbody>
469             </table>
470         </section>
471     </div>
472   </template>
473
474   <template id="so_template" name="SO Template">
475     <t t-call="website.layout">
476         <body data-spy="scroll" data-target=".navspy" data-offset="50">
477             <div class="container o_website_quote">
478                 <div class="row mt16">
479                     <div class="col-md-3">
480                         <div class="bs-sidebar">
481                             <div class="hidden-print navspy" role="complementary" t-ignore="True">
482                                 <ul class="nav bs-sidenav" data-id="quote_sidebar"/>
483                             </div>
484                         </div>
485                     </div>
486                     <div class="col-md-9">
487                         <div class="alert alert-info alert-dismissable" t-ignore="True">
488                             <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
489                             <p>
490                                 <strong>Template Header:</strong> this content
491                                 will appear on all quotations using this
492                                 template.
493                             </p>
494                             <p class="text-muted">
495                                 Titles with style <i>Heading 1</i> and
496                                 <i>Heading 2</i> will be used to generate the
497                                 table of content automatically.
498                             </p>
499                         </div>
500                         <div id="template_introduction" t-field="template.website_description"/>
501                         <t t-foreach="template.quote_line" t-as="line">
502                             <div class="alert alert-info alert-dismissable" t-ignore="True">
503                                 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
504                                 Product: <strong t-esc="line.product_id.name"/>:
505                                 this content will appear on the quotation only if this
506                                 product is put on the quote.
507                             </div>
508                             <div t-field="line.website_description"/>
509                         </t>
510                         <t t-foreach="template.options" t-as="option_line">
511                             <div class="alert alert-info alert-dismissable" t-ignore="True">
512                                 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&amp;times;</button>
513                                 Optional Product: <strong t-esc="option_line.product_id.name"/>:
514                                 this content will appear on the quotation only if this
515                                 product is used in the quote.
516                             </div>
517                             <div t-field="option_line.website_description"/>
518                         </t>
519                         <section id="terms" class="container" t-if="template.note">
520                             <h1 class="page-header" t-ignore="True">Terms &amp; Conditions</h1>
521                             <p t-field="template.note"/>
522                         </section>
523                     </div>
524                 </div>
525             </div>
526         </body>
527         </t>
528   </template>
529
530   <template id="website.layout_footer_copyright" inherit_id="website.layout" name="Footer Copyright">
531       <xpath expr="//footer" position="inside">
532           <div class="container mt16 mb8">
533               <div class="pull-right" t-ignore="true" t-if="not editable">
534                   Powered by <a class="label label-danger" href="http://www.odoo.com/page/website-builder">Odoo</a>,
535                   an awesome <a href="http://www.odoo.com/page/crm">Open Source CRM</a>.
536               </div>
537               <div class="pull-left text-muted">
538                   Copyright &amp;copy; <span t-field="res_company.name">Company name</span>
539               </div>
540           </div>
541       </xpath>
542   </template>
543
544
545 </data>
546 </openerp>