mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +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
9
.github/actions/setup/action.yaml
vendored
9
.github/actions/setup/action.yaml
vendored
@ -49,7 +49,8 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -U pip
|
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
|
- name: Set the VIRTUAL_ENV variable for uv to work
|
||||||
run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
|
run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -88,8 +89,10 @@ runs:
|
|||||||
- name: Run invoke install
|
- name: Run invoke install
|
||||||
if: ${{ inputs.install == 'true' }}
|
if: ${{ inputs.install == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: invoke install --uv
|
# run: invoke install --uv
|
||||||
|
run: invoke install
|
||||||
- name: Run invoke update
|
- name: Run invoke update
|
||||||
if: ${{ inputs.update == 'true' }}
|
if: ${{ inputs.update == 'true' }}
|
||||||
shell: bash
|
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.
|
Throws a ValidationError if cannot be completed.
|
||||||
"""
|
"""
|
||||||
try:
|
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
|
# 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'))
|
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(
|
raise ValidationError(
|
||||||
_('Order cannot be completed as there are incomplete shipments')
|
_('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(
|
raise ValidationError(
|
||||||
_('Order cannot be completed as there are incomplete line items')
|
_('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" %}'>
|
<button type='button' class='btn btn-success' id='complete-order-shipments' title='{% trans "Ship Items" %}'>
|
||||||
<span class='fas fa-truck'></span> {% trans "Ship Items" %}
|
<span class='fas fa-truck'></span> {% trans "Ship Items" %}
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
<button type='button' class='btn btn-success' id='ship-order' title='{% trans "Mark As Shipped" %}'>
|
<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" %}
|
<span class='fas fa-check-circle'></span> {% trans "Mark As Shipped" %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
|
||||||
{% elif order.status == SalesOrderStatus.SHIPPED %}
|
{% elif order.status == SalesOrderStatus.SHIPPED %}
|
||||||
<button type='button' class='btn btn-success' id='complete-order' title='{% trans "Complete Sales Order" %}'>
|
<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" %}
|
<span class='fas fa-check-circle'></span> {% trans "Complete Order" %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user