From 1bcdc4dc2fd4b0b55077542ee698af891c704256 Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Thu, 16 Jan 2014 12:13:29 +0530 Subject: [PATCH] [IMP]: better table of content [IMP] : The user should not be able to delete a sale order line ,unless it's an option that has been added previously [IMP]: open the sent email link, it open the cms homepage, not the quote bzr revid: aja@tinyerp.com-20140116064329-1da392uplmsm01me --- addons/website_quotation/controllers/main.py | 1 + .../data/website_quotation_data.xml | 3 +- addons/website_quotation/models/order.py | 3 +- .../static/src/css/website_quotation.css | 75 ++++++++++++++++++- .../static/src/js/website_quotation.js | 8 +- .../views/website_quotation.xml | 19 +++-- 6 files changed, 96 insertions(+), 13 deletions(-) diff --git a/addons/website_quotation/controllers/main.py b/addons/website_quotation/controllers/main.py index 2e3f3513f6d..a9830f091af 100644 --- a/addons/website_quotation/controllers/main.py +++ b/addons/website_quotation/controllers/main.py @@ -117,6 +117,7 @@ class sale_quote(http.Controller): 'product_uom_qty': option.quantity, 'product_uom_id': option.uom_id.id, 'discount': option.discount, + 'is_optional': True, }) line = request.registry.get('sale.order.line').create(request.cr, SUPERUSER_ID, vals, context=request.context) option_obj.write(request.cr, SUPERUSER_ID, [option.id], {'line_id': line}, context=request.context) diff --git a/addons/website_quotation/data/website_quotation_data.xml b/addons/website_quotation/data/website_quotation_data.xml index 9592ccf7d66..58ef37f6240 100644 --- a/addons/website_quotation/data/website_quotation_data.xml +++ b/addons/website_quotation/data/website_quotation_data.xml @@ -13,12 +13,11 @@

Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:

- <% set signup_url = object.quote_url %>

You can access this document and pay online via our Customer Portal:

View ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} + href="${object.open_quotation()['url']}">View ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} ]]> diff --git a/addons/website_quotation/models/order.py b/addons/website_quotation/models/order.py index 040804fcac6..eda1d0f0977 100644 --- a/addons/website_quotation/models/order.py +++ b/addons/website_quotation/models/order.py @@ -73,6 +73,7 @@ class sale_order_line(osv.osv): _description = "Sales Order Line" _columns = { 'website_description': fields.html('Line Description'), + 'is_optional': fields.boolean('Optional Product') } def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None): res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, lang, update_tax, date_order, packaging, fiscal_position, flag, context) @@ -152,7 +153,7 @@ class sale_option_line(osv.osv): 'uom_id': fields.many2one('product.uom', 'Unit of Measure ', required=True), 'quantity': fields.float('Quantity', required=True), } - + _defaults = { 'quantity': 1, } diff --git a/addons/website_quotation/static/src/css/website_quotation.css b/addons/website_quotation/static/src/css/website_quotation.css index f44cf367e97..2ae5c3155e7 100644 --- a/addons/website_quotation/static/src/css/website_quotation.css +++ b/addons/website_quotation/static/src/css/website_quotation.css @@ -1,3 +1,74 @@ -.affix { - width : 260px; +.bs-sidebar.affix { + position: static; + margin-top: 30px; } + +.bs-sidenav { + margin-top: 30px; + margin-bottom: 30px; + padding-top: 10px; + padding-bottom: 10px; + text-shadow: 0 1px 0 #fff; + background-color: #f7f5fa; + border-radius: 5px; +} + +.bs-sidebar .nav > li > a { + display: block; + color: #716b7a; + padding: 5px 20px; +} +.bs-sidebar .nav > li > a:hover, +.bs-sidebar .nav > li > a:focus { + text-decoration: none; + background-color: #e5e3e9; + border-right: 1px solid #dbd8e0; +} +.bs-sidebar .nav > .active > a, +.bs-sidebar .nav > .active:hover > a, +.bs-sidebar .nav > .active:focus > a { + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-right: 1px solid #563d7c; +} + +.bs-sidebar .nav .nav { + display: none; + margin-bottom: 8px; +} +.bs-sidebar .nav .nav > li > a { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 30px; + font-size: 90%; +} + +@media (min-width: 992px) { + .bs-sidebar .nav > .active > ul { + display: block; + } + .bs-sidebar.affix, + .bs-sidebar.affix-bottom { + width: 213px; + } + .bs-sidebar.affix { + position: fixed; + top: 80px; + } + .bs-sidebar.affix-bottom { + position: absolute; + } + .bs-sidebar.affix-bottom .bs-sidenav, + .bs-sidebar.affix .bs-sidenav { + margin-top: 0; + margin-bottom: 0; + } +} +@media (min-width: 1200px) { + .bs-sidebar.affix-bottom, + .bs-sidebar.affix { + width: 263px; + } +} + diff --git a/addons/website_quotation/static/src/js/website_quotation.js b/addons/website_quotation/static/src/js/website_quotation.js index 2fcf5d7c832..243a8f84627 100644 --- a/addons/website_quotation/static/src/js/website_quotation.js +++ b/addons/website_quotation/static/src/js/website_quotation.js @@ -23,6 +23,7 @@ $(document).ready(function () { return false; }); + // automatically generate a menu from h1 and h1 tag in content var ul = null; var sub_li = null; @@ -31,17 +32,19 @@ $(document).ready(function () { $("section h1, section h2").each(function() { switch (this.tagName.toLowerCase()) { case "h1": + id = _.uniqueId('quote_header_') if (!ul) { ul = $('[data-id="quote_sidebar"]'); } - sub_li = $("
  • ").html('').appendTo(ul); + $(this).attr('id',id) + sub_li = $("
  • ").html(''+$(this).text()+'').appendTo(ul); sub_ul = null; break; case "h2": id = _.uniqueId('quote_') if (sub_li) { if (!sub_ul) { - sub_ul = $("