21 lines
806 B
Python
21 lines
806 B
Python
from netforce.model import Model, fields, get_model
|
|
|
|
class SettingPolicy(Model):
|
|
_name="clinic.setting.policy"
|
|
_string="Setting Policy"
|
|
|
|
_fields={
|
|
"setting_id": fields.Many2One("clinic.setting","Setting"),
|
|
"patient_type": fields.Selection([("sc","Social Security"),("uc","UC"),("others","Others")],"Type",required=True),
|
|
"invoice_policy": fields.Selection([("fee","Only fee"),("fee_mdc","Fee & Medicine")],"Policy"),
|
|
"invoice_option": fields.Selection([("fee_mdc_plus","Combine Fee & Medicine"),("fee_mdc_split","Split Fee & Medicine")],"Option"),
|
|
}
|
|
|
|
def _write(self,ids,vals,**kw):
|
|
obj=self.browse(ids)[0]
|
|
if obj.invoice_policy=='fee':
|
|
vals['invoice_option']=''
|
|
super().write(ids,vals,**kw)
|
|
|
|
SettingPolicy.register()
|