clinic/netforce_clinic/models/setting_product.py

29 lines
910 B
Python
Raw Normal View History

2014-11-26 11:22:17 +00:00
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"),
2014-12-16 09:53:36 +00:00
"type": fields.Selection([("fee","Fee"),('medicine','Medicine'),('service','Service'),("others","Others")],"Type",required=True),
2014-12-02 08:34:28 +00:00
"patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"),
2014-11-26 11:22:17 +00:00
'uom_id': fields.Many2One("uom","UOM", required=True),
"product_id": fields.Many2One("product","Product"),
'description': fields.Char("Description"),
2014-11-27 15:14:31 +00:00
'price': fields.Float("Price"),
2014-11-26 11:22:17 +00:00
'qty': fields.Integer("Qty"),
'amount': fields.Float("Amount"),
}
2014-12-16 09:53:36 +00:00
2014-11-26 11:22:17 +00:00
_defaults={
'type': 'fee',
'patient_type': 'sc',
'qty': 1,
}
2014-12-16 09:53:36 +00:00
_order="patient_type_id,type"
2014-11-26 11:22:17 +00:00
SettingProduct.register()