add branch to sequence

conv_bal
watcha.h 2015-03-17 16:29:34 +07:00
parent dcf852521c
commit f8d0f01cdc
7 changed files with 26 additions and 8 deletions

View File

@ -0,0 +1,5 @@
<inherit model="address" inherit="address_form">
<field name="phone" position="after">
<field name="fax"/>
</field>
</inherit>

View File

@ -9,6 +9,8 @@
<field name="parent_id"/>
<field name="company_id"/>
<field name="active"/>
<separator string="Address"/>
<field name="addresses" view="form_list"/>
<related>
<field name="departments"/>
</related>

View File

@ -0,0 +1,5 @@
<inherit model="sequence" inherit="sequence_form">
<field name="company_id" position="after">
<field name="branch_id"/>
</field>
</inherit>

View File

@ -121,3 +121,5 @@ from . import select_company
from . import name_title
from . import compute_labor_cost
from . import login
from . import address
from . import sequence

View File

@ -1,16 +1,9 @@
from netforce.model import Model, fields
from pprint import pprint
class Address(Model):
_inherit="address"
_fields={
"patient_id": fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']]),
"staff_id": fields.Many2One("clinic.staff","Staff"),
'fax': fields.Char("Fax"),
}
def write(self,ids,vals,**kw):
pprint(vals)
super().write(ids,vals,**kw)
Address.register()

View File

@ -12,6 +12,7 @@ class Branch(Model):
"company_id": fields.Many2One("company","Company"),
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
'active': fields.Boolean("Active"),
"addresses": fields.One2Many("address","related_id","Addresses"),
}
_defaults={

View File

@ -0,0 +1,10 @@
from netforce.model import Model, fields
class Sequence(Model):
_inherit="sequence"
_fields={
'fax': fields.Char("Fax"),
'branch_id': fields.Many2One("clinic.branch","Branch"),
}
Sequence.register()