fix: 采购, 采购退货, 入库

This commit is contained in:
Czw 2021-11-14 15:37:54 +08:00
parent 18da7f6ba1
commit c2d6cc665c
3 changed files with 6 additions and 9 deletions

View file

@ -76,7 +76,7 @@ class PurchaseOrderSerializer(BaseSerializer):
model = PurchaseOrder
read_only_fields = ['id', 'warehouse_number', 'warehouse_name', 'supplier_number',
'supplier_name', 'handler_name', 'total_quantity', 'total_amount',
'payment_amount', 'arrears_amount', 'is_completed', 'is_void',
'payment_amount', 'arrears_amount', 'is_void',
'enable_auto_stock_in', 'creator', 'creator_name', 'create_time']
fields = ['number', 'warehouse', 'supplier', 'handler', 'handle_time', 'remark', 'other_amount',
'purchase_goods_items', 'purchase_account_items', *read_only_fields]
@ -208,7 +208,7 @@ class PurchaseReturnOrderSerializer(BaseSerializer):
account_name = CharField(source='account.name', read_only=True, label='账户名称')
class Meta:
model = PurchaseAccount
model = PurchaseReturnAccount
read_only_fields = ['id', 'account_number', 'account_name']
fields = ['account', 'collection_amount', *read_only_fields]
@ -237,10 +237,10 @@ class PurchaseReturnOrderSerializer(BaseSerializer):
class Meta:
model = PurchaseReturnOrder
read_only_fields = ['id', 'purchase_order_number,' 'warehouse_number', 'warehouse_name',
read_only_fields = ['id', 'purchase_order_number', 'warehouse_number', 'warehouse_name',
'supplier_number', 'supplier_name', 'handler_name', 'total_quantity',
'total_amount', 'payment_amount', 'arrears_amount', 'is_void',
'enable_auto_stock_in', 'creator', 'creator_name', 'create_time']
'total_amount', 'collection_amount', 'arrears_amount', 'is_void',
'enable_auto_stock_out', 'creator', 'creator_name', 'create_time']
fields = ['number', 'purchase_order', 'warehouse', 'supplier', 'handler', 'handle_time',
'remark', 'other_amount', 'purchase_return_goods_items',
'purchase_return_account_items', *read_only_fields]

View file

@ -4,4 +4,5 @@ from apps.purchase.views import *
router = BaseRouter()
router.register('purchase_orders', PurchaseOrderViewSet, 'purchase_order')
router.register('purchase_return_orders', PurchaseReturnOrderViewSet, 'purchase_return_order')
urlpatterns = router.urls

View file

@ -16,8 +16,6 @@ class SalesOrder(Model):
total_amount = AmountField(null=True, verbose_name='销售总金额')
collection_amount = AmountField(null=True, verbose_name='收款金额')
arrears_amount = AmountField(null=True, verbose_name='欠款金额')
# collection_order = OneToOneField('finance.CollectionOrder', on_delete=PROTECT, null=True,
# related_name='sales_order', verbose_name='收款单据')
is_void = BooleanField(default=False, verbose_name='作废状态')
enable_auto_stock_out = BooleanField(default=False, verbose_name='启用自动出库')
creator = ForeignKey('system.User', on_delete=PROTECT,
@ -89,8 +87,6 @@ class SalesReturnOrder(Model):
total_amount = AmountField(null=True, verbose_name='退货总金额')
payment_amount = AmountField(null=True, verbose_name='付款金额')
arrears_amount = AmountField(null=True, verbose_name='欠款金额')
# payment_order = OneToOneField('finance.PaymentOrder', on_delete=PROTECT, null=True,
# related_name='purchase_order', verbose_name='付款单据')
is_void = BooleanField(default=False, verbose_name='作废状态')
enable_auto_stock_in = BooleanField(default=False, verbose_name='启用自动入库')
creator = ForeignKey('system.User', on_delete=PROTECT,