From 2f66b82cdc71ccabcbfdc23dfa3fd5aa33d02b66 Mon Sep 17 00:00:00 2001 From: 7nimor <7nimor@gmail.com> Date: Tue, 3 Feb 2026 11:31:31 +0330 Subject: [PATCH] update hatching --- app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index 057c6c9..acec0bd 100644 --- a/app/models.py +++ b/app/models.py @@ -233,14 +233,14 @@ class Hatching(BaseModel): def save(self, *args, **kwargs): if hasattr(self, 'PedigreeName') and self.PedigreeName in correction_dict: self.PedigreeName = correction_dict[self.PedigreeName] - try: + if AllProductsTransport.objects.filter(hatching__id=self.id, trash=False, product='جوجه یک روزه گوشتی').exists(): date1 = AllProductsTransport.objects.filter(hatching__id=self.id, trash=False, product='جوجه یک روزه گوشتی').order_by('date').first() if date1: date = datetime.datetime(year=date1.date.year, month=date1.date.month, day=date1.date.day, hour=10, minute=1, second=1) self.Date = date - except: + else: hatching_date = self.SendDateFa.split('/') date = convert_to_miladi( year=int(hatching_date[0]),