Skip to content

Commit a8d3eb9

Browse files
committed
[FIX]stock_ux: check_manual_lines execution time
closes #898 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
1 parent 8e567fb commit a8d3eb9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stock_ux/models/stock_move_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def _compute_product_uom_qty_location(self):
5454
product_uom_qty_location = 0.0 if rec.location_dest_id in locations else -rec.quantity
5555
rec.product_uom_qty_location = product_uom_qty_location
5656

57-
@api.constrains("quantity")
5857
def _check_manual_lines(self):
5958
# Si tenemos este contexto es porque si o si viene de una compra
6059
if "previous_product_qty" in self.env.context:
@@ -106,7 +105,7 @@ def _check_quantity_available(self):
106105
quants = self.env["stock.quant"].search(
107106
[("product_id", "=", self.product_id.id), ("location_id", "in", locations.ids)]
108107
)
109-
total_available = sum(quants.mapped("available_quantity")) - self.quantity
108+
total_available = sum(quants.mapped("available_quantity"))
110109
return total_available
111110

112111
@api.model_create_multi
@@ -118,6 +117,7 @@ def create(self, vals_list):
118117
if rec.picking_id and not rec.description_picking:
119118
product = rec.product_id.with_context(lang=rec.picking_id.partner_id.lang or rec.env.user.lang)
120119
rec.description_picking = product._get_description(rec.picking_id.picking_type_id)
120+
recs._check_manual_lines()
121121
return recs
122122

123123
def _get_aggregated_product_quantities(self, **kwargs):

0 commit comments

Comments
 (0)