Skip to content

Commit

Permalink
[UPD] ssi_school
Browse files Browse the repository at this point in the history
* Penambahan informasi contract dan address pd teacher. Related dari contact
  • Loading branch information
andhit-r committed Feb 14, 2025
1 parent f89ba7f commit b623e6a
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
50 changes: 50 additions & 0 deletions ssi_school/models/school_teacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,53 @@ class SchoolTeacher(models.Model):
required=True,
ondelete="restrict",
)
image_1920 = fields.Image(
related="contact_id.image_1920",
store=False,
readonly=False,
)
street = fields.Char(
related="contact_id.street",
store=True,
readonly=False,
)
street2 = fields.Char(
related="contact_id.street2",
store=True,
readonly=False,
)
zip = fields.Char(
related="contact_id.zip",
store=True,
readonly=False,
)
city_id = fields.Many2one(
related="contact_id.city_id",
store=True,
readonly=False,
)
state_id = fields.Many2one(
related="contact_id.state_id",
store=True,
readonly=False,
)
country_id = fields.Many2one(
related="contact_id.country_id",
store=True,
readonly=False,
)
phone = fields.Char(
related="contact_id.phone",
store=True,
readonly=False,
)
mobile = fields.Char(
related="contact_id.mobile",
store=True,
readonly=False,
)
email = fields.Char(
related="contact_id.email",
store=True,
readonly=False,
)
54 changes: 54 additions & 0 deletions ssi_school/views/school_teacher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,60 @@
<xpath expr="//field[@name='name']" position="after">
<field name="contact_id" />
</xpath>
<xpath expr="//page[1]" position="before">
<page name="address" string="Contact &amp; Address">
<group name="address_1" colspan="4" col="2">
<group name="address_1_1" colspan="1" col="2">
<span class="o_form_label o_td_label" name="address_name">
<b>Address</b>
</span>
<div class="o_address_format">
<field
name="street"
placeholder="Street..."
class="o_address_street"
/>
<field
name="street2"
placeholder="Street 2..."
class="o_address_street"
/>
<field
name='city_id'
placeholder="City ..."
class="o_address_city"
context="{'default_country_id': country_id,
'default_zipcode': zip,
'default_state_id': state_id}"
domain="[('country_id', '=', country_id)]"
/>
<field
name="state_id"
class="o_address_state"
placeholder="State"
context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}"
/>
<field
name="zip"
placeholder="ZIP"
class="o_address_zip"
/>
<field
name="country_id"
placeholder="Country"
class="o_address_country"
options='{"no_open": True, "no_create": True}'
/>
</div>
</group>
<group name="address_1_2" colspan="1" col="2">
<field name="phone" widget="phone" />
<field name="mobile" widget="phone" />
<field name="email" widget="email" />
</group>
</group>
</page>
</xpath>
</data>
</field>
</record>
Expand Down

0 comments on commit b623e6a

Please sign in to comment.