prepare department location
parent
1adc3c7864
commit
688a46ab88
|
@ -11,8 +11,4 @@
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
<field name="branch_id" required="1"/>
|
<field name="branch_id" required="1"/>
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1"/>
|
||||||
<related>
|
|
||||||
<!--<field name="staffs"/>-->
|
|
||||||
<!--<field name="patients"/>-->
|
|
||||||
</related>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -2,4 +2,14 @@
|
||||||
<field name="categ_id" position="after">
|
<field name="categ_id" position="after">
|
||||||
<field name="patient_types"/>
|
<field name="patient_types"/>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="attributes" position="before">
|
||||||
|
<field name="departments">
|
||||||
|
<list>
|
||||||
|
<field name="department_id"/>
|
||||||
|
</list>
|
||||||
|
<form>
|
||||||
|
<field name="department_id"/>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
</inherit>
|
</inherit>
|
||||||
|
|
|
@ -131,3 +131,4 @@ from . import report_shop
|
||||||
from . import account_tax_component
|
from . import account_tax_component
|
||||||
from . import report_thai_wht_certif
|
from . import report_thai_wht_certif
|
||||||
from . import num2word
|
from . import num2word
|
||||||
|
from . import department_product
|
||||||
|
|
|
@ -14,8 +14,10 @@ class Department(Model):
|
||||||
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
'branch_id': fields.Many2One("clinic.branch","Branch"),
|
||||||
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
|
"pick_out_journal_id": fields.Many2One("stock.journal","Stock Journal",required=True),
|
||||||
'patients': fields.One2Many("clinic.patient","department_id","Patients"),
|
'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"),
|
'staffs': fields.One2Many("clinic.staff","department_id","Staffs"),
|
||||||
'active': fields.Boolean("Active"),
|
'active': fields.Boolean("Active"),
|
||||||
|
'product_wharehouse': fields.Boolean("Get Location From Product Warehouse"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_branch(self,context={}):
|
def _get_branch(self,context={}):
|
||||||
|
|
|
@ -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()
|
|
@ -4,6 +4,7 @@ class Product(Model):
|
||||||
_inherit="product"
|
_inherit="product"
|
||||||
_fields={
|
_fields={
|
||||||
'patient_types': fields.Many2Many("clinic.patient.type","Patient Types"),
|
'patient_types': fields.Many2Many("clinic.patient.type","Patient Types"),
|
||||||
|
'departments': fields.One2Many('clinic.department.product','product_id','Departments'),
|
||||||
}
|
}
|
||||||
|
|
||||||
Product.register()
|
Product.register()
|
||||||
|
|
Loading…
Reference in New Issue