import tb

production
watcha.h 2015-09-02 13:54:25 +07:00
parent 8d52a9a918
commit 798cdd7149
2 changed files with 15 additions and 3 deletions

View File

@ -9,9 +9,6 @@ class Migration(migration.Migration):
def migrate(self): def migrate(self):
set_active_user(1) set_active_user(1)
set_active_company(1) set_active_company(1)
#for mv in get_model("account.move").search_browse([['number','ilike', 'OPEN']]):
#mv.to_draft()
#mv.delete()
# delete old account payable # delete old account payable
dom=[ dom=[

View File

@ -7,6 +7,10 @@ from netforce.utils import get_file_path
class ConvBal(Model): class ConvBal(Model):
_inherit="conv.bal" _inherit="conv.bal"
_fields={
'track_id': fields.Many2One("account.track.categ","Track-1"),
'department_id': fields.Many2One("clinic.department","Department"),
}
def create_sale_invoices(self,ids,context={}): def create_sale_invoices(self,ids,context={}):
obj=self.browse(ids)[0] obj=self.browse(ids)[0]
@ -99,6 +103,17 @@ class ConvBal(Model):
"account_id": acc_id, "account_id": acc_id,
"amount_cur": amount_cur, "amount_cur": amount_cur,
} }
department_name=line['Department']
track_name=line['Track-1']
if department_name:
for department in get_model("clinic.department").search_browse([['name','=',department_name]]):
vals['department_id']=department.id
branch=department.branch_id
track=branch.track_id
vals['track_id']=track.id
elif track_name:
for track_id in get_model("account.track.categ").search([['name','=',track_name]]):
vals['track_id']=track_id
get_model("conv.sale.invoice").create(vals) get_model("conv.sale.invoice").create(vals)
return { return {
"next": { "next": {