diff --git a/addons/website_sale/__openerp__.py b/addons/website_sale/__openerp__.py index 863c53b2329..8f4f5932977 100644 --- a/addons/website_sale/__openerp__.py +++ b/addons/website_sale/__openerp__.py @@ -13,8 +13,9 @@ OpenERP E-Commerce 'views/ecommerce.xml', 'views/pricelist.xml' ], - 'js': ['static/src/js/ecommerce.js'], - 'css': ['static/src/css/ecommerce.css'], + 'js': ['static/src/js/*.js'], + 'css': ['static/src/css/*.css'], + 'qweb': ['static/src/xml/*.xml'], 'installable': True, 'auto_install': True, } diff --git a/addons/website_sale/pricelist.py b/addons/website_sale/pricelist.py new file mode 100644 index 00000000000..92ceed90f98 --- /dev/null +++ b/addons/website_sale/pricelist.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import osv, fields + + +class product_pricelist(osv.osv): + _inherit = "product.pricelist" + _columns = { + 'code': fields.char('Promotionnal Code', size=64, required=True, translate=True), + } diff --git a/addons/website_sale/static/src/js/ecommerce.js b/addons/website_sale/static/src/js/ecommerce.js index 016f4556033..8d34fb95e57 100644 --- a/addons/website_sale/static/src/js/ecommerce.js +++ b/addons/website_sale/static/src/js/ecommerce.js @@ -22,4 +22,45 @@ $(document).ready(function (){ ev.preventDefault(); $('.oe_ecommerce form').toggle(); }); +}); + + +openerp.website = function(instance) { + + instance.website.sale = {}; + instance.website.sale.Checkout = instance.web.Widget.extend({ + template: 'Website.sale.Checkout', + events: { + 'click button[data-action=gotostep]': 'gotostep', + }, + start: function() { + console.log("instance.website.sale.Checkout", this); + return this._super.apply(this, arguments); + }, + goto: function (e) { + + }, + save: function () { + }, + }); +}; + + +$(document).ready(function () { + if (!$('.oe_placeholder_checkout').size()) + return; + // Init headless webclient + // TODO: Webclient research : use iframe embedding mode + // Meanwhile, let's HACK !!! + var s = new openerp.init(['web', 'website']); + s.web.WebClient.bind_hashchange = s.web.WebClient.show_common = s.web.blockUI = s.web.unblockUI = function() {}; + s.web.WebClient.include({ do_push_state: function() {} }); + var wc = new s.web.WebClient(); + wc.start(); + var instance = openerp.instances[wc.session.name]; + // Another hack since we have no callback when webclient has loaded modules. + instance.web.qweb.add_template('/website_sale/static/src/xml/ecommerce.xml'); + + var editor = new instance.website.sale.Checkout(instance.webclient); + editor.prependTo($('.oe_placeholder_checkout')); }); \ No newline at end of file diff --git a/addons/website_sale/static/src/xml/ecommerce.xml b/addons/website_sale/static/src/xml/ecommerce.xml new file mode 100644 index 00000000000..5241733b1d2 --- /dev/null +++ b/addons/website_sale/static/src/xml/ecommerce.xml @@ -0,0 +1,33 @@ + + + + +
+
+ +
+
+ Anim pariatur cliche... +
+
+
+
+ +
+
+ Anim pariatur cliche... +
+
+
+
+
+ +
diff --git a/addons/website_sale/views/ecommerce.xml b/addons/website_sale/views/ecommerce.xml index 2f691a73c18..cd1705be3be 100644 --- a/addons/website_sale/views/ecommerce.xml +++ b/addons/website_sale/views/ecommerce.xml @@ -212,7 +212,7 @@
Please Sign in or enter your informations


- or + or +
-
diff --git a/addons/website_sale/views/pricelist.xml b/addons/website_sale/views/pricelist.xml new file mode 100644 index 00000000000..70003191238 --- /dev/null +++ b/addons/website_sale/views/pricelist.xml @@ -0,0 +1,15 @@ + + + + + product.pricelist.website.form + product.pricelist + + + + + + + + +