[IMP] mrp: activity on MO if the linked SO is modified
return the production_id and the responsible if it exist on the move instead of returning the origin moves. We can deduce that if a production is linked to a move and this MO still ongoing then it should be the upperstream document.
This commit is contained in:
committed by
Simon Lejeune
parent
5a0645579d
commit
61284e5c27
@@ -249,6 +249,12 @@ class StockMove(models.Model):
|
||||
vals.update({'lot_id': lot.id})
|
||||
self.env['stock.move.line'].create(vals)
|
||||
|
||||
def _get_upstream_documents_and_responsibles(self):
|
||||
if self.created_production_id and self.created_production_id.state not in ('done', 'cancel'):
|
||||
return [(self.created_production_id, self.created_production_id.user_id)]
|
||||
else:
|
||||
return super(StockMove, self)._get_upstream_documents_and_responsibles()
|
||||
|
||||
|
||||
class PushedFlow(models.Model):
|
||||
_inherit = "stock.location.path"
|
||||
|
||||
Reference in New Issue
Block a user