Skip to content

Commit

Permalink
[IMP] fieldservice: Add notes on location (PM OCA#596) (OCA#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
osi-scampbell authored and victoralmau committed Aug 8, 2022
1 parent 13552ec commit 2cd17d5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions fieldservice/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'web_timeline',
'resource',
'contacts',
'partner_fax'
],
'data': [
'data/ir_sequence.xml',
Expand Down
10 changes: 10 additions & 0 deletions fieldservice/models/fsm_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ def _check_location_recursion(self):
raise ValidationError(_('You cannot create recursive location.'))
return True

@api.onchange('country_id')
def _onchange_country_id(self):
if self.country_id and self.country_id != self.state_id.country_id:
self.state_id = False

@api.onchange('state_id')
def _onchange_state(self):
if self.state_id.country_id:
self.country_id = self.state_id.country_id


class FSMPerson(models.Model):
_inherit = 'fsm.person'
Expand Down
8 changes: 7 additions & 1 deletion fieldservice/views/fsm_location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
<field name="owner_id"/>
<field name="customer_id"/>
<field name="contact_id" context="{'default_service_location_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id}"/>
<field name="phone" widget="phone"/>
<field name="fax" widget="phone"/>
<field name="email" widget="email"/>
<label for="street" string="Address"/>
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
Expand All @@ -89,9 +92,12 @@
<field name="description"/>
<field name="tz"/>
<field name="calendar_id"/>
<field name="category_id" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="category_id" widget="many2many_tags" options="{'color_field': 'color'}" required="True"/>
</group>
</group>
<group string="General Notes">
<field name="notes" nolabel="1" widget="html"/>
</group>
<notebook>
<page string="Directions">
<field name="direction" nolabel="1" widget="html"/>
Expand Down

0 comments on commit 2cd17d5

Please sign in to comment.