prepare department location

conv_bal
watcha.h 2015-04-22 23:43:00 +07:00
parent 1adc3c7864
commit 688a46ab88
7 changed files with 27 additions and 5 deletions

View File

@ -11,8 +11,4 @@
<field name="active"/>
<field name="branch_id" required="1"/>
<field name="company_id" invisible="1"/>
<related>
<!--<field name="staffs"/>-->
<!--<field name="patients"/>-->
</related>
</form>

View File

@ -2,4 +2,14 @@
<field name="categ_id" position="after">
<field name="patient_types"/>
</field>
<field name="attributes" position="before">
<field name="departments">
<list>
<field name="department_id"/>
</list>
<form>
<field name="department_id"/>
</form>
</field>
</field>
</inherit>

View File

@ -131,3 +131,4 @@ from . import report_shop
from . import account_tax_component
from . import report_thai_wht_certif
from . import num2word
from . import department_product

View File

@ -14,8 +14,10 @@ class Department(Model):
'branch_id': fields.Many2One("clinic.branch","Branch"),
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
'patients': fields.One2Many("clinic.patient","department_id","Patients"),
'products': fields.One2Many("clinic.department.product","product_id","Products"),
'staffs': fields.One2Many("clinic.staff","department_id","Staffs"),
'active': fields.Boolean("Active"),
'product_wharehouse': fields.Boolean("Get Location From Product Warehouse"),
}
def _get_branch(self,context={}):

View File

@ -0,0 +1,12 @@
from netforce.model import Model, fields
class DepartmentProduct(Model):
_name="clinic.department.product"
_string="Department Product"
_fields={
"product_id": fields.Many2One("product","Product"),
"department_id": fields.Many2One("clinic.department","Department"),
}
DepartmentProduct.register()

View File

@ -4,6 +4,7 @@ class Product(Model):
_inherit="product"
_fields={
'patient_types': fields.Many2Many("clinic.patient.type","Patient Types"),
'departments': fields.One2Many('clinic.department.product','product_id','Departments'),
}
Product.register()