From 1607b1ddc7793f81d477e8d8c738bc7ebcfff162 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Tue, 30 Oct 2012 18:17:27 +0530 Subject: [PATCH 001/313] [FIX] product_margin: Fix header translation issue lp bug: https://launchpad.net/bugs/937856 fixed bzr revid: psi@tinyerp.com-20121030124727-tm5vdpld7oiwpjlx --- addons/product_margin/wizard/product_margin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_margin/wizard/product_margin.py b/addons/product_margin/wizard/product_margin.py index 61137a5e51e..8063e33707f 100644 --- a/addons/product_margin/wizard/product_margin.py +++ b/addons/product_margin/wizard/product_margin.py @@ -64,7 +64,7 @@ class product_margin(osv.osv_memory): #get the current product.margin object to obtain the values from it product_margin_obj = self.browse(cr, uid, ids, context=context)[0] - context = {'invoice_state' : product_margin_obj.invoice_state} + context.update({'invoice_state' : product_margin_obj.invoice_state}) if product_margin_obj.from_date: context.update({'date_from': product_margin_obj.from_date}) if product_margin_obj.to_date: From f82f13f44d648ea130485ee1bfea0c26f37c0b62 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Tue, 30 Oct 2012 18:28:49 +0530 Subject: [PATCH 002/313] [IMP] product_margin: improve the code bzr revid: psi@tinyerp.com-20121030125849-q1rn3f5ish8gexf5 --- addons/product_margin/wizard/product_margin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/product_margin/wizard/product_margin.py b/addons/product_margin/wizard/product_margin.py index 8063e33707f..cdabc8f9964 100644 --- a/addons/product_margin/wizard/product_margin.py +++ b/addons/product_margin/wizard/product_margin.py @@ -64,11 +64,11 @@ class product_margin(osv.osv_memory): #get the current product.margin object to obtain the values from it product_margin_obj = self.browse(cr, uid, ids, context=context)[0] - context.update({'invoice_state' : product_margin_obj.invoice_state}) + context.update(invoice_state = product_margin_obj.invoice_state) if product_margin_obj.from_date: - context.update({'date_from': product_margin_obj.from_date}) + context.update(date_from = product_margin_obj.from_date) if product_margin_obj.to_date: - context.update({'date_to': product_margin_obj.to_date}) + context.update(date_to = product_margin_obj.to_date) return { 'name': _('Product Margins'), 'context': context, From 790bbfd9e785381c47cc7fa9a6f4ea6c1ff9c0a2 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 12:07:20 +0530 Subject: [PATCH 003/313] [IMP]hr_holidays:replaced filter Start Date by Description bzr revid: ssu@tinyerp.com-20121112063720-p5964m4smclz9n1d --- addons/hr_holidays/hr_holidays_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index ef300741139..8b49be562fe 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -43,7 +43,7 @@ hr.holidays - + @@ -58,7 +58,7 @@ - + From fff55c47e017459aa1149d73c9958136f20ea031 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 12:30:47 +0530 Subject: [PATCH 004/313] [IMP]hr_timesheet:chenged sequence of columns in tree view of Timesheet Activities bzr revid: ssu@tinyerp.com-20121112070047-ulir5krh93l4zwlo --- addons/hr_timesheet/hr_timesheet_view.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index ebdd05ed59c..20e881cd9da 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -7,13 +7,13 @@ hr.analytic.timesheet + + + - - - From 951844a151aece177d2ff6ceddfa843bbba9d132 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 14:38:22 +0530 Subject: [PATCH 005/313] [IMP]hr_evaluation:overwrite copy method to avoid duplicating o2m field in Appraisal Form bzr revid: ssu@tinyerp.com-20121112090822-0ernxqxolou10w9o --- addons/hr_evaluation/hr_evaluation.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index eece0c7497e..ac7d110f8fa 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -265,6 +265,15 @@ class hr_evaluation(osv.osv): self.write(cr, uid, ids,{'state': 'draft'}, context=context) return True + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + if context is None: + context = {} + default = default.copy() + default['survey_request_ids'] = [] + return super(hr_evaluation, self).copy(cr, uid, id, default, context=context) + def write(self, cr, uid, ids, vals, context=None): if vals.get('employee_id'): employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context) From 9cb1b65cc73c815cb3e1668219e00d789882fd8d Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 17:37:29 +0530 Subject: [PATCH 006/313] [IMP]stock:displayed most recent stock moves on the top in list view of Stock Moves bzr revid: ssu@tinyerp.com-20121112120729-wb57o4mmdug6exlg --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 606cb9247d5..12b56eb6289 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1606,7 +1606,7 @@ class stock_move(osv.osv): _name = "stock.move" _description = "Stock Move" - _order = 'date_expected desc, id' + _order = 'id desc, picking_id' _log_create = False def action_partial_move(self, cr, uid, ids, context=None): From 50fa72389b9348ec330b6b4a1f5ecf1f226508b1 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Mon, 12 Nov 2012 19:03:21 +0530 Subject: [PATCH 007/313] [IMP]delivery:set kg as UoM with weight field in Internal Moves bzr revid: ssu@tinyerp.com-20121112133321-qkksfl7lg7423d1j --- addons/delivery/delivery_view.xml | 9 +++++++-- addons/delivery/stock.py | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 9b67d6b01b9..a8a2478f339 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -243,8 +243,13 @@ - - + + + + + + + diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index c3ce236dc2e..a975314d2ab 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -66,6 +66,7 @@ class stock_picking(osv.osv): }), 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32), 'number_of_packages': fields.integer('Number of Packages'), + 'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True), } def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None): @@ -133,6 +134,18 @@ class stock_picking(osv.osv): invoice_obj.button_compute(cr, uid, [invoice.id], context=context) return result + def _get_uom(self, cr, uid, context=None): + try: + product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_kgm') + except ValueError: + # a ValueError is returned if the xml id given is not found in the table ir_model_data + return False + return product.id + + _defaults = { + 'uom_id': _get_uom, + } + stock_picking() class stock_move(osv.osv): From c184c9c7779bdc3bbc5907eec201484271dd4859 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 13 Nov 2012 17:21:07 +0100 Subject: [PATCH 008/313] [ADD] base-ie.sass bzr revid: fme@openerp.com-20121113162107-1tenoncyon8hh9xz --- addons/web/controllers/main.py | 3 + addons/web/static/src/css/base-ie.css | 108 +++++++++++++++++++++++++ addons/web/static/src/css/base-ie.sass | 106 ++++++++++++++++++++++++ addons/web/static/src/css/base.css | 41 ++++++++++ addons/web/static/src/css/base.sass | 6 ++ 5 files changed, 264 insertions(+) create mode 100644 addons/web/static/src/css/base-ie.css create mode 100644 addons/web/static/src/css/base-ie.sass diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index ffabe97661b..63b722c2281 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -553,6 +553,9 @@ html_template = """ %(css)s + %(js)s """ try: - out = """""" data = ufile.read() args = [len(data), ufile.filename, ufile.content_type, base64.b64encode(data)] @@ -1291,11 +1291,11 @@ class Binary(openerpweb.Controller): @openerpweb.httprequest def upload_attachment(self, req, callback, model, id, ufile): Model = req.session.model('ir.attachment') + out = """""" try: - out = """""" attachment_id = Model.create({ 'name': ufile.filename, 'datas': base64.encodestring(ufile.read()), @@ -1307,7 +1307,7 @@ class Binary(openerpweb.Controller): 'filename': ufile.filename, 'id': attachment_id } - except Exception,e: + except xmlrpclib.Fault, e: args = {'error':e.faultCode } return out % (simplejson.dumps(callback), simplejson.dumps(args)) From 9ebbe7d2303a14beff884cb049324a7953d9f5d2 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 14 Dec 2012 16:30:48 +0100 Subject: [PATCH 232/313] [IMP] doc/security: removed note stating the groups attribute was partially implemented. bzr revid: vmt@openerp.com-20121214153048-pehjjfp05uc9gdu4 --- doc/04_security.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/04_security.rst b/doc/04_security.rst index 99d7fd3d17f..bb0ce468de5 100644 --- a/doc/04_security.rst +++ b/doc/04_security.rst @@ -141,10 +141,6 @@ for users who do not belong to the authorized groups: .. note:: The tests related to this feature are in ``openerp/tests/test_acl.py``. -.. warning:: At the time of writing the implementation of this feature is partial - and does not yet restrict read/write RPC access to the field. - The corresponding test is written already but currently disabled. - Workflow transition rules +++++++++++++++++++++++++ From 2c8f4f75729c20ff9c43dff100e3eb97e86ffd5e Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 14 Dec 2012 16:52:25 +0100 Subject: [PATCH 233/313] [FIX] hr_attendance: invert condition bzr revid: chs@openerp.com-20121214155225-olze66svgx4hwqvg --- addons/hr_attendance/static/src/js/attendance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/static/src/js/attendance.js b/addons/hr_attendance/static/src/js/attendance.js index f030562da9b..c2750a920a4 100644 --- a/addons/hr_attendance/static/src/js/attendance.js +++ b/addons/hr_attendance/static/src/js/attendance.js @@ -76,7 +76,7 @@ openerp.hr_attendance = function (instance) { this._super(); var self = this; this.update_promise.done(function () { - if (_.isUndefined(self.attendanceslider)) { + if (!_.isUndefined(self.attendanceslider)) { return; } // check current user is an employee From 91ee5eae52846518b84e07b658d72f5c3c6f9016 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 14 Dec 2012 16:53:13 +0100 Subject: [PATCH 234/313] [IMP] orm/acl: proper message instead of `TODO`. bzr revid: vmt@openerp.com-20121214155313-76lncslpx7ugrp6x --- openerp/osv/orm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index ce2f8fc671a..1457013035b 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -3560,7 +3560,11 @@ class BaseModel(object): filtered_fields = filter(lambda a: not p(a), fields) if filtered_fields: _logger.warning('Access Denied by ACLs for operation: %s, uid: %s, model: %s, fields: %s', operation, user, self._name, ', '.join(filtered_fields)) - raise except_orm(_('Access Denied'), 'TODO') + raise except_orm( + _('Access Denied'), + _('The requested operation cannot be completed due to security restrictions. ' + 'Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % \ + (self._description, operation)) return fields def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): From 70a0215a300eed7186a5ef759fac48e3b27192b8 Mon Sep 17 00:00:00 2001 From: "dle@openerp.com" <> Date: Fri, 14 Dec 2012 17:07:36 +0100 Subject: [PATCH 235/313] [IMP]String edit in view instead of overwrite inherited field bzr revid: dle@openerp.com-20121214160736-zu7u5xct2h1xgs37 --- addons/stock/stock.py | 2 - addons/stock/stock_view.xml | 105 ++++++++++++++++++------------------ 2 files changed, 53 insertions(+), 54 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index e2ddff80d2b..93bfe76d376 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3048,7 +3048,6 @@ class stock_picking_in(osv.osv): _columns = { 'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), - 'date_done': fields.datetime('Date of Reception', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'state': fields.selection( [('draft', 'Draft'), ('auto', 'Waiting Another Operation'), @@ -3094,7 +3093,6 @@ class stock_picking_out(osv.osv): _columns = { 'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), - 'date_done': fields.datetime('Date of Delivery ', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'state': fields.selection( [('draft', 'Draft'), ('auto', 'Waiting Another Operation'), diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index e0181d88a30..a559aad9aac 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -890,37 +890,37 @@ stock.picking.out - - -