Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] fieldservice_agreement: Migration to 17.0 #1210

Open
wants to merge 41 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8d1d188
[11.0][ADD] fieldservice_agreement module
Dec 11, 2018
87e0283
[IMP] Various improvements
max3903 Dec 13, 2018
f587ffc
[ADD] fieldservice_skill
Dec 4, 2018
776244f
11.0 imp fieldservice_agreement (#76)
Dec 27, 2018
3a7bbe0
[IMP] Icon
max3903 Dec 27, 2018
e1ca24d
[IMP] Show stat and improve filter
max3903 Jan 3, 2019
d4429a0
[IMP] Filtering
max3903 Jan 3, 2019
70799a5
[IMP] fieldservice_agreement
max3903 Jan 31, 2019
35c3c67
[ADD] Merge fieldservice_equipment_agreement
max3903 Feb 8, 2019
b5e70d2
[IMP] Change Kanban Date
osi-scampbell Feb 22, 2019
f6b8526
[FIX]1. message_follower_ids needs to be inherited in object first 2.…
Feb 25, 2019
8b8f05f
[IMP] Fieldservice Account Bug Fix
osi-scampbell Mar 8, 2019
cce76ab
[MIG][WIP][12.0] fieldservice_agreement
murtuzasaleh Apr 4, 2019
e1fba64
[IMP] #118 Agreement Filter Location
osi-scampbell May 2, 2019
639bf66
[IMP] #115 Worker Agreement Smart Button
osi-scampbell May 2, 2019
9361666
[IMP] fieldservice_agreement
max3903 May 24, 2019
8da579e
[FIX] fieldservice_agreement (#232)
osi-scampbell Jun 11, 2019
7a8f89d
[FIX] fieldservice_agreement: FSM Location Agreement Bug (#237)
osi-scampbell Jun 18, 2019
8b4293b
[12.0][IMP] fieldservice_agreement, add unit test
kittiu Aug 1, 2019
9f7d22f
[IMP] Filter Out Templates
osi-scampbell Aug 21, 2019
1d682ad
[FIX] fieldservice_agreement
max3903 Oct 10, 2019
6f2147a
[FIX] fieldservice_agreement
max3903 Oct 10, 2019
9268dbd
[FIX] fieldservice_agreement
max3903 Oct 11, 2019
cf1e8fe
[IMP] Improved Test Cases
osi-scampbell Oct 21, 2019
cb20656
[14.0][MIG] fieldservice_agreement (Version 12.0 to 14.0)
patrickrwilson May 5, 2021
6700f3f
[UPD] Update fieldservice_agreement.pot
oca-travis Jul 12, 2021
5ec4757
[UPD] README.rst
OCA-git-bot Jul 12, 2021
cdf81d9
Fix pre-commit
hparfr Apr 7, 2022
42b575e
fieldservice_agreement 14.0.1.1.0
OCA-git-bot Apr 7, 2022
60ee4c1
[FIX] fieldservice_agreement: adapt access to ir.actions.* records
brian10048 May 5, 2022
2815fea
fieldservice_agreement 14.0.1.1.1
OCA-git-bot May 9, 2022
96b6f05
Added translation using Weblate (Italian)
mymage Oct 27, 2022
efb649e
Translated using Weblate (Italian)
mymage Oct 27, 2022
d65c267
[UPD] README.rst
OCA-git-bot Sep 3, 2023
a3428e3
Update translation files
weblate Oct 9, 2023
95e276b
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 27, 2023
6355b0b
[MIG] fieldservice_agreement: Migration to 16.0
szekawong Nov 6, 2023
c604619
[IMP] fieldservice_agreement: pre-commit auto fixes
Sep 9, 2024
5983135
[17.0][MIG] fieldservice_agreement: Migration to 17.0
Sep 9, 2024
90e4561
[17.0[ADD] fieldservice_agreement_serviceprofile
Sep 20, 2024
4dc8a54
Add dependency file for tests purposes
Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fieldservice_agreement/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Contributors
- Sandip Mangukiya <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Patrick Wilson <[email protected]>
- Italo LOPES <[email protected]>

Other credits
-------------
Expand Down
3 changes: 1 addition & 2 deletions fieldservice_agreement/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
"category": "Field Service",
"license": "AGPL-3",
"version": "17.0.1.0.0",
"depends": ["fieldservice", "agreement_serviceprofile"],
"depends": ["fieldservice", "agreement"],
"data": [
"views/fsm_order_view.xml",
"views/fsm_equipment_view.xml",
"views/agreement_view.xml",
"views/fsm_person.xml",
"views/fsm_location.xml",
],
"installable": True,
"development_status": "Beta",
Expand Down
5 changes: 4 additions & 1 deletion fieldservice_agreement/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import agreement, fsm_equipment, fsm_location, fsm_order, fsm_person
from . import agreement
from . import fsm_equipment
from . import fsm_order
from . import fsm_person
1 change: 0 additions & 1 deletion fieldservice_agreement/models/fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ class FSMEquipment(models.Model):
_inherit = "fsm.equipment"

agreement_id = fields.Many2one("agreement", string="Agreement")
serviceprofile_id = fields.Many2one("agreement.serviceprofile", "Service Profile")
29 changes: 0 additions & 29 deletions fieldservice_agreement/models/fsm_location.py

This file was deleted.

1 change: 0 additions & 1 deletion fieldservice_agreement/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ class FSMOrder(models.Model):
_inherit = "fsm.order"

agreement_id = fields.Many2one("agreement", string="Agreement")
serviceprofile_id = fields.Many2one("agreement.serviceprofile", "Service Profile")
4 changes: 2 additions & 2 deletions fieldservice_agreement/models/fsm_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ def _compute_agreements(self):
def action_view_agreements(self):
for person in self:
action = self.env["ir.actions.act_window"]._for_xml_id(
"agreement_legal.agreement_operations_agreement"
"agreement.agreement_action"
)
agreements = self.env["agreement"].search(
[("partner_id", "=", person.partner_id.id)]
)
if len(agreements) == 1:
action["views"] = [
(
self.env.ref("agreement_legal.partner_agreement_form_view").id,
self.env.ref("agreement.agreement_form").id,
"form",
)
]
Expand Down
1 change: 1 addition & 0 deletions fieldservice_agreement/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- Sandip Mangukiya \<<[email protected]>\>
- Serpent Consulting Services Pvt. Ltd. \<<[email protected]>\>
- Patrick Wilson \<<[email protected]>\>
- Italo LOPES \<<[email protected]>\>
1 change: 1 addition & 0 deletions fieldservice_agreement/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Sandip Mangukiya &lt;<a class="reference external" href="mailto:smangukiya&#64;opensourceintegrators.com">smangukiya&#64;opensourceintegrators.com</a>&gt;</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
<li>Patrick Wilson &lt;<a class="reference external" href="mailto:pwilson&#64;opensourceintegrators.com">pwilson&#64;opensourceintegrators.com</a>&gt;</li>
<li>Italo LOPES &lt;<a class="reference external" href="mailto:italo.lopes&#64;camptocamp.com">italo.lopes&#64;camptocamp.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
20 changes: 6 additions & 14 deletions fieldservice_agreement/tests/test_fsm_agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

class FSMOrder(TransactionCase):
def setUp(self):
super(FSMOrder, self).setUp()
super().setUp()
self.Order = self.env["fsm.order"]
self.Agreement = self.env["agreement"]
self.Serviceprofile = self.env["agreement.serviceprofile"]
self.Equipment = self.env["fsm.equipment"]
self.test_location = self.env.ref("fieldservice.test_location")
self.agreement_type = self.env.ref("agreement_legal.agreement_type_agreement")
self.agreement_type = self.env["agreement.type"].create(
{"name": "Test Agreement Type"}
)
self.test_person = self.env.ref("fieldservice.test_person")
self.service = self.env.ref("product.product_product_1_product_template")

Expand All @@ -25,22 +26,15 @@ def test_fsm_agreement(self):
- Person (partner) can relate back to agreement correctly
"""
# Create agreement and assign to test location
view_id = "agreement_legal.partner_agreement_form_view"
view_id = "agreement.agreement_form"
with Form(self.Agreement, view=view_id) as f:
f.name = "Test Agreement"
f.agreement_type_id = self.agreement_type
f.description = "Test Agreement"
f.code = "TestAgreement"
f.start_date = f.end_date = fields.Date.today()
f.fsm_location_id = self.test_location
f.partner_id = self.test_person.partner_id
agreement = f.save()
profile = self.Serviceprofile.create(
{
"name": "Test Profile",
"agreement_id": agreement.id,
"product_id": self.service.id,
}
)
# Create 2 Orders, that link to this agreement
vals = {
"name": "Order1",
Expand Down Expand Up @@ -81,8 +75,6 @@ def test_fsm_agreement(self):
[equipment1.id, equipment2.id, equipment3.id],
agreement.action_view_fsm_equipment()["domain"][0][2],
)
# Location's service profile display correctly
self.assertEqual(self.test_location.serviceprofile_ids, profile)
# Person (partner) can relate back to agreement correctly
self.assertEqual(self.test_person.agreement_count, 1)
self.assertEqual(
Expand Down
49 changes: 3 additions & 46 deletions fieldservice_agreement/views/agreement_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<record id="agreement_fsm_order_form_view" model="ir.ui.view">
<field name="name">agreement.form.fsm.order.view</field>
<field name="model">agreement</field>
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view" />
<field name="inherit_id" ref="agreement.agreement_form" />
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button
Expand All @@ -24,7 +24,7 @@
type="object"
class="oe_stat_button"
icon="fa-laptop"
context="{'default_agreement_id': active_id}"
context="{'default_agreement_id': id}"
imlopes marked this conversation as resolved.
Show resolved Hide resolved
groups="fieldservice.group_fsm_equipment"
>
<div class="o_field_widget o_stat_info">
Expand Down Expand Up @@ -56,55 +56,12 @@
<field name="name">agreement.search.fields</field>
<field name="model">agreement</field>
<field name="type">search</field>
<field name="inherit_id" ref="agreement_legal.partner_agreement_search_view" />
<field name="inherit_id" ref="agreement.agreement_search" />
<field name="arch" type="xml">
<xpath expr="/search/filter[1]" position="before">
<field name="fsm_location_id" />
</xpath>
</field>
</record>

<record id="agreement_form_context_fix" model="ir.ui.view">
<field name="name">agreement.form.context.fix</field>
<field name="model">agreement</field>
<field name="type">form</field>
<field name="inherit_id" ref="agreement_legal.partner_agreement_form_view" />
<field name="priority" eval="1000" />
<!-- TODO remove position=replace and priority -->
<field name="arch" type="xml">
<field name="recital_ids" position="replace">
<field
name="recital_ids"
default_order="sequence"
nolabel="1"
context="{'default_agreement_id': active_id}"
/>
</field>
<field name="clauses_ids" position="replace">
<field
name="clauses_ids"
default_order="sequence"
nolabel="1"
context="{'default_agreement_id': active_id}"
/>
</field>
<field name="sections_ids" position="replace">
<field
name="sections_ids"
default_order="sequence"
nolabel="1"
context="{'default_agreement_id': active_id}"
/>
</field>
<field name="appendix_ids" position="replace">
<field
name="appendix_ids"
default_order="sequence"
nolabel="1"
context="{'default_agreement_id': active_id}"
/>
</field>
</field>
</record>

</odoo>
10 changes: 3 additions & 7 deletions fieldservice_agreement/views/fsm_equipment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
name="agreement_id"
domain="[('fsm_location_id', '=', location_id)]"
/>
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</group>
<group id="agreement-right" />
</group>
Expand All @@ -34,10 +30,10 @@
<field name="arch" type="xml">
<xpath expr="//group" position="inside">
<filter
name="serviceprofile_id"
string="Service Profile"
name="agreement_id"
string="Agreement"
domain="[]"
context="{'group_by': 'serviceprofile_id'}"
context="{'group_by': 'agreement_id'}"
/>
</xpath>
</field>
Expand Down
22 changes: 0 additions & 22 deletions fieldservice_agreement/views/fsm_location.xml

This file was deleted.

10 changes: 3 additions & 7 deletions fieldservice_agreement/views/fsm_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
name="agreement_id"
domain="[('fsm_location_id', '=', location_id), ('is_template', '=', False)]"
/>
<field
name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"
/>
</field>
</field>
</record>
Expand All @@ -27,10 +23,10 @@
<field name="arch" type="xml">
<xpath expr="//group" position="inside">
<filter
name="serviceprofile_id"
string="Service Profile"
name="agreement_id"
string="Agreement"
domain="[]"
context="{'group_by': 'serviceprofile_id'}"
context="{'group_by': 'agreement_id'}"
/>
</xpath>
</field>
Expand Down