forked from OCA/field-service
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ursais/11.0-field-service-max
[FIX] Person/Location inheritance of res.partner
- Loading branch information
Showing
12 changed files
with
217 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="fsm_stage_new" model="fsm.stage"> | ||
<field name="name">New</field> | ||
<field name="sequence">10</field> | ||
</record> | ||
|
||
<record id="fsm_stage_confirmed" model="fsm.stage"> | ||
<field name="name">Confirmed</field> | ||
<field name="sequence">20</field> | ||
</record> | ||
|
||
<record id="fsm_stage_scheduled" model="fsm.stage"> | ||
<field name="name">Scheduled</field> | ||
<field name="sequence">30</field> | ||
</record> | ||
|
||
<record id="fsm_stage_assigned" model="fsm.stage"> | ||
<field name="name">Assigned</field> | ||
<field name="sequence">40</field> | ||
</record> | ||
|
||
<record id="fsm_stage_enroute" model="fsm.stage"> | ||
<field name="name">En Route</field> | ||
<field name="sequence">50</field> | ||
</record> | ||
|
||
<record id="fsm_stage_started" model="fsm.stage"> | ||
<field name="name">Started</field> | ||
<field name="sequence">60</field> | ||
</record> | ||
|
||
<record id="fsm_stage_complete" model="fsm.stage"> | ||
<field name="name">Complete</field> | ||
<field name="sequence">70</field> | ||
</record> | ||
|
||
<record id="fsm_stage_cancelled" model="fsm.stage"> | ||
<field name="name">Cancelled</field> | ||
<field name="sequence">100</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
from . import ( | ||
res_config_settings, | ||
res_partner, | ||
fsm_stage, | ||
fsm_location, | ||
fsm_person, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
# Copyright (C) 2018 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
from odoo import api, fields, models | ||
|
||
|
||
class FSMLocation(models.Model): | ||
_name = 'fsm.location' | ||
_inherit = 'res.partner' | ||
_inherits = { | ||
'res.partner': 'partner_id' | ||
} | ||
_description = 'Field Service Location' | ||
|
||
name = fields.Char(string='Name') | ||
type = fields.Char(string='Type', size=35) | ||
description = fields.Char(string='Description') | ||
|
||
@api.model | ||
def create(self, vals): | ||
vals.update({ | ||
'customer': False, | ||
'type': 'delivery', | ||
'fsm_location': True, | ||
}) | ||
return super(FSMLocation, self).create(vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
# Copyright (C) 2018 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
from odoo import api, models | ||
|
||
|
||
class FSMPerson(models.Model): | ||
_name = 'fsm.person' | ||
_inherit = 'res.partner' | ||
_inherits = { | ||
'res.partner': 'partner_id' | ||
} | ||
_description = 'Field Service Person' | ||
|
||
name = fields.Char(string='Name', size=35, required=True) | ||
@api.model | ||
def create(self, vals): | ||
vals.update({ | ||
'customer': False, | ||
'fsm_person': True, | ||
}) | ||
return super(FSMPerson, self).create(vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (C) 2018 - TODAY, Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = 'res.partner' | ||
|
||
fsm_location = fields.Boolean('Is a Field Service Location') | ||
fsm_person = fields.Boolean('Is a Field Service Person') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.