clinic/netforce_clinic/models/hd_case_line.py

29 lines
1.2 KiB
Python

from netforce.model import Model, fields
class Hdcaseline(Model):
_name="clinic.hd.case.line"
_fields={
"hd_case_id": fields.Many2One("clinic.hd.case","HD Case",required=True,on_delete="cascade"),
"hd_case_dis_id": fields.Many2One("clinic.hd.case.popup.discontinue","HD Case",on_delete="cascade"),
"product_id": fields.Many2One("product","Product",search=True),
"description": fields.Char("Description",search=True),
"qty":fields.Integer("QTY"),
"uom_id": fields.Many2One("uom","UOM",required=True,search=True),
"price":fields.Float("Price"),
"amount":fields.Float("Amount"),
"type": fields.Selection([("fee","Fee"),('medicine','Medicine'),('service','Service'),("others","Others")],"Type",required=True),
"product_categ_id": fields.Many2One("product.categ","Category",domain=[['expense','=',True]]),
'reimbursable': fields.Selection([['yes','Yes'],['no','No']],"Reimbursable"),
'state': fields.Selection([['draft','Draft'],['done','Done']],"State"),
"account_id": fields.Many2One("account.account","Account"),
}
_defaults={
'type': 'others',
'reimbursable': 'no',
'state': 'draft',
}
Hdcaseline.register()