Skip to content

Commit

Permalink
11.0 imp fieldservice_agreement (OCA#76)
Browse files Browse the repository at this point in the history
* [IMP] fieldservice_agreement
  • Loading branch information
Sandip Mangukiya authored and patrickrwilson committed Apr 27, 2021
1 parent d97433f commit e9b9210
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions fieldservice_agreement/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"maintainers": [
"max3903",
"bodedra",
"smangukiya",
],
}
2 changes: 2 additions & 0 deletions fieldservice_agreement/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ class FSMOrder(geo_model.GeoModel):
_inherit = 'fsm.order'

agreement_id = fields.Many2one('agreement', string='Agreement')
serviceprofile_id = fields.Many2one('agreement.serviceprofile',
'Service Profile')
1 change: 1 addition & 0 deletions fieldservice_agreement/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Bhavesh Odedra <[email protected]>
* Sandip Mangukiya <[email protected]>
3 changes: 1 addition & 2 deletions fieldservice_agreement/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ To use this module:
* Select or create a field service order and set the agreement
* Go to Agreement > Agreements
* Open the previous agreement
* Click on the smart button "Service Orders" to see the list of related field
service orders
* Click on the smart button "Service Orders" to see the list of related field service orders
7 changes: 5 additions & 2 deletions fieldservice_agreement/views/agreement_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<field name="inherit_id" ref="agreement.partner_agreement_form_view"/>
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button name="action_view_service_order" type="object" class="oe_stat_button" icon="fa-pencil-square-o" attrs="{'invisible': [('service_order_count', '=', 0)]}">
<field name="service_order_count" widget="statinfo" string="Service Orders"/>
<button name="action_view_service_order" type="object"
class="oe_stat_button" icon="fa-pencil-square-o"
attrs="{'invisible': [('service_order_count', '=', 0)]}">
<field name="service_order_count" widget="statinfo"
string="Service Orders"/>
</button>
</div>
</field>
Expand Down
15 changes: 15 additions & 0 deletions fieldservice_agreement/views/fsm_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@
<field name="arch" type="xml">
<field name="location_id" position="after">
<field name="agreement_id"/>
<field name="serviceprofile_id"
domain="[('agreement_id', '=', agreement_id)]"/>
</field>
</field>
</record>

<!-- Inherit fsm.order search view-->
<record id="search_fsm_order_filter_agreement" model="ir.ui.view">
<field name="name">fsm.order.select.agreement</field>
<field name="model">fsm.order</field>
<field name="inherit_id" ref="fieldservice.fsm_order_search_view"/>
<field name="arch" type="xml">
<xpath expr="//group" position="inside">
<filter string="Service Profile" domain="[]"
context="{'group_by':'serviceprofile_id'}"/>
</xpath>
</field>
</record>

</odoo>

0 comments on commit e9b9210

Please sign in to comment.