update hatching
This commit is contained in:
@@ -233,14 +233,14 @@ class Hatching(BaseModel):
|
|||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if hasattr(self, 'PedigreeName') and self.PedigreeName in correction_dict:
|
if hasattr(self, 'PedigreeName') and self.PedigreeName in correction_dict:
|
||||||
self.PedigreeName = correction_dict[self.PedigreeName]
|
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()
|
date1 = AllProductsTransport.objects.filter(hatching__id=self.id, trash=False, product='جوجه یک روزه گوشتی').order_by('date').first()
|
||||||
if date1:
|
if date1:
|
||||||
date = datetime.datetime(year=date1.date.year, month=date1.date.month, day=date1.date.day, hour=10,
|
date = datetime.datetime(year=date1.date.year, month=date1.date.month, day=date1.date.day, hour=10,
|
||||||
minute=1,
|
minute=1,
|
||||||
second=1)
|
second=1)
|
||||||
self.Date = date
|
self.Date = date
|
||||||
except:
|
else:
|
||||||
hatching_date = self.SendDateFa.split('/')
|
hatching_date = self.SendDateFa.split('/')
|
||||||
date = convert_to_miladi(
|
date = convert_to_miladi(
|
||||||
year=int(hatching_date[0]),
|
year=int(hatching_date[0]),
|
||||||
|
|||||||
Reference in New Issue
Block a user