fix: wmaterial 返回count_working

This commit is contained in:
caoqianming 2024-09-12 11:24:56 +08:00
parent 7a8bee5e59
commit de42dfc75f
1 changed files with 2 additions and 2 deletions

View File

@ -108,8 +108,8 @@ class WMaterial(CommonBDModel):
count_xtest = models.PositiveIntegerField('已检数量', null=True, blank=True)
@property
def count_working(self, obj):
return Mlogb.objects.filter(wm_in=obj, mlog__work_end_time__isnull=True).aggregate(count=Sum('count'))['count'] or 0
def count_working(self):
return Mlogb.objects.filter(wm_in=self, mlog__work_end_time__isnull=True).aggregate(count=Sum('count'))['count'] or 0
class Fmlog(CommonADModel):
route = models.ForeignKey(Route, verbose_name='生产路线', on_delete=models.SET_NULL, null=True, blank=True)