diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 6c710dc2c04..519660fb708 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -77,7 +77,7 @@ class account_analytic_invoice_line(osv.osv): price = price_unit elif pricelist_id: price = res.price - else: + if price is False: price = res.list_price if not name: name = self.pool.get('product.product').name_get(cr, uid, [res.id], context=local_context)[0][1] diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index af4caae608f..ba17a3c6a24 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -139,7 +139,8 @@ + attrs="{'required': [('invoice_on_timesheets', '=', True)]}" + domain="[('type', '=', 'sale')]"/> + - or Cancel + or Cancel diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index 5ef666a970e..50a9e54d7be 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -93,6 +93,9 @@ .openerp .oe_kanban_view .oe_kanban_groups { height: inherit; } +.openerp .oe_kanban_view .oe_kanban_groups_records { + height: 100%; +} .openerp .oe_kanban_view.oe_kanban_grouped_by_m2o .oe_kanban_group_title { cursor: move; } @@ -160,7 +163,7 @@ padding: 0px; background: white; } -.openerp .oe_kanban_view .oe_kanban_column, .openerp .oe_kanban_view .oe_kanban_column_cards { +.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_column, .openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_column_cards { height: 100%; } .openerp .oe_kanban_view .oe_kanban_aggregates { diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index 9fe3737a410..d5f2bfcdbd8 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -119,6 +119,8 @@ // KanbanGroups {{{ .oe_kanban_groups height: inherit + .oe_kanban_groups_records + height: 100% &.oe_kanban_grouped_by_m2o .oe_kanban_group_title cursor: move .oe_kanban_header @@ -178,9 +180,9 @@ .oe_kanban_column padding: 0px background: #ffffff - - .oe_kanban_column, .oe_kanban_column_cards - height: 100% + &.oe_kanban_grouped + .oe_kanban_column, .oe_kanban_column_cards + height: 100% .oe_kanban_aggregates padding: 0 margin: 0px diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 806b2ab4e0c..7e94895c515 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -977,6 +977,8 @@ clean_for_save: function () { this._super(); $(".carousel").find(".item").removeClass("next prev left right active"); + this.$indicators.find('li').removeClass('active'); + this.$indicators.find('li:first').addClass('active'); if(!this.$target.find(".item.active").length) { this.$target.find(".item:first").addClass("active"); } diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 56d954e8a35..df3a4298e5b 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -214,7 +214,8 @@ e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='//www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); - ga('create','');ga('send','pageview'); + ga('create',_.str.trim('')); + ga('send','pageview'); diff --git a/addons/website_event_track/views/website_event.xml b/addons/website_event_track/views/website_event.xml index 9aece0f5c11..05da470c041 100644 --- a/addons/website_event_track/views/website_event.xml +++ b/addons/website_event_track/views/website_event.xml @@ -134,9 +134,7 @@
  • - - , - +
  • diff --git a/openerp/addons/base/ir/ir_cron.py b/openerp/addons/base/ir/ir_cron.py index e5a5e5f024b..e0f6e38b5ba 100644 --- a/openerp/addons/base/ir/ir_cron.py +++ b/openerp/addons/base/ir/ir_cron.py @@ -238,7 +238,7 @@ class ir_cron(osv.osv): locked_job = lock_cr.fetchone() if not locked_job: - # job was already executed by another parallel process/thread, skipping it. + _logger.debug("Job `%s` already executed by another process/thread. skipping it", job['name']) continue # Got the lock on the job row, run its code _logger.debug('Starting job `%s`.', job['name']) diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index 442dc0ce741..3101f52f2e0 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -1141,13 +1141,20 @@ class ir_model_data(osv.osv): # Remove non-model records first, then model fields, and finish with models unlink_if_refcount((model, res_id) for model, res_id in to_unlink - if model not in ('ir.model','ir.model.fields')) + if model not in ('ir.model','ir.model.fields','ir.model.constraint')) + unlink_if_refcount((model, res_id) for model, res_id in to_unlink + if model == 'ir.model.constraint') + + ir_module_module = self.pool['ir.module.module'] + ir_model_constraint = self.pool['ir.model.constraint'] + modules_to_remove_ids = ir_module_module.search(cr, uid, [('name', 'in', modules_to_remove)], context=context) + constraint_ids = ir_model_constraint.search(cr, uid, [('module', 'in', modules_to_remove_ids)], context=context) + ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context) + unlink_if_refcount((model, res_id) for model, res_id in to_unlink if model == 'ir.model.fields') ir_model_relation = self.pool['ir.model.relation'] - ir_module_module = self.pool['ir.module.module'] - modules_to_remove_ids = ir_module_module.search(cr, uid, [('name', 'in', modules_to_remove)]) relation_ids = ir_model_relation.search(cr, uid, [('module', 'in', modules_to_remove_ids)]) ir_model_relation._module_data_uninstall(cr, uid, relation_ids, context) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index adf21580965..eb154d4a05f 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -445,11 +445,7 @@ class module(osv.osv): including the deletion of all database structures created by the module: tables, columns, constraints, etc.""" ir_model_data = self.pool.get('ir.model.data') - ir_model_constraint = self.pool.get('ir.model.constraint') modules_to_remove = [m.name for m in self.browse(cr, uid, ids, context)] - modules_to_remove_ids = [m.id for m in self.browse(cr, uid, ids, context)] - constraint_ids = ir_model_constraint.search(cr, uid, [('module', 'in', modules_to_remove_ids)]) - ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context) ir_model_data._module_data_uninstall(cr, uid, modules_to_remove, context) self.write(cr, uid, ids, {'state': 'uninstalled'}) return True diff --git a/openerp/netsvc.py b/openerp/netsvc.py index 59a155ff2d0..c84228ea6e5 100644 --- a/openerp/netsvc.py +++ b/openerp/netsvc.py @@ -75,7 +75,6 @@ class PostgreSQLHandler(logging.Handler): def emit(self, record): ct = threading.current_thread() ct_db = getattr(ct, 'dbname', None) - ct_uid = getattr(ct, 'uid', None) dbname = tools.config['log_db'] or ct_db if not dbname: return @@ -88,10 +87,10 @@ class PostgreSQLHandler(logging.Handler): msg = "%s\n%s" % (msg, traceback) # we do not use record.levelname because it may have been changed by ColoredFormatter. levelname = logging.getLevelName(record.levelno) - val = (ct_uid, ct_uid, 'server', ct_db, record.name, levelname, msg, record.pathname, record.lineno, record.funcName) + val = ('server', ct_db, record.name, levelname, msg, record.pathname, record.lineno, record.funcName) cr.execute(""" - INSERT INTO ir_logging(create_date, write_date, create_uid, write_uid, type, dbname, name, level, message, path, line, func) - VALUES (NOW() at time zone 'UTC', NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) + INSERT INTO ir_logging(create_date, type, dbname, name, level, message, path, line, func) + VALUES (NOW() at time zone 'UTC', %s, %s, %s, %s, %s, %s, %s, %s) """, val) BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, _NOTHING, DEFAULT = range(10) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 439463b962a..a2bb213cbf6 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1261,8 +1261,16 @@ class function(_column): return new_values def get(self, cr, obj, ids, name, uid=False, context=None, values=None): - result = self._fnct(obj, cr, uid, ids, name, self._arg, context) - if self._multi: + multi = self._multi + # if we already have a value, don't recompute it. + # This happen if case of stored many2one fields + if values and not multi and name in values[0]: + result = {v['id']: v[name] for v in values} + elif values and multi and all(n in values[0] for n in name): + result = {v['id']: dict({n: v[n]} for n in name) for v in values} + else: + result = self._fnct(obj, cr, uid, ids, name, self._arg, context) + if multi: swap = {} for rid, values in result.iteritems(): for f, v in values.iteritems(): diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index e85a35b790a..73ad3796418 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2806,7 +2806,7 @@ class BaseModel(object): ('numeric', 'float', get_pg_type(f)[1], '::'+get_pg_type(f)[1]), ('float8', 'float', get_pg_type(f)[1], '::'+get_pg_type(f)[1]), ] - if f_pg_type == 'varchar' and f._type == 'char' and ((f.size is None and f_pg_size) or f_pg_size < f.size): + if f_pg_type == 'varchar' and f._type == 'char' and f_pg_size and (f.size is None or f_pg_size < f.size): try: with cr.savepoint(): cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" TYPE %s' % (self._table, k, pg_varchar(f.size)))