Skip to content

RangeDateFilter not working properly #1438

@monty8800

Description

@monty8800

What version of Unfold are you using?

0.60.0

What version of Django are you using?

5.2.3

What browser are you using?

chrome 137.0.7151.122

Did you checked changelog/commit history, if the bug is not already fixed?

Yes

Did you searched other issues, if the bug is not already fixed?

Yes

Did you checked documentation?

YES

Are you able to replicate the bug in the demo site?

NO

Repository with reproduced bug

NO

Describe your issue

Model:

class SettlementOrder(BaseAccountingModel):
  
    order_no = models.CharField('订单编号', max_length=64, db_index=True)
    sub_order_no = models.CharField('子订单号', max_length=64, db_index=True)
    related_order_no = models.CharField('关联订单编号', max_length=64, blank=True, null=True)
    related_after_sales_no = models.CharField('关联售后单编号', max_length=64, blank=True, null=True)
    sku_detail = models.TextField('SKU明细', blank=True, null=True)
    transaction_income = models.DecimalField('交易收入', max_digits=12, decimal_places=2, blank=True, null=True)
    single_coupon_discount = models.DecimalField('单品券优惠金额', max_digits=12, decimal_places=2, blank=True,
                                                 null=True)
    shop_coupon_discount = models.DecimalField('店铺满减券优惠金额', max_digits=12, decimal_places=2, blank=True,
                                               null=True)
    declared_price_discount = models.DecimalField('申报价格折扣金额', max_digits=12, decimal_places=2, blank=True,
                                                  null=True)
    currency = models.CharField('币种', max_length=16, blank=True, null=True)
    account_time = models.DateTimeField('账务时间', blank=True, null=True)
    remark = models.TextField('备注', blank=True, null=True)

Admin:

@admin.register(SettlementOrder)
class SettlementOrderAdmin(BaseAdmin):
    resource_class = SettlementOrderResource
    export_form_class = ExportForm
    list_display = (
        'shop', 'report_country', 'import_time', 'order_no', 'sub_order_no', 'related_order_no',
        'related_after_sales_no',
        'sku_detail',
        'transaction_income', 'single_coupon_discount', 'shop_coupon_discount', 'declared_price_discount', 'currency',
        'account_time', 'waybill_fee', 'waybill_fee_cost', 'waybill_fee_refund', 'freight_income', 'freight_refund',
        'refund_amount',
        'return_freight_cost', 'tracking_no')
    search_fields = ('order_no', 'sub_order_no', 'sku_detail', 'tracking_no')
    search_help_text = '订单号、子订单号、SKU明细,运单号'
    list_filter = (
        ('shop', RelatedDropdownFilter),
        ('report_country', AllValuesCheckboxFilter),
        ('currency', AllValuesCheckboxFilter),
        ('account_time', RangeDateFilter))
    list_fullwidth = True
    list_display_links = ('order_no', 'sub_order_no')

Screenshot:

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions