From 72c5fe278bab4c52f5efb70364534b3ad54936fd Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 21 Aug 2012 01:40:08 +0200 Subject: [PATCH 01/39] generate url from the widget if needed bzr revid: al@openerp.com-20120820234008-olfcnxj7np6hwwgz --- addons/pad/res_company.py | 3 +- addons/pad/static/src/css/etherpad.css | 51 ++++++++++---------------- addons/pad/static/src/js/pad.js | 45 +++++++++++++++-------- addons/pad/static/src/xml/pad.xml | 22 ++++++----- addons/pad_project/project_task.py | 3 -- 5 files changed, 63 insertions(+), 61 deletions(-) diff --git a/addons/pad/res_company.py b/addons/pad/res_company.py index bd955cd0481..703e655219b 100644 --- a/addons/pad/res_company.py +++ b/addons/pad/res_company.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- from osv import fields, osv -DEFAULT_PAD_TEMPLATE = 'http://beta.etherpad.org/p/%(db)s-%(model)s-%(salt)s' +DEFAULT_PAD_TEMPLATE = 'http://pad.openerp.com/p/%(db)s-%(model)s-%(salt)s' +DEFAULT_PAD_TEMPLATE = '' class company_pad(osv.osv): _inherit = 'res.company' diff --git a/addons/pad/static/src/css/etherpad.css b/addons/pad/static/src/css/etherpad.css index a0240afcab7..8ea7972071e 100644 --- a/addons/pad/static/src/css/etherpad.css +++ b/addons/pad/static/src/css/etherpad.css @@ -1,52 +1,39 @@ -.oe_etherpad_head{ +.oe_pad_head { width: 100%; display: block; - padding-left:3px; - cursor:pointer; + padding: 4px; } -.oe_etherpad_fullscreen div.oe_etherpad_head .oe_normal { - display: none; + +.oe_pad_readonly { + border: 1px solid #ddd; + padding: 8px; } -.oe_etherpad_normal div.oe_etherpad_head .oe_fullscreen { - display: none; -} -.oe_etherpad_fullscreen { + +.oe_pad_fullscreen { position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: white; - z-index:10001 !important; -} -.etherpad_default{ - width: 100%; - height: 450px; -} -.oe_etherpad_fullscreen .etherpad_default{ - height: 100% + z-index: 1000; } -.etherpad_body{ - overflow:hidden; +.oe_pad_fullscreen .oe_pad_content { + height: 100%; } -.etherpad_readonly{ - width: 100%; - height: 450px; - overflow:auto; +.etherpad_readonly ul, .etherpad_readonly ol { + margin-before: 1em; + margin-after: 1em; + margin-start: 0px; + margin-end: 0px; + padding-start: 40px !important; } -.etherpad_readonly ul,.etherpad_readonly ol{ - -webkit-margin-before: 1em; - -webkit-margin-after: 1em; - -webkit-margin-start: 0px; - -webkit-margin-end: 0px; - -webkit-padding-start: 40px !important; -} -.etherpad_readonly ul li{ +.etherpad_readonly ul li{ list-style-type: disc; } -.etherpad_readonly ol li{ +.etherpad_readonly ol li{ list-style-type: decimal; } .etherpad_readonly .indent li{ diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index 6384eb72da8..314c751785a 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -1,32 +1,47 @@ openerp.pad = function(instance) { -instance.web.form.FieldPad = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, { +instance.web.form.FieldPad = instance.web.form.AbstractField.extend({ template: 'FieldPad', - initialize_content: function() { + start: function() { + this._super(); var self = this; - this.$textarea = undefined; - this.$element.find('div.oe_etherpad_head').click(function(ev) { - self.$element.toggleClass('oe_etherpad_fullscreen').toggleClass('oe_etherpad_normal'); + this.$element.find('div.oe_pad_head').click(function(ev) { + self.$element.toggleClass('oe_pad_fullscreen'); + }); + this.on("change:effective_readonly", this, function() { + this.render_value(); }); }, - set_value: function(value_) { - this._super(value_); - this.render_value(); + set_value: function(val) { + var self = this; + var _super = self._super; + _super.apply(self,[val]); + if (val === false || val === "") { + self.field_manager.dataset.call('pad_generate_url').then(function(r) { + _super.apply(self,[r]); + self.render_value(); + }); + } else { + self.render_value(); + } }, render_value: function() { + console.log("display"); var self = this; var value = this.get('value'); - if(value !== false) { - var url = value.split('\n')[0]; + + if (!_.str.startsWith(value, "http")) { + self.$('.oe_pad_content').html(instance.web.qweb.render('FieldPad.unconfigured')); + } else { if (!this.get("effective_readonly")) { var pad_username = this.session.username; - var code = ''; - this.$element.find('div.oe_etherpad_default').html(code); + var code = ''; + this.$('.oe_pad_content').html(code); } else { - $.get(url+'/export/html').success(function(data) { - self.$element.html('
'+data+'
'); + $.get(value+'/export/html').success(function(data) { + self.$('.oe_pad_content').html('
'+data+'
'); }).error(function() { - self.$element.text('Unable to load pad'); + self.$('.oe_pad_content').text('Unable to load pad'); }); } } diff --git a/addons/pad/static/src/xml/pad.xml b/addons/pad/static/src/xml/pad.xml index e128fb183fb..58266a2594a 100644 --- a/addons/pad/static/src/xml/pad.xml +++ b/addons/pad/static/src/xml/pad.xml @@ -2,17 +2,19 @@ - - -
-
- Fullscreen - Return to Record -
-
+
+
+ Fullscreen
- +
+
+ + + Please configure your etherpad server.
+ OpenERP Entreprise customers may safely use pad.openerp.com as a server using the following template:
+
+ http://pad.openerp.com/p/%(db)s-%(model)s-%(salt)s +
- diff --git a/addons/pad_project/project_task.py b/addons/pad_project/project_task.py index 46c2c54cd46..513fc3fef5d 100644 --- a/addons/pad_project/project_task.py +++ b/addons/pad_project/project_task.py @@ -9,6 +9,3 @@ class task(osv.osv): _columns = { 'description_pad': fields.char('Description PAD', size=250) } - _defaults = { - 'description_pad': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), - } From 6f28fde4ae74f368b9017b41d49c89f309a63021 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Tue, 21 Aug 2012 12:07:18 +0530 Subject: [PATCH 02/39] [IMP]Renamed EAN13,supply method visible only when mrp is installed and suppliers tab comes when purchase is installed bzr revid: dhr@tinyerp.com-20120821063718-uobafa8ij65an5b0 --- addons/mrp/mrp_view.xml | 3 +++ addons/product/product.py | 2 +- addons/product/product_view.xml | 4 ---- addons/purchase/purchase_view.xml | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index c394544574d..30480901b29 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -987,6 +987,9 @@ product.product + + + diff --git a/addons/product/product.py b/addons/product/product.py index ae99711a5ec..586d241d998 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -526,7 +526,7 @@ class product_product(osv.osv): 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"), - 'ean13': fields.char('EAN13', size=13, help="The numbers encoded in EAN-13 bar codes are product identification numbers."), + 'ean13': fields.char('EAN13/Code', size=13, help="The numbers encoded in EAN-13 bar codes are product identification numbers."), 'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price')), 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price')), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 70651a0a795..871283791ef 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -87,7 +87,6 @@ - @@ -137,9 +136,6 @@ - - - diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index aec55bf93c2..f513e2a60e8 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -554,5 +554,20 @@ + + + + + product.normal.supplier.form.inherit + product.product + + + + + + + + + From 95517df97cddd164a80ebe3d0836a45d60a04c74 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Tue, 21 Aug 2012 14:13:50 +0530 Subject: [PATCH 03/39] [IMP]Changes in event_sale_view and purchase_requisition as per changes in supply_method bzr revid: dhr@tinyerp.com-20120821084350-487odxa5rk2k9nze --- addons/event_sale/event_sale_view.xml | 2 +- addons/purchase_requisition/purchase_requisition_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index 82c1c05b714..53e8a4cc18f 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -9,7 +9,7 @@ - + diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml index 188f81b6cbe..a1b270934e2 100644 --- a/addons/purchase_requisition/purchase_requisition_view.xml +++ b/addons/purchase_requisition/purchase_requisition_view.xml @@ -182,7 +182,7 @@ product.product - + From 2d7817bbe57ae4e7c701279af2d595ad5501f09d Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Tue, 21 Aug 2012 15:46:32 +0530 Subject: [PATCH 04/39] [ADD] Added autosize functionality for textarea bzr revid: bde@tinyerp.com-20120821101632-gx3nu1xpfv3si1la --- addons/web/__openerp__.py | 1 + addons/web/static/src/js/view_form.js | 26 +++----------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/addons/web/__openerp__.py b/addons/web/__openerp__.py index 822d2fa3cbf..8c2a8fa0909 100644 --- a/addons/web/__openerp__.py +++ b/addons/web/__openerp__.py @@ -38,6 +38,7 @@ This module provides the core of the OpenERP Web Client. "static/lib/backbone/backbone.js", "static/lib/cleditor/jquery.cleditor.js", "static/lib/py.js/lib/py.js", + "static/lib/jquery.autosize/jquery.autosize.js", "static/src/js/boot.js", "static/src/js/corelib.js", "static/src/js/coresetup.js", diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4f3f1c62f13..3efee9a140f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2342,8 +2342,8 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we render_value: function() { var show_value = instance.web.format_value(this.get('value'), this, ''); this.$textarea.val(show_value); - if (show_value && this.view.options.resize_textareas) { - this.do_resize(this.view.options.resize_textareas); + if (show_value) { + this.$textarea.autosize(); } }, is_syntax_valid: function() { @@ -2363,26 +2363,6 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we focus: function($element) { this.$textarea.focus(); }, - do_resize: function(max_height) { - max_height = parseInt(max_height, 10); - var $input = this.$textarea, - $div = $('
').width($input.width()), - new_height; - $div.text($input.val()); - _.each('font-family,font-size,white-space'.split(','), function(style) { - $div.css(style, $input.css(style)); - }); - $div.appendTo($('body')); - new_height = $div.height(); - if (new_height < 90) { - new_height = 90; - } - if (!isNaN(max_height) && new_height > max_height) { - new_height = max_height; - } - $div.remove(); - $input.height(new_height); - }, }); /** @@ -2407,7 +2387,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc self._updating_editor = false; this.$textarea = this.$element.find('textarea'); var width = ((this.node.attrs || {}).editor_width || 468); - var height = ((this.node.attrs || {}).editor_height || 100); + var height = ((this.node.attrs || {}).editor_height || 250); this.$textarea.cleditor({ width: width, // width not including margins, borders or padding height: height, // height not including margins, borders or padding From d1ef48537c2959b115a3133b7ed09c546b1c9b85 Mon Sep 17 00:00:00 2001 From: "Dharti Ratani (OpenERP)" Date: Tue, 21 Aug 2012 15:46:37 +0530 Subject: [PATCH 05/39] [IMP]Change made for procurement method and stock and expected variations section to appear only for stockable product bzr revid: dhr@tinyerp.com-20120821101637-o83hcputt5y3d9n9 --- addons/product/product_view.xml | 2 +- addons/stock/product_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 871283791ef..2559b127dda 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -86,7 +86,7 @@ - + diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 1efc552bfa6..abad5b9ec21 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -98,7 +98,7 @@ - +