diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 77f0f47569a..0bed25f87bc 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -150,6 +150,9 @@ module named account_voucher. 'test/test_edi_invoice.yml', 'test/account_report.yml', ], + "js": [ + 'static/src/js/edi_invoice.js' + ], 'installable': True, 'active': False, 'certificate': '0080331923549', diff --git a/addons/account/static/src/js/edi_invoice.js b/addons/account/static/src/js/edi_invoice.js new file mode 100644 index 00000000000..c31c803d665 --- /dev/null +++ b/addons/account/static/src/js/edi_invoice.js @@ -0,0 +1,50 @@ +/*--------------------------------------------------------- + * OpenERP Web_edi + *---------------------------------------------------------*/ +// +openerp.edi.InvoiceEdiView = Class.extend({ + init: function(element, edi){ + var self = this; + this.edi_document = eval(edi.document) + this.$element = element; + QWeb.add_template("/web_edi_invoice/static/src/xml/edi_invoice.xml"); + this.$_element = $('
') + .appendTo(document.body) + .delegate('#oe_edi_invoice_button_pay', 'click', {'edi': edi} , this.do_pay) + }, + start: function() { + }, + render: function(){ + template = "InvoiceEdiView"; + if (this.$current) { + this.$current.remove(); + } + this.$current = this.$_element.clone(true); + this.$current.empty().append($(QWeb.render(template, {'invoices': this.edi_document}))); + this.$element.append(this.$current); + }, + do_pay: function(e){ + $element = $(e.view.document.body) + token = e.data.edi.token + db = e.data.edi.db + var current_url = $(location).attr('href') + var pathName = current_url.substring(0, current_url.lastIndexOf('/') +1); + + if ($element.find('#oe_edi_invoice_rd_pay_paypal').attr('checked') == true) + { + alert('Pay Invoice using Paypal service'); + + } + if ($element.find('#oe_edi_invoice_rd_pay_google_checkout').attr('checked') == true) + { + alert('Pay Invoice using Google Checkout'); + } + if ($element.find('#oe_edi_invoice_rd_pay_bank').attr('checked') == true) + { + alert('Pay Invoice using Bankwire Trasnfer') + } + } +}); + +openerp.edi.forms.add('edi_center_account_invoice' , 'openerp.edi.InvoiceEdiView'); +// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/account/static/src/xml/edi_invoice.xml b/addons/account/static/src/xml/edi_invoice.xml new file mode 100644 index 00000000000..9f68c7fedf8 --- /dev/null +++ b/addons/account/static/src/xml/edi_invoice.xml @@ -0,0 +1,130 @@ +