filter product by code "MDC"
							parent
							
								
									dd2a844d14
								
							
						
					
					
						commit
						9d9072dbf0
					
				| 
						 | 
					@ -29,7 +29,7 @@ class ReportMedicalSummary(Model):
 | 
				
			||||||
        date_to=defaults.get('date_to',"%s-%s-%s"%(year,month,total_day))
 | 
					        date_to=defaults.get('date_to',"%s-%s-%s"%(year,month,total_day))
 | 
				
			||||||
        categ_id=defaults.get('categ_id',None)
 | 
					        categ_id=defaults.get('categ_id',None)
 | 
				
			||||||
        if not categ_id:
 | 
					        if not categ_id:
 | 
				
			||||||
            categ_ids=get_model("product.categ").search([['code','=','EPO']])
 | 
					            categ_ids=get_model("product.categ").search([['parent_id.code','=','MDC']])
 | 
				
			||||||
            if categ_ids:
 | 
					            if categ_ids:
 | 
				
			||||||
                categ_id=categ_ids[0]
 | 
					                categ_id=categ_ids[0]
 | 
				
			||||||
        branch_id=defaults.get('branch_id',None)
 | 
					        branch_id=defaults.get('branch_id',None)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -161,10 +161,14 @@ class ClinicSetting(Model):
 | 
				
			||||||
        if user_id !=1:
 | 
					        if user_id !=1:
 | 
				
			||||||
            print("Only admin!!")
 | 
					            print("Only admin!!")
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        for cost_line in get_model("clinic.labor.cost.line").search_browse([]):
 | 
					        res={}
 | 
				
			||||||
            cost_line.write({
 | 
					        for l in get_model("clinic.hd.case.line").search_browse([]):
 | 
				
			||||||
                'note': ' ',
 | 
					            prod=l.product_id
 | 
				
			||||||
            })
 | 
					            categ=l.product_categ_id
 | 
				
			||||||
 | 
					            res.setdefault(categ.name,[]).append(1)
 | 
				
			||||||
 | 
					        for k,v in res.items():
 | 
				
			||||||
 | 
					            print(k, len(v))
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
        #obj=self.browse(ids)[0]
 | 
					        #obj=self.browse(ids)[0]
 | 
				
			||||||
        #obj.del_duplicate_staff()
 | 
					        #obj.del_duplicate_staff()
 | 
				
			||||||
        print("Done!")
 | 
					        print("Done!")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							
		Loading…
	
		Reference in New Issue