from netforce.model import Model, fields class Hdcaseline(Model): _name="clinic.hd.case.line" _fields={ "hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,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"), } _defaults={ 'type': 'others', 'reimbursable': 'no', 'state': 'draft', } Hdcaseline.register()