2014-11-27 15:14:31 +00:00
|
|
|
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"),
|
2014-12-02 08:34:28 +00:00
|
|
|
"patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"),
|
2014-11-28 04:54:21 +00:00
|
|
|
"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"),
|
2014-11-27 15:14:31 +00:00
|
|
|
}
|
|
|
|
|
2014-12-16 09:53:36 +00:00
|
|
|
_order="patient_type_id"
|
|
|
|
|
2014-11-28 04:54:21 +00:00
|
|
|
def _write(self,ids,vals,**kw):
|
|
|
|
obj=self.browse(ids)[0]
|
|
|
|
if obj.invoice_policy=='fee':
|
|
|
|
vals['invoice_option']=''
|
|
|
|
super().write(ids,vals,**kw)
|
|
|
|
|
2014-11-27 15:14:31 +00:00
|
|
|
SettingPolicy.register()
|