Skip to content

Commit

Permalink
[fix] never send negative qty to PS
Browse files Browse the repository at this point in the history
  • Loading branch information
simahawk committed Sep 13, 2017
1 parent 20375bd commit 7d6630d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion connector_prestashop/models/product_template/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ def _recompute_prestashop_qty_backend(self, backend):
return True

def _prestashop_qty(self, backend):
return self[backend.product_qty_field]
qty = self[backend.product_qty_field]
if qty < 0:
# make sure we never send negative qty to PS
# because the overall qty computed at template level
# is going to be wrong.
qty = 0.0
return qty


class PrestashopProductTemplate(models.Model):
Expand Down

0 comments on commit 7d6630d

Please sign in to comment.