mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix sales order shipment / completed buttons (#7305)
* Fix sales order shipment / completed buttons - Template logic needed tweaks * Adjust logic for completing a sales order * Tweak UV version - Trying to get CI to run properly * Pin version * Ignore uv * Cleanup * Fix another --uv command
This commit is contained in:
parent
b36bd5c35d
commit
bc566c513f
11
.github/actions/setup/action.yaml
vendored
11
.github/actions/setup/action.yaml
vendored
@ -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
|
||||
|
@ -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')
|
||||
)
|
||||
|
@ -88,10 +88,10 @@ src="{% static 'img/blank_image.png' %}"
|
||||
<button type='button' class='btn btn-success' id='complete-order-shipments' title='{% trans "Ship Items" %}'>
|
||||
<span class='fas fa-truck'></span> {% trans "Ship Items" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<button type='button' class='btn btn-success' id='ship-order' title='{% trans "Mark As Shipped" %}'>
|
||||
<span class='fas fa-check-circle'></span> {% trans "Mark As Shipped" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% elif order.status == SalesOrderStatus.SHIPPED %}
|
||||
<button type='button' class='btn btn-success' id='complete-order' title='{% trans "Complete Sales Order" %}'>
|
||||
<span class='fas fa-check-circle'></span> {% trans "Complete Order" %}
|
||||
|
Loading…
Reference in New Issue
Block a user