diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 44ba540d33..b418f6d1df 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -49,7 +49,8 @@ runs: shell: bash run: | python3 -m pip install -U pip - pip3 install invoke wheel uv + pip3 install -U invoke wheel + pip3 install uv==0.1.45 - name: Set the VIRTUAL_ENV variable for uv to work run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV shell: bash @@ -82,14 +83,16 @@ runs: # Invoke commands - name: Install dev requirements - if: ${{ inputs.dev-install == 'true' ||inputs.install == 'true' }} + if: ${{ inputs.dev-install == 'true' || inputs.install == 'true' }} shell: bash run: uv pip install --require-hashes -r src/backend/requirements-dev.txt - name: Run invoke install if: ${{ inputs.install == 'true' }} shell: bash - run: invoke install --uv + # run: invoke install --uv + run: invoke install - name: Run invoke update if: ${{ inputs.update == 'true' }} shell: bash - run: invoke update --uv + # run: invoke update --uv + run: invoke update diff --git a/src/backend/InvenTree/order/models.py b/src/backend/InvenTree/order/models.py index b149f31503..0543fbf88d 100644 --- a/src/backend/InvenTree/order/models.py +++ b/src/backend/InvenTree/order/models.py @@ -1024,22 +1024,16 @@ class SalesOrder(TotalPriceMixin, Order): Throws a ValidationError if cannot be completed. """ try: - # Order without line items cannot be completed - if self.lines.count() == 0: - raise ValidationError( - _('Order cannot be completed as no parts have been assigned') - ) - # Only an open order can be marked as shipped - elif not self.is_open and not self.is_completed: + if self.is_open and not self.is_completed: raise ValidationError(_('Only an open order can be marked as complete')) - elif self.pending_shipment_count > 0: + if self.pending_shipment_count > 0: raise ValidationError( _('Order cannot be completed as there are incomplete shipments') ) - elif not allow_incomplete_lines and self.pending_line_count > 0: + if not allow_incomplete_lines and self.pending_line_count > 0: raise ValidationError( _('Order cannot be completed as there are incomplete line items') ) diff --git a/src/backend/InvenTree/order/templates/order/sales_order_base.html b/src/backend/InvenTree/order/templates/order/sales_order_base.html index 6bfb9b0989..bc306502a7 100644 --- a/src/backend/InvenTree/order/templates/order/sales_order_base.html +++ b/src/backend/InvenTree/order/templates/order/sales_order_base.html @@ -88,10 +88,10 @@ src="{% static 'img/blank_image.png' %}" + {% endif %} - {% endif %} {% elif order.status == SalesOrderStatus.SHIPPED %}