[IMP] template to define both .content and .sidebar

bzr revid: al@openerp.com-20111018212258-ollsfl6h6n1qlhps
This commit is contained in:
Antony Lesuisse 2011-10-18 23:22:58 +02:00
parent f518a1b955
commit d0e5b8832d
3 changed files with 28 additions and 44 deletions

View File

@ -21,7 +21,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
on_document_loaded: function(docs){
this.doc = docs[0];
//console.log("docs",this.doc);
var template = "Edi." + this.doc.__model;
var template = "Edi." + this.doc.__model + ".content";
var param = {"widget":this, "doc":this.doc};
this.center = openerp.web.qweb.render(template, param);
//console.log(this.center);
@ -117,24 +117,5 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
},
});
openerp.edi.EdiViewCenterInvoice = openerp.web.Class.extend({
init: function(element, edi){
this.$_element = $('<div>')
.appendTo(document.body)
.delegate('#oe_edi_invoice_button_pay', 'click', {'edi': edi} , this.do_pay)
},
do_pay: function(e){
if ($element.find('#oe_edi_invoice_rd_pay_paypal').attr('checked') == 'checked') {
alert('Pay Invoice using Paypal service');
}
if ($element.find('#oe_edi_invoice_rd_pay_google_checkout').attr('checked') == 'checked') {
alert('Pay Invoice using Google Checkout');
}
if ($element.find('#oe_edi_invoice_rd_pay_bank').attr('checked') == 'checked') {
alert('Pay Invoice using Bankwire Trasnfer')
}
}
});
}
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,27 +1,5 @@
<template>
<t t-name="Edi.account.invoice">
<t t-if="!doc.reconciled">
<table width="100%">
<tr>
<td>
<b>Pay this Invoice in Online</b>
</td>
</tr>
<tr>
<td>
<hr/>
</td>
</tr>
<tr>
<td>
<input type="radio" id="oe_edi_invoice_rd_pay_paypal" name="oe_edi_invoice_rd_pay" value="paypal">Paypal</input>
<input type="radio" id="oe_edi_invoice_rd_pay_google_checkout" name="oe_edi_invoice_rd_pay" value="google">Google Checkout</input>
<input type="radio" id="oe_edi_invoice_rd_pay_bank" name="oe_edi_invoice_rd_pay" value="bank">Bank wire Transfer</input>
<button type="button" id="oe_edi_invoice_button_pay" name="oe_edi_invoice_button_pay">Pay</button>
</td>
</tr>
</table>
</t>
<t t-name="Edi.account.invoice.content">
<h1>Invoice <t t-esc="doc.internal_number"/>: <t t-esc="doc.amount_total"/><t t-esc="doc.currency_id[1]"/></h1>
<p>
<b><t t-esc="doc.company_id[1]"/></b><br/>
@ -117,4 +95,29 @@
</tr>
</table>
</t>
<t t-name="Edi.account.invoice.sidebar">
<t t-if="!doc.reconciled">
<table width="100%">
<tr>
<td>
<b>Pay this Invoice in Online</b>
</td>
</tr>
<tr>
<td>
<hr/>
</td>
</tr>
<tr>
<td>
<!-- TODO replace this with correct <form>s to payement gw -->
<input type="radio" id="oe_edi_invoice_rd_pay_paypal" name="oe_edi_invoice_rd_pay" value="paypal">Paypal</input>
<input type="radio" id="oe_edi_invoice_rd_pay_google_checkout" name="oe_edi_invoice_rd_pay" value="google">Google Checkout</input>
<input type="radio" id="oe_edi_invoice_rd_pay_bank" name="oe_edi_invoice_rd_pay" value="bank">Bank wire Transfer</input>
<button type="button" id="oe_edi_invoice_button_pay" name="oe_edi_invoice_button_pay">Pay</button>
</td>
</tr>
</table>
</t>
</t>
</template>

View File

@ -1,5 +1,5 @@
<template>
<t t-name="Edi.sale.order">
<t t-name="Edi.sale.order.content">
<h1>Order <t t-esc="doc.name"/>: <t t-esc="doc.amount_total"/><t t-esc="doc.currency_id[1]"/></h1>
<p>
<b><t t-esc="doc.company_id[1]"/></b><br/>