fix: mlog submit wm belong_dept 缺失
This commit is contained in:
		
							parent
							
								
									3b489fdd52
								
							
						
					
					
						commit
						47f4222f03
					
				| 
						 | 
					@ -257,7 +257,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                lookup['belong_dept'] = belong_dept
 | 
					                lookup['belong_dept'] = belong_dept
 | 
				
			||||||
            if mo_count > 0:
 | 
					            if mo_count > 0:
 | 
				
			||||||
                wm, _ = WMaterial.objects.get_or_create(**lookup, defaults=lookup.update({"belong_dept": belong_dept}))
 | 
					                wm, _ = WMaterial.objects.get_or_create(**lookup, defaults={**lookup, "belong_dept": belong_dept})
 | 
				
			||||||
                wm.count = wm.count + mo_count
 | 
					                wm.count = wm.count + mo_count
 | 
				
			||||||
                wm.count_eweight = mo_count_eweight
 | 
					                wm.count_eweight = mo_count_eweight
 | 
				
			||||||
                wm.update_by = user
 | 
					                wm.update_by = user
 | 
				
			||||||
| 
						 | 
					@ -306,7 +306,7 @@ def mlog_revert(mlog: Mlog, user: User, now: Union[datetime.datetime, None]):
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    lookup['belong_dept'] = belong_dept
 | 
					                    lookup['belong_dept'] = belong_dept
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                wm, _ = WMaterial.objects.get_or_create(**lookup, defaults=lookup.update({"belong_dept": belong_dept}))
 | 
					                wm, _ = WMaterial.objects.get_or_create(**lookup, defaults={**lookup, "belong_dept": belong_dept})
 | 
				
			||||||
                wm.count = wm.count + mi_count
 | 
					                wm.count = wm.count + mi_count
 | 
				
			||||||
                wm.update_by = user
 | 
					                wm.update_by = user
 | 
				
			||||||
                wm.save()
 | 
					                wm.save()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue