update due_date

conv_bal
watcha.h@almacom.co.th 2015-07-23 08:41:29 +07:00
parent a2de551f12
commit 2e60a170f9
1 changed files with 7 additions and 3 deletions

View File

@ -164,9 +164,13 @@ class ClinicSetting(Model):
if user_id !=1: if user_id !=1:
print("Only admin!!") print("Only admin!!")
return return
obj=self.browse(ids)[0] sql=''
obj.merge_staff() for hdcase in get_model("clinic.hd.case").search_browse([]):
print("Done!") 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={}): def merge_staff(self,ids,context={}):
user_id=get_active_user() user_id=get_active_user()