Skip to content

Commit

Permalink
[MIG] fieldservice_account_analytic: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgarRetes committed Nov 22, 2024
1 parent 8821eba commit 4a17d52
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 36 deletions.
10 changes: 5 additions & 5 deletions fieldservice_account_analytic/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Field Service - Analytic Accounting
: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/17.0/fieldservice_account_analytic
:target: https://github.com/OCA/field-service/tree/18.0/fieldservice_account_analytic
: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-17-0/field-service-17-0-fieldservice_account_analytic
:target: https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-fieldservice_account_analytic
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -61,7 +61,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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_account_analytic%0Aversion:%2017.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_account_analytic%0Aversion:%2018.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 @@ -118,6 +118,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-osimallen| |maintainer-brian10048| |maintainer-bodedra|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion fieldservice_account_analytic/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Field Service - Analytic Accounting",
"summary": """Track analytic accounts on Field Service locations
and orders""",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Field Service",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/field-service",
Expand Down
23 changes: 12 additions & 11 deletions fieldservice_account_analytic/models/analytic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ class AccountAnalyticLine(models.Model):
fsm_order_id = fields.Many2one("fsm.order", string="FSM Order")
product_id = fields.Many2one("product.product", string="Time Type")

@api.model
def create(self, vals):
order = self.env["fsm.order"].browse(vals.get("fsm_order_id"))
if order:
if order.location_id.analytic_account_id:
vals["account_id"] = order.location_id.analytic_account_id.id
else:
raise ValidationError(
_("No analytic account set " "on the order's Location.")
)
return super().create(vals)
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
order = self.env["fsm.order"].browse(vals.get("fsm_order_id"))
if order:
if order.location_id.analytic_account_id:
vals["account_id"] = order.location_id.analytic_account_id.id
else:
raise ValidationError(
_("No analytic account set " "on the order's Location.")
)
return super().create(vals_list)

@api.onchange("product_id")
def onchange_product_id(self):
Expand Down
2 changes: 0 additions & 2 deletions fieldservice_account_analytic/models/fsm_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def _search(
offset=0,
limit=None,
order=None,
access_rights_uid=None,
):
args = args or []
context = dict(self._context) or {}
Expand All @@ -54,5 +53,4 @@ def _search(
offset=offset,
limit=limit,
order=order,
access_rights_uid=access_rights_uid,
)
2 changes: 0 additions & 2 deletions fieldservice_account_analytic/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def _search(
offset=0,
limit=None,
order=None,
access_rights_uid=None,
):
args = args or []
context = dict(self._context) or {}
Expand All @@ -33,5 +32,4 @@ def _search(
offset=offset,
limit=limit,
order=order,
access_rights_uid=access_rights_uid,
)
Binary file modified fieldservice_account_analytic/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fieldservice_account_analytic/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions fieldservice_account_analytic/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,7 +369,7 @@ <h1 class="title">Field Service - Analytic Accounting</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:187502c73f589c1c69cf504b3bb83cd50ca38eee87433bde51306e12d8cad645
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/field-service/tree/17.0/fieldservice_account_analytic"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_account_analytic"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/field-service/tree/18.0/fieldservice_account_analytic"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-fieldservice_account_analytic"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the ability to track your analytic accounts on field
service orders. It also adds the option to track the billing partner for
field service locations and orders.</p>
Expand Down Expand Up @@ -408,7 +409,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_account_analytic%0Aversion:%2017.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_account_analytic%0Aversion:%2018.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 @@ -442,13 +443,15 @@ <h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<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>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/osimallen"><img alt="osimallen" src="https://github.com/osimallen.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/brian10048"><img alt="brian10048" src="https://github.com/brian10048.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/bodedra"><img alt="bodedra" src="https://github.com/bodedra.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/17.0/fieldservice_account_analytic">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/18.0/fieldservice_account_analytic">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
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def setUpClass(cls):
)
cls.default_account_revenue = cls.env["account.account"].search(
[
("company_id", "=", cls.env.user.company_id.id),
("company_ids", "in", cls.env.user.company_id.id),
("account_type", "=", "income"),
],
limit=1,
Expand All @@ -81,7 +81,7 @@ def setUpClass(cls):
cls.product1 = cls.env["product.product"].create(
{
"name": "Product A",
"detailed_type": "consu",
"type": "consu",
}
)

Expand Down
6 changes: 3 additions & 3 deletions fieldservice_account_analytic/views/fsm_location.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<odoo>
<!-- Field Service Location Tree View-->
<record id="fsm_location_tree_view_analytic" model="ir.ui.view">
<field name="name">fsm.location.tree.accounting</field>
<record id="fsm_location_list_view_analytic" model="ir.ui.view">
<field name="name">fsm.location.list.accounting</field>
<field name="model">fsm.location</field>
<field name="inherit_id" ref="fieldservice.fsm_location_tree_view" />
<field name="inherit_id" ref="fieldservice.fsm_location_list_view" />
<field name="arch" type="xml">
<field name="owner_id" position="after">
<field name="customer_id" />
Expand Down
6 changes: 3 additions & 3 deletions fieldservice_account_analytic/views/fsm_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
</field>
</field>
</record>
<record id="fsm_order_tree_view" model="ir.ui.view">
<field name="name">fsm.order.tree</field>
<record id="fsm_order_list_view" model="ir.ui.view">
<field name="name">fsm.order.list</field>
<field name="model">fsm.order</field>
<field name="inherit_id" ref="fieldservice.fsm_order_tree_view" />
<field name="inherit_id" ref="fieldservice.fsm_order_list_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="customer_id" />
Expand Down

0 comments on commit 4a17d52

Please sign in to comment.