diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index e8ebaa2..d051964 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -164,9 +164,13 @@ class ClinicSetting(Model): if user_id !=1: print("Only admin!!") return - obj=self.browse(ids)[0] - obj.merge_staff() - print("Done!") + sql='' + for hdcase in get_model("clinic.hd.case").search_browse([]): + for invoice in hdcase.invoices: + print(hdcase.date,' ---> ', invoice.due_date) + sql+="update account_invoice set due_date='%s' where id=%s;"%(hdcase.date,invoice.id) + db=get_connection() + db.execute(sql) def merge_staff(self,ids,context={}): user_id=get_active_user()