add branch to sequence
parent
dcf852521c
commit
f8d0f01cdc
|
@ -0,0 +1,5 @@
|
||||||
|
<inherit model="address" inherit="address_form">
|
||||||
|
<field name="phone" position="after">
|
||||||
|
<field name="fax"/>
|
||||||
|
</field>
|
||||||
|
</inherit>
|
|
@ -9,6 +9,8 @@
|
||||||
<field name="parent_id"/>
|
<field name="parent_id"/>
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
|
<separator string="Address"/>
|
||||||
|
<field name="addresses" view="form_list"/>
|
||||||
<related>
|
<related>
|
||||||
<field name="departments"/>
|
<field name="departments"/>
|
||||||
</related>
|
</related>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<inherit model="sequence" inherit="sequence_form">
|
||||||
|
<field name="company_id" position="after">
|
||||||
|
<field name="branch_id"/>
|
||||||
|
</field>
|
||||||
|
</inherit>
|
|
@ -121,3 +121,5 @@ from . import select_company
|
||||||
from . import name_title
|
from . import name_title
|
||||||
from . import compute_labor_cost
|
from . import compute_labor_cost
|
||||||
from . import login
|
from . import login
|
||||||
|
from . import address
|
||||||
|
from . import sequence
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
from netforce.model import Model, fields
|
from netforce.model import Model, fields
|
||||||
from pprint import pprint
|
|
||||||
|
|
||||||
class Address(Model):
|
class Address(Model):
|
||||||
_inherit="address"
|
_inherit="address"
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
"patient_id": fields.Many2One("clinic.patient","Patient",domain=[['state','=','admit']]),
|
'fax': fields.Char("Fax"),
|
||||||
"staff_id": fields.Many2One("clinic.staff","Staff"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def write(self,ids,vals,**kw):
|
|
||||||
pprint(vals)
|
|
||||||
super().write(ids,vals,**kw)
|
|
||||||
|
|
||||||
Address.register()
|
Address.register()
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Branch(Model):
|
||||||
"company_id": fields.Many2One("company","Company"),
|
"company_id": fields.Many2One("company","Company"),
|
||||||
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
|
'departments': fields.One2Many("clinic.department","branch_id","Departments"),
|
||||||
'active': fields.Boolean("Active"),
|
'active': fields.Boolean("Active"),
|
||||||
|
"addresses": fields.One2Many("address","related_id","Addresses"),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue