[MERGE] forward port branch 10.0 up to 26e7d5d8ee
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'],
|
||||
|
||||
@@ -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
|
||||
|
||||
+13
-4
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user