29 lines
910 B
Python
29 lines
910 B
Python
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"),('medicine','Medicine'),('service','Service'),("others","Others")],"Type",required=True),
|
|
"patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"),
|
|
'uom_id': fields.Many2One("uom","UOM", required=True),
|
|
"product_id": fields.Many2One("product","Product"),
|
|
'description': fields.Char("Description"),
|
|
'price': fields.Float("Price"),
|
|
'qty': fields.Integer("Qty"),
|
|
'amount': fields.Float("Amount"),
|
|
}
|
|
|
|
_defaults={
|
|
'type': 'fee',
|
|
'patient_type': 'sc',
|
|
'qty': 1,
|
|
}
|
|
|
|
_order="patient_type_id,type"
|
|
|
|
|
|
SettingProduct.register()
|