use main product to create GI

conv_bal
watcha.h 2015-03-17 14:00:11 +07:00
parent fd63be1777
commit f689ffbbd8
5 changed files with 13 additions and 10 deletions

View File

@ -60,7 +60,7 @@
<field name="who_transplantation"/> <field name="who_transplantation"/>
<field name="reason_of_chronic_renal_failure"/> <field name="reason_of_chronic_renal_failure"/>
</tab> </tab>
<tab string="Cycles"> <tab string="Cycle Setting">
<group span="8" columns="1"> <group span="8" columns="1">
<field name="cycles" nolabel="1"> <field name="cycles" nolabel="1">
<list> <list>

View File

@ -13,8 +13,10 @@
<field name="company_id" invisible="1"/> <field name="company_id" invisible="1"/>
</tab> </tab>
<tab string="Other"> <tab string="Other">
<field name="color"/>
<field name="hct_include"/> <field name="hct_include"/>
<field name="main_product"/>
<field name="color"/>
<newline/>
<group span="6" columns="1"> <group span="6" columns="1">
<template> <template>
<div> <div>

View File

@ -614,7 +614,6 @@ class HDCase(Model):
if not ship_address_id: if not ship_address_id:
patient.simple_address() patient.simple_address()
#raise Exception("contact %s dont'have address with type shipping"%partner.name) #raise Exception("contact %s dont'have address with type shipping"%partner.name)
# default journal # default journal
cust_loc_id=None cust_loc_id=None
wh_loc_id=None wh_loc_id=None
@ -627,7 +626,6 @@ class HDCase(Model):
wh_loc_id=stock_journal.location_from_id.id wh_loc_id=stock_journal.location_from_id.id
cust_loc_id=stock_journal.location_to_id.id cust_loc_id=stock_journal.location_to_id.id
print("get location from stock journal %s "%(stock_journal.name)) print("get location from stock journal %s "%(stock_journal.name))
pick_vals={ pick_vals={
"type": "out", "type": "out",
'journal_id': stock_journal.id, 'journal_id': stock_journal.id,
@ -661,6 +659,7 @@ class HDCase(Model):
continue continue
# check orginal product # check orginal product
prod_code=prod.code.split("-")[0] prod_code=prod.code.split("-")[0]
if patient.type_id.main_product:
if len(prod_code)>1: if len(prod_code)>1:
prods=get_model('product').search_browse(['code','=',prod_code]) prods=get_model('product').search_browse(['code','=',prod_code])
if not prods: if not prods:

View File

@ -199,7 +199,8 @@ class Patient(Model):
return res['department_ids'] return res['department_ids']
else: else:
return [res['department_id']] return [res['department_id']]
return get_model("clinic.department").search([]) dpts=get_model("clinic.department").search([])
return dpts
def _get_department(self,context={}): def _get_department(self,context={}):
res=get_model('select.company').get_select() res=get_model('select.company').get_select()

View File

@ -12,6 +12,7 @@ class PatientType(Model):
'contact_id': fields.Many2One("partner","Contact",domain=[['type','=','org']],search=True), 'contact_id': fields.Many2One("partner","Contact",domain=[['type','=','org']],search=True),
'default': fields.Boolean("Default"), 'default': fields.Boolean("Default"),
'hct_include': fields.Boolean("HCT Include"), 'hct_include': fields.Boolean("HCT Include"),
'main_product': fields.Boolean("Use Main Product for Create GI"),
'company_id': fields.Many2One("company","Company"), 'company_id': fields.Many2One("company","Company"),
'color': fields.Char("Color"), 'color': fields.Char("Color"),
} }