Skip to content

Commit

Permalink
Merge remote-tracking branch 'odoo/10.0' into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed Apr 19, 2017
2 parents 433351a + cd1a0fc commit 8b704e9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addons/event/models/event.py
Expand Up @@ -70,7 +70,7 @@ def _default_event_mail_ids(self):
'interval_unit': 'days',
'interval_type': 'before_event',
'template_id': self.env.ref('event.event_reminder')
})] if self.user_has_groups('event.group_email_scheduling') else []
})]

# Seats and computation
seats_max = fields.Integer(
Expand Down
9 changes: 9 additions & 0 deletions addons/mrp/models/stock_move.py
Expand Up @@ -386,3 +386,12 @@ def _generate_move_phantom(self, bom_line, quantity):
'split_from': self.id, # Needed in order to keep sale connection, but will be removed by unlink
})
return self.env['stock.move']

class PushedFlow(models.Model):
_inherit = "stock.location.path"

def _prepare_move_copy_values(self, move_to_copy, new_date):
new_move_vals = super(PushedFlow, self)._prepare_move_copy_values(move_to_copy, new_date)
new_move_vals['production_id'] = False

return new_move_vals
18 changes: 12 additions & 6 deletions addons/stock/models/stock_location.py
Expand Up @@ -209,9 +209,15 @@ def _apply(self, move):
# TDE FIXME: should probably be done in the move model IMO
move._push_apply()
else:
new_move = move.copy({
'origin': move.origin or move.picking_id.name or "/",
'location_id': move.location_dest_id.id,
new_move_vals = self._prepare_move_copy_values(move, new_date)
new_move = move.copy(new_move_vals)
move.write({'move_dest_id': new_move.id})
new_move.action_confirm()

def _prepare_move_copy_values(self, move_to_copy, new_date):
new_move_vals = {
'origin': move_to_copy.origin or move_to_copy.picking_id.name or "/",
'location_id': move_to_copy.location_dest_id.id,
'location_dest_id': self.location_dest_id.id,
'date': new_date,
'date_expected': new_date,
Expand All @@ -222,6 +228,6 @@ def _apply(self, move):
'push_rule_id': self.id,
'warehouse_id': self.warehouse_id.id,
'procurement_id': False,
})
move.write({'move_dest_id': new_move.id})
new_move.action_confirm()
}

return new_move_vals
2 changes: 1 addition & 1 deletion addons/stock/models/stock_quant.py
Expand Up @@ -537,7 +537,7 @@ def _get_top_level_packages(self, product_to_location):
if any(quant not in self for quant in package.get_content()):
all_in = False
if all_in:
destinations = [product_to_location[product] for product in package.get_content().mapped('product_id')]
destinations = set([product_to_location[product] for product in package.get_content().mapped('product_id')])
if len(destinations) > 1:
all_in = False
if all_in:
Expand Down

0 comments on commit 8b704e9

Please sign in to comment.