mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP style fixes
This commit is contained in:
parent
b75c343236
commit
09ccd6c5e2
@ -90,7 +90,6 @@ class EditSalesOrderForm(HelperForm):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EditPurchaseOrderAttachmentForm(HelperForm):
|
class EditPurchaseOrderAttachmentForm(HelperForm):
|
||||||
""" Form for editing a PurchaseOrderAttachment object """
|
""" Form for editing a PurchaseOrderAttachment object """
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
|
from stock import models as stock_models
|
||||||
from company.models import Company, SupplierPart
|
from company.models import Company, SupplierPart
|
||||||
|
|
||||||
from InvenTree.fields import RoundingDecimalField
|
from InvenTree.fields import RoundingDecimalField
|
||||||
@ -223,7 +224,7 @@ class PurchaseOrder(Order):
|
|||||||
|
|
||||||
# Create a new stock item
|
# Create a new stock item
|
||||||
if line.part:
|
if line.part:
|
||||||
stock = StockItem(
|
stock = stock_models.StockItem(
|
||||||
part=line.part.part,
|
part=line.part.part,
|
||||||
supplier_part=line.part,
|
supplier_part=line.part,
|
||||||
location=location,
|
location=location,
|
||||||
@ -264,7 +265,8 @@ class SalesOrder(Order):
|
|||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('so-detail', kwargs={'pk': self.id})
|
return reverse('so-detail', kwargs={'pk': self.id})
|
||||||
|
|
||||||
customer = models.ForeignKey(Company,
|
customer = models.ForeignKey(
|
||||||
|
Company,
|
||||||
on_delete=models.SET_NULL,
|
on_delete=models.SET_NULL,
|
||||||
null=True,
|
null=True,
|
||||||
limit_choices_to={'is_customer': True},
|
limit_choices_to={'is_customer': True},
|
||||||
|
@ -358,8 +358,6 @@ class SalesOrderEdit(AjaxUpdateView):
|
|||||||
def get_form(self):
|
def get_form(self):
|
||||||
form = super().get_form()
|
form = super().get_form()
|
||||||
|
|
||||||
order = self.get_object()
|
|
||||||
|
|
||||||
# Prevent user from editing customer
|
# Prevent user from editing customer
|
||||||
form.fields['customer'].widget = HiddenInput()
|
form.fields['customer'].widget = HiddenInput()
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ class StockItem(MPTTModel):
|
|||||||
# the "Part" that the line item references is the same as the part that THIS references
|
# the "Part" that the line item references is the same as the part that THIS references
|
||||||
if self.sales_order_line is not None:
|
if self.sales_order_line is not None:
|
||||||
|
|
||||||
if self.sales_order_line.part == None:
|
if self.sales_order_line.part is None:
|
||||||
raise ValidationError({'sales_order_line': _('Stock item cannot be assigned to a LineItem which does not reference a part')})
|
raise ValidationError({'sales_order_line': _('Stock item cannot be assigned to a LineItem which does not reference a part')})
|
||||||
|
|
||||||
if not self.sales_order_line.part == self.part:
|
if not self.sales_order_line.part == self.part:
|
||||||
|
Loading…
Reference in New Issue
Block a user