Skip to content

Commit

Permalink
[17.0][MIG] fieldservice_agreement: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ilo committed Sep 10, 2024
1 parent c604619 commit 0e68e71
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 121 deletions.
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
5 changes: 2 additions & 3 deletions fieldservice_agreement/tests/test_fsm_agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

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.ref("agreement.agreement_type_agreement")
self.test_person = self.env.ref("fieldservice.test_person")
self.service = self.env.ref("product.product_product_1_product_template")

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}"
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

0 comments on commit 0e68e71

Please sign in to comment.