Skip to content

Commit

Permalink
[15.0][MIG] fieldservice_project
Browse files Browse the repository at this point in the history
  • Loading branch information
Murtaza-OSI committed Jan 7, 2022
1 parent 692bef3 commit 29ec1d6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 31 deletions.
10 changes: 5 additions & 5 deletions fieldservice_project/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Field Service - Project
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
:target: https://github.com/OCA/field-service/tree/14.0/fieldservice_project
:target: https://github.com/OCA/field-service/tree/15.0/fieldservice_project
:alt: OCA/field-service
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_project
:target: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_project
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/264/14.0
:target: https://runbot.odoo-community.org/runbot/264/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -53,7 +53,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_project%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_project%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -94,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/14.0/fieldservice_project>`_ project on GitHub.
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/15.0/fieldservice_project>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
7 changes: 6 additions & 1 deletion fieldservice_project/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Field Service - Project",
"summary": "Create field service orders from a project or project task",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "Pavlov Media, Odoo Community Association (OCA)",
"category": "Project",
Expand All @@ -17,5 +17,10 @@
"security/ir.model.access.csv",
"views/fsm_team.xml",
],
"assets": {
"web.assets_backend": [
"/fieldservice_project/static/src/scss/project_column.scss",
]
},
"installable": True,
}
7 changes: 2 additions & 5 deletions fieldservice_project/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ def action_view_order(self):
"""
action = self.env.ref("fieldservice.action_fsm_operation_order").read()[0]
order = self.env["fsm.order"].search([("id", "=", self.id)])
action["views"] = [
(self.env.ref("fieldservice." + "fsm_order_form").id, "form")
]
action["views"] = [(self.env.ref("fieldservice.fsm_order_form").id, "form")]
action["res_id"] = order.id
return action

@api.onchange("team_id")
def onchange_team_id(self):
if self.team_id and self.team_id.project_id:
self.project_id = self.team_id.project_id
self.project_id = self.team_id.project_id
6 changes: 4 additions & 2 deletions fieldservice_project/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ def action_create_order(self):
This function returns an action that displays a full FSM Order
form when creating an FSM Order from a project.
"""
action = self.env.ref("fieldservice.action_fsm_operation_order")
action = self.env.ref(
"fieldservice.action_fsm_operation_order", raise_if_not_found=False
)
result = action.read()[0]
# override the context to get rid of the default filtering
result["context"] = {
"default_project_id": self.id,
"default_location_id": self.fsm_location_id.id,
"default_origin": self.name,
}
res = self.env.ref("fieldservice.fsm_order_form", False)
res = self.env.ref("fieldservice.fsm_order_form", raise_if_not_found=False)
result["views"] = [(res and res.id or False, "form")]
return result
8 changes: 4 additions & 4 deletions fieldservice_project/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Field Service - Project</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Field Service - Project</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/field-service/tree/14.0/fieldservice_project"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/field-service-14-0/field-service-14-0-fieldservice_project"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/264/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/field-service/tree/15.0/fieldservice_project"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_project"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/264/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows field service orders to be created from projects and project tasks.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -403,7 +403,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/field-service/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_project%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_project%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -439,7 +439,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/14.0/fieldservice_project">OCA/field-service</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/15.0/fieldservice_project">OCA/field-service</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions fieldservice_project/tests/common.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase


class Common(SavepointCase):
class Common(TransactionCase):
@classmethod
def setUpClass(cls):
super(Common, cls).setUpClass()
Expand Down
12 changes: 0 additions & 12 deletions fieldservice_project/views/project_views.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
<odoo>
<template
id="shrink_tree_column"
name="account assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<link
rel="stylesheet"
href="/fieldservice_project/static/src/scss/project_column.scss"
/>
</xpath>
</template>
<record id="fieldservice_project_view_form" model="ir.ui.view">
<field name="name">project.fieldservice.form</field>
<field name="model">project.project</field>
Expand Down
6 changes: 6 additions & 0 deletions setup/fieldservice_project/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 29ec1d6

Please sign in to comment.