Skip to content

Commit 5745159

Browse files
committed
[MIG] maintenance_account: Migration to 16.0
TT47043
1 parent 599225a commit 5745159

File tree

8 files changed

+33
-49
lines changed

8 files changed

+33
-49
lines changed

maintenance_account/README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Maintenance Account
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:67684d651aad4f717395cb7f97e2a9d365438bb7ae35f38e692b39cc05848999
10+
!! source digest: sha256:dcc1add7dc957ff122be4ff4e3777cad68abf215cc992e2909610be94ef0842a
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Maintenance Account
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%2Fmaintenance-lightgray.png?logo=github
20-
:target: https://github.com/OCA/maintenance/tree/15.0/maintenance_account
20+
:target: https://github.com/OCA/maintenance/tree/16.0/maintenance_account
2121
:alt: OCA/maintenance
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/maintenance-15-0/maintenance-15-0-maintenance_account
23+
:target: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_account
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/maintenance&target_branch=15.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=16.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,7 @@ Bug Tracker
5151
Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/issues>`_.
5252
In case of trouble, please check there if your issue has already been reported.
5353
If you spotted it first, help us to smash it by providing a detailed and welcomed
54-
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_account%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_account%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5555

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

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

9595
|maintainer-victoralmau|
9696

97-
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/15.0/maintenance_account>`_ project on GitHub.
97+
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/16.0/maintenance_account>`_ project on GitHub.
9898

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

maintenance_account/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33
{
44
"name": "Maintenance Account",
5-
"version": "15.0.1.0.1",
5+
"version": "16.0.1.0.0",
66
"category": "Maintenance",
77
"website": "https://github.com/OCA/maintenance",
88
"author": "Tecnativa, Odoo Community Association (OCA)",

maintenance_account/i18n/es.po

-9
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,3 @@ msgstr "Apunte"
6969
#: model:ir.model.fields,help:maintenance_account.field_maintenance_equipment__move_id
7070
msgid "The move of this entry line."
7171
msgstr "El movimiento de esta línea de entrada."
72-
73-
#~ msgid "Display Name"
74-
#~ msgstr "Nombre mostrado"
75-
76-
#~ msgid "ID"
77-
#~ msgstr "ID"
78-
79-
#~ msgid "Last Modified on"
80-
#~ msgstr "Última modificación el"

maintenance_account/i18n/it.po

-9
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,3 @@ msgstr "Riga movimento"
6868
#: model:ir.model.fields,help:maintenance_account.field_maintenance_equipment__move_id
6969
msgid "The move of this entry line."
7070
msgstr "Il movimento per questa riga di registrazione."
71-
72-
#~ msgid "Display Name"
73-
#~ msgstr "Nome visualizzato"
74-
75-
#~ msgid "ID"
76-
#~ msgstr "ID"
77-
78-
#~ msgid "Last Modified on"
79-
#~ msgstr "Ultima modifica il"

maintenance_account/static/description/index.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
32
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
43
<head>
@@ -367,9 +366,9 @@ <h1 class="title">Maintenance Account</h1>
367366
!! This file is generated by oca-gen-addon-readme !!
368367
!! changes will be overwritten. !!
369368
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:67684d651aad4f717395cb7f97e2a9d365438bb7ae35f38e692b39cc05848999
369+
!! source digest: sha256:dcc1add7dc957ff122be4ff4e3777cad68abf215cc992e2909610be94ef0842a
371370
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/maintenance/tree/15.0/maintenance_account"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/maintenance-15-0/maintenance-15-0-maintenance_account"><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/maintenance&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
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/maintenance/tree/16.0/maintenance_account"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_account"><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/maintenance&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373372
<p>This module automatically creates the equipment when validating the purchase invoices.</p>
374373
<p><strong>Table of contents</strong></p>
375374
<div class="contents local topic" id="contents">
@@ -399,7 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
399398
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/maintenance/issues">GitHub Issues</a>.
400399
In case of trouble, please check there if your issue has already been reported.
401400
If you spotted it first, help us to smash it by providing a detailed and welcomed
402-
<a class="reference external" href="https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_account%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
401+
<a class="reference external" href="https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_account%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403402
<p>Do not contact contributors directly about support or help with technical issues.</p>
404403
</div>
405404
<div class="section" id="credits">
@@ -430,7 +429,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
430429
promote its widespread use.</p>
431430
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
432431
<p><a class="reference external image-reference" href="https://github.com/victoralmau"><img alt="victoralmau" src="https://github.com/victoralmau.png?size=40px" /></a></p>
433-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/15.0/maintenance_account">OCA/maintenance</a> project on GitHub.</p>
432+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/16.0/maintenance_account">OCA/maintenance</a> project on GitHub.</p>
434433
<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>
435434
</div>
436435
</div>

maintenance_account/tests/test_maintenance_account.py

+7-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
# Copyright 2022-2023 Tecnativa - Víctor Martínez
1+
# Copyright 2022-2024 Tecnativa - Víctor Martínez
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
33

44
from odoo import fields
55
from odoo.tests import Form, common, new_test_user
66
from odoo.tests.common import users
77

8+
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
9+
810

911
class TestAccountMove(common.TransactionCase):
1012
@classmethod
1113
def setUpClass(cls):
1214
super().setUpClass()
13-
ctx = {
14-
"mail_create_nolog": True,
15-
"mail_create_nosubscribe": True,
16-
"mail_notrack": True,
17-
"no_reset_password": True,
18-
}
15+
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
1916
new_test_user(
20-
cls.env,
21-
login="test-account-user",
22-
groups="account.group_account_invoice",
23-
context=ctx,
17+
cls.env, login="test-account-user", groups="account.group_account_invoice"
2418
)
2519
cls.categ = cls.env["product.category"].create({"name": "Test category"})
2620
cls.product_a = cls.env["product.product"].create(
@@ -33,15 +27,15 @@ def setUpClass(cls):
3327
{
3428
"name": "Test Account",
3529
"code": "TEST",
36-
"user_type_id": cls.env.ref("account.data_account_type_payable").id,
30+
"account_type": "liability_payable",
3731
"reconcile": True,
3832
}
3933
)
4034
cls.account_expense = cls.env["account.account"].create(
4135
{
4236
"name": "Test Account",
4337
"code": "ACC",
44-
"user_type_id": cls.env.ref("account.data_account_type_expenses").id,
38+
"account_type": "expense",
4539
}
4640
)
4741
cls.journal = cls.env["account.journal"].create(
@@ -67,11 +61,9 @@ def _create_invoice(self, move_type="in_invoice"):
6761
with move_form.invoice_line_ids.new() as line_form:
6862
line_form.product_id = self.product_a
6963
line_form.quantity = 2
70-
line_form.account_id = self.account_expense
7164
with move_form.invoice_line_ids.new() as line_form:
7265
line_form.product_id = self.product_b
7366
line_form.quantity = 2
74-
line_form.account_id = self.account_expense
7567
invoice = move_form.save()
7668
return invoice
7769

maintenance_account/views/account_move_view.xml

+14-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<field name="name">account.move.form</field>
55
<field name="model">account.move</field>
66
<field name="inherit_id" ref="account.view_move_form" />
7-
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
87
<field name="arch" type="xml">
98
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
109
<button
@@ -13,11 +12,13 @@
1312
class="oe_stat_button"
1413
icon="fa-cubes"
1514
attrs="{'invisible': [('equipment_count', '=', 0)]}"
15+
groups="account.group_account_invoice"
1616
>
1717
<field
1818
string="Equipment(s)"
1919
name="equipment_count"
2020
widget="statinfo"
21+
groups="account.group_account_invoice"
2122
/>
2223
</button>
2324
</xpath>
@@ -29,8 +30,13 @@
2930
name="equipment_category_id"
3031
attrs="{'column_invisible': [('parent.move_type', '!=', 'in_invoice')]}"
3132
optional="hide"
33+
groups="account.group_account_invoice"
34+
/>
35+
<field
36+
name="equipment_ids"
37+
invisible="1"
38+
groups="account.group_account_invoice"
3239
/>
33-
<field name="equipment_ids" invisible="1" />
3440
</xpath>
3541
<xpath
3642
expr="//notebook//field[@name='line_ids']/tree/field[@name='date_maturity']"
@@ -40,8 +46,13 @@
4046
name="equipment_category_id"
4147
domain="[('company_id','=', parent.company_id)]"
4248
optional="hide"
49+
groups="account.group_account_invoice"
50+
/>
51+
<field
52+
name="equipment_ids"
53+
invisible="1"
54+
groups="account.group_account_invoice"
4355
/>
44-
<field name="equipment_ids" invisible="1" />
4556
</xpath>
4657
</field>
4758
</record>

maintenance_account/views/maintenance_equipment_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="inherit_id" ref="maintenance.hr_equipment_view_form" />
77
<field name="arch" type="xml">
88
<xpath expr="//field[@name='serial_no']" position="after">
9-
<field name="move_id" />
9+
<field name="move_id" groups="account.group_account_invoice" />
1010
</xpath>
1111
</field>
1212
</record>

0 commit comments

Comments
 (0)