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="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>

View File

@ -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>

View File

@ -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

View File

@ -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={}):

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

@ -797,7 +797,7 @@ class HDCase(Model):
"location_from_id": wh_loc_id, "location_from_id": wh_loc_id,
"location_to_id": cust_loc_id, "location_to_id": cust_loc_id,
} }
#XXX whare house in profile product #XXX wharehouse in profile product
if prod.location_id: if prod.location_id:
line_vals['location_from_id']=prod.location_id.id line_vals['location_from_id']=prod.location_id.id
pick_vals["lines"].append(("create",line_vals)) pick_vals["lines"].append(("create",line_vals))

View File

@ -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()