diff --git a/inventory/signals.py b/inventory/signals.py index e19327cf..f3af7710 100644 --- a/inventory/signals.py +++ b/inventory/signals.py @@ -1004,9 +1004,19 @@ def create_po_item_upload(sender, instance, created, **kwargs): for item in instance.get_itemtxs_data()[0]: dealer = models.Dealer.objects.get(entity=instance.entity) if item.bill_model and item.bill_model.is_paid(): - models.PoItemsUploaded.objects.get_or_create( - dealer=dealer, po=instance, item=item, status=instance.po_status - ) + models.PoItemsUploaded.objects.update_or_create( + dealer=dealer, po=instance, item=item, + defaults={ + "status":instance.po_status + } + ) + + # po_item = models.PoItemsUploaded.objects.get_or_create( + # dealer=dealer, po=instance, item=item, + # defaults={ + # "status":instance.po_status + # } + # ) # @receiver(post_save, sender=models.Staff) diff --git a/templates/bill/includes/card_bill.html b/templates/bill/includes/card_bill.html index 4873cba1..a523990b 100644 --- a/templates/bill/includes/card_bill.html +++ b/templates/bill/includes/card_bill.html @@ -50,7 +50,7 @@ {% modal_action bill 'get' entity_slug %} -