Skip to content

Commit 50d20bf

Browse files
committed
[MIG] fieldservice_account_analytic: Migration to 18.0
1 parent 8821eba commit 50d20bf

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

fieldservice_account_analytic/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Field Service - Analytic Accounting
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
20-
:target: https://github.com/OCA/field-service/tree/17.0/fieldservice_account_analytic
20+
:target: https://github.com/OCA/field-service/tree/18.0/fieldservice_account_analytic
2121
:alt: OCA/field-service
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/field-service-17-0/field-service-17-0-fieldservice_account_analytic
23+
:target: https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-fieldservice_account_analytic
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -61,7 +61,7 @@ Bug Tracker
6161
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
6262
In case of trouble, please check there if your issue has already been reported.
6363
If you spotted it first, help us to smash it by providing a detailed and welcomed
64-
`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**>`_.
64+
`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**>`_.
6565

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

@@ -118,6 +118,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
118118

119119
|maintainer-osimallen| |maintainer-brian10048| |maintainer-bodedra|
120120

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

123123
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

fieldservice_account_analytic/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Field Service - Analytic Accounting",
66
"summary": """Track analytic accounts on Field Service locations
77
and orders""",
8-
"version": "17.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"category": "Field Service",
1010
"author": "Open Source Integrators, Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/field-service",

fieldservice_account_analytic/models/analytic_account.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ class AccountAnalyticLine(models.Model):
1111
fsm_order_id = fields.Many2one("fsm.order", string="FSM Order")
1212
product_id = fields.Many2one("product.product", string="Time Type")
1313

14-
@api.model
15-
def create(self, vals):
16-
order = self.env["fsm.order"].browse(vals.get("fsm_order_id"))
17-
if order:
18-
if order.location_id.analytic_account_id:
19-
vals["account_id"] = order.location_id.analytic_account_id.id
20-
else:
21-
raise ValidationError(
22-
_("No analytic account set " "on the order's Location.")
23-
)
24-
return super().create(vals)
14+
@api.model_create_multi
15+
def create(self, vals_list):
16+
for vals in vals_list:
17+
order = self.env["fsm.order"].browse(vals.get("fsm_order_id"))
18+
if order:
19+
if order.location_id.analytic_account_id:
20+
vals["account_id"] = order.location_id.analytic_account_id.id
21+
else:
22+
raise ValidationError(
23+
_("No analytic account set " "on the order's Location.")
24+
)
25+
return super().create(vals_list)
2526

2627
@api.onchange("product_id")
2728
def onchange_product_id(self):

fieldservice_account_analytic/models/fsm_location.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def _search(
3838
offset=0,
3939
limit=None,
4040
order=None,
41-
access_rights_uid=None,
4241
):
4342
args = args or []
4443
context = dict(self._context) or {}
@@ -54,5 +53,4 @@ def _search(
5453
offset=offset,
5554
limit=limit,
5655
order=order,
57-
access_rights_uid=access_rights_uid,
5856
)

fieldservice_account_analytic/models/res_partner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def _search(
1414
offset=0,
1515
limit=None,
1616
order=None,
17-
access_rights_uid=None,
1817
):
1918
args = args or []
2019
context = dict(self._context) or {}
@@ -33,5 +32,4 @@ def _search(
3332
offset=offset,
3433
limit=limit,
3534
order=order,
36-
access_rights_uid=access_rights_uid,
3735
)

fieldservice_account_analytic/static/description/index.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,7 +369,7 @@ <h1 class="title">Field Service - Analytic Accounting</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:187502c73f589c1c69cf504b3bb83cd50ca38eee87433bde51306e12d8cad645
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<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>
372+
<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>
372373
<p>This module adds the ability to track your analytic accounts on field
373374
service orders. It also adds the option to track the billing partner for
374375
field service locations and orders.</p>
@@ -408,7 +409,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
408409
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/field-service/issues">GitHub Issues</a>.
409410
In case of trouble, please check there if your issue has already been reported.
410411
If you spotted it first, help us to smash it by providing a detailed and welcomed
411-
<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>
412+
<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>
412413
<p>Do not contact contributors directly about support or help with technical issues.</p>
413414
</div>
414415
<div class="section" id="credits">
@@ -442,13 +443,15 @@ <h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
442443
<div class="section" id="maintainers">
443444
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
444445
<p>This module is maintained by the OCA.</p>
445-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
446+
<a class="reference external image-reference" href="https://odoo-community.org">
447+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
448+
</a>
446449
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
447450
mission is to support the collaborative development of Odoo features and
448451
promote its widespread use.</p>
449452
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
450453
<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>
451-
<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>
454+
<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>
452455
<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>
453456
</div>
454457
</div>

fieldservice_account_analytic/tests/test_fsm_account_wizard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def setUpClass(cls):
7171
)
7272
cls.default_account_revenue = cls.env["account.account"].search(
7373
[
74-
("company_id", "=", cls.env.user.company_id.id),
74+
("company_ids", "in", cls.env.user.company_id.id),
7575
("account_type", "=", "income"),
7676
],
7777
limit=1,
@@ -81,7 +81,7 @@ def setUpClass(cls):
8181
cls.product1 = cls.env["product.product"].create(
8282
{
8383
"name": "Product A",
84-
"detailed_type": "consu",
84+
"type": "consu",
8585
}
8686
)
8787

fieldservice_account_analytic/views/fsm_location.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<odoo>
22
<!-- Field Service Location Tree View-->
3-
<record id="fsm_location_tree_view_analytic" model="ir.ui.view">
4-
<field name="name">fsm.location.tree.accounting</field>
3+
<record id="fsm_location_list_view_analytic" model="ir.ui.view">
4+
<field name="name">fsm.location.list.accounting</field>
55
<field name="model">fsm.location</field>
6-
<field name="inherit_id" ref="fieldservice.fsm_location_tree_view" />
6+
<field name="inherit_id" ref="fieldservice.fsm_location_list_view" />
77
<field name="arch" type="xml">
88
<field name="owner_id" position="after">
99
<field name="customer_id" />

fieldservice_account_analytic/views/fsm_order.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
</field>
2424
</field>
2525
</record>
26-
<record id="fsm_order_tree_view" model="ir.ui.view">
27-
<field name="name">fsm.order.tree</field>
26+
<record id="fsm_order_list_view" model="ir.ui.view">
27+
<field name="name">fsm.order.list</field>
2828
<field name="model">fsm.order</field>
29-
<field name="inherit_id" ref="fieldservice.fsm_order_tree_view" />
29+
<field name="inherit_id" ref="fieldservice.fsm_order_list_view" />
3030
<field name="arch" type="xml">
3131
<field name="name" position="after">
3232
<field name="customer_id" />

0 commit comments

Comments
 (0)