from netforce.model import Model, fields, get_model class SettingProduct(Model): _name="clinic.setting.product" _string="Setting Product" _fields={ "setting_id": fields.Many2One("clinic.setting","Setting"), "type": fields.Selection([("fee","FEE"),("others","Others")],"Type",required=True), "patient_type": fields.Selection([("sc","Social Security"),("uc","UC"),("others","Others")],"Patient Type",required=True), 'uom_id': fields.Many2One("uom","UOM", required=True), "product_id": fields.Many2One("product","Product"), 'description': fields.Char("Description"), 'qty': fields.Integer("Qty"), 'amount': fields.Float("Amount"), } _defaults={ 'type': 'fee', 'patient_type': 'sc', 'qty': 1, } _order="patient_type,type" SettingProduct.register()