diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index 293220d1ed0..868bd08d121 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -117,7 +117,7 @@ class StockMove(models.Model): @api.depends('move_lot_ids', 'move_lot_ids.quantity_done', 'quantity_done_store') def _qty_done_compute(self): for move in self: - if move.has_tracking != 'none': + if move.has_tracking != 'none' or move.sudo().move_lot_ids.mapped('lot_id'): move.quantity_done = sum(move.move_lot_ids.filtered(lambda x: x.done_wo).mapped('quantity_done')) #TODO: change with active_move_lot_ids? else: move.quantity_done = move.quantity_done_store diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py index 1b8088578a7..f13f9ef7a6e 100644 --- a/addons/project/__manifest__.py +++ b/addons/project/__manifest__.py @@ -36,7 +36,6 @@ Dashboard / Reports for Project Management will include: 'data': [ 'security/project_security.xml', 'security/ir.model.access.csv', - 'data/project_data.xml', 'report/project_report_views.xml', 'views/project_views.xml', 'views/res_partner_views.xml', @@ -46,6 +45,7 @@ Dashboard / Reports for Project Management will include: 'data/web_planner_data.xml', 'data/project_mail_template_data.xml', 'wizard/project_task_merge_wizard_views.xml', + 'data/project_data.xml', ], 'qweb': ['static/src/xml/project.xml'], 'demo': ['data/project_demo.xml'], diff --git a/odoo/addons/base/ir/ir_ui_view.py b/odoo/addons/base/ir/ir_ui_view.py index 928fc642aed..6cd9fa8ec59 100644 --- a/odoo/addons/base/ir/ir_ui_view.py +++ b/odoo/addons/base/ir/ir_ui_view.py @@ -403,6 +403,12 @@ actual arch. self.clear_caches() return super(View, self).write(self._compute_defaults(vals)) + def unlink(self): + # if in uninstall mode and has children views, emulate an ondelete cascade + if self.env.context.get('_force_unlink', False) and self.mapped('inherit_children_ids'): + self.mapped('inherit_children_ids').unlink() + super(View, self).unlink() + @api.multi def toggle(self): """ Switches between enabled and disabled statuses diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index 750c3388064..2c4f6a26e28 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -124,7 +124,17 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, continue _logger.debug('loading module %s (%d/%d)', module_name, index, module_count) - migrations.migrate_module(package, 'pre') + + needs_update = ( + hasattr(package, "init") + or hasattr(package, "update") + or package.state in ("to install", "to upgrade") + ) + if needs_update: + if package.name != 'base': + registry.setup_models(cr, partial=True) + migrations.migrate_module(package, 'pre') + load_openerp_module(package.name) new_install = package.state == 'to install' @@ -137,8 +147,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, model_names = registry.load(cr, package) loaded_modules.append(package.name) - if (hasattr(package, 'init') or hasattr(package, 'update') - or package.state in ('to install', 'to upgrade')): + if needs_update: models_updated |= set(model_names) models_to_check -= set(model_names) registry.setup_models(cr, partial=True) @@ -158,7 +167,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, if hasattr(package, 'init') or package.state == 'to install': mode = 'init' - if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): + if needs_update: env = api.Environment(cr, SUPERUSER_ID, {}) # Can't put this line out of the loop: ir.module.module will be # registered by init_models() above.