diff --git a/stock_location_orderpoint/models/stock_location_orderpoint.py b/stock_location_orderpoint/models/stock_location_orderpoint.py index 49c241dae..3c55212fe 100644 --- a/stock_location_orderpoint/models/stock_location_orderpoint.py +++ b/stock_location_orderpoint/models/stock_location_orderpoint.py @@ -87,8 +87,8 @@ class StockLocationOrderpoint(models.Model): _sql_constraints = [ ( "location_route_unique", - "unique(location_id, route_id)", - "The combination of Company, Location and Route must be unique", + "unique(location_id, route_id, company_id, replenish_method)", + "The combination of Company, Location, Route and Replenish method must be unique", ) ] diff --git a/stock_location_orderpoint/models/stock_move.py b/stock_location_orderpoint/models/stock_move.py index 2c99ce58f..b0e47b885 100644 --- a/stock_location_orderpoint/models/stock_move.py +++ b/stock_location_orderpoint/models/stock_move.py @@ -76,8 +76,10 @@ class StockMove(models.Model): job_options = job_options.copy() job_options.setdefault( "description", - _("Try to replenish quantities for location {} and product {}").format( - location.display_name, product.display_name + _("Try to replenish quantities {} location {} for product {}").format( + location_field == "location_id" and _("in") or _("from"), + location.display_name, + product.display_name, ), ) # do not enqueue 2 jobs for the same location and product set diff --git a/stock_location_orderpoint/views/stock_location_orderpoint_views.xml b/stock_location_orderpoint/views/stock_location_orderpoint_views.xml index 13454ab66..beb92e358 100644 --- a/stock_location_orderpoint/views/stock_location_orderpoint_views.xml +++ b/stock_location_orderpoint/views/stock_location_orderpoint_views.xml @@ -17,6 +17,7 @@ +