clinic/netforce_clinic/models/setting_product.py

34 lines
1.2 KiB
Python
Raw Normal View History

2015-01-09 05:19:52 +00:00
from netforce.model import Model, fields
from netforce.access import get_active_company
2014-11-26 11:22:17 +00:00
class SettingProduct(Model):
_name="clinic.setting.product"
_string="Setting Product"
2015-01-09 05:19:52 +00:00
_multi_company=True
2014-11-26 11:22:17 +00:00
_fields={
"setting_id": fields.Many2One("clinic.setting","Setting"),
2014-12-02 08:34:28 +00:00
"patient_type_id": fields.Many2One("clinic.patient.type","Patient Type"),
2014-12-21 02:54:45 +00:00
"product_categ_id": fields.Many2One("product.categ","Category",domain=[['expense','=',True]]),
'reimbursable': fields.Selection([['yes','Yes'],['no','No']],"Reimbursable"),
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"),
2015-01-09 05:19:52 +00:00
"account_id": fields.Many2One("account.account","Account",multi_company=True),
'company_id': fields.Many2One("company","Company"),
2014-11-26 11:22:17 +00:00
}
2014-12-16 09:53:36 +00:00
2014-11-26 11:22:17 +00:00
_defaults={
2015-01-09 05:19:52 +00:00
"company_id": lambda *a: get_active_company(),
2014-11-26 11:22:17 +00:00
'qty': 1,
2014-12-21 02:54:45 +00:00
'reimbursable': 'no',
2014-11-26 11:22:17 +00:00
}
2014-12-21 02:54:45 +00:00
_order="patient_type_id"
2014-11-26 11:22:17 +00:00
SettingProduct.register()