Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] account_account_tag_code: Migration to 17.0 #1873

Merged
merged 9 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions account_account_tag_code/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
========================
Account Account Tag Code
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:50f3061630a4b527055e337add900ffefe18dd2f6d443d28ca5008159a11ff0c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/17.0/account_account_tag_code
:alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-17-0/account-financial-tools-17-0-account_account_tag_code
: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/account-financial-tools&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds a field 'code' to model 'account.account.tag'. This
field 'code' is useful to search specific tags without having problems
with the translations.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/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/account-financial-tools/issues/new?body=module:%20account_account_tag_code%0Aversion:%2017.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.

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- ForgeFlow
- Marina Alapont <<[email protected]>>
- `APSL <https://www.apsl.tech>`__:

- Antoni Marroig <<[email protected]>>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/17.0/account_account_tag_code>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_account_tag_code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions account_account_tag_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Account Tag Code",
"summary": "Add a code field to the accounts tags",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-tools",
"depends": ["account", "account_usability"],
"data": ["views/account_account_tag_views.xml"],
}
24 changes: 24 additions & 0 deletions account_account_tag_code/i18n/account_account_tag_code.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_account_tag_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_account_tag_code
#: model:ir.model,name:account_account_tag_code.model_account_account_tag
msgid "Account Tag"
msgstr ""

#. module: account_account_tag_code
#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code
msgid "Code"
msgstr ""
27 changes: 27 additions & 0 deletions account_account_tag_code/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_account_tag_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-16 21:35+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: account_account_tag_code
#: model:ir.model,name:account_account_tag_code.model_account_account_tag
msgid "Account Tag"
msgstr "Etiqueta de Cuenta"

#. module: account_account_tag_code
#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code
msgid "Code"
msgstr "Código"
27 changes: 27 additions & 0 deletions account_account_tag_code/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_account_tag_code
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-26 16:36+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: account_account_tag_code
#: model:ir.model,name:account_account_tag_code.model_account_account_tag
msgid "Account Tag"
msgstr "Etichetta conto"

#. module: account_account_tag_code
#: model:ir.model.fields,field_description:account_account_tag_code.field_account_account_tag__code
msgid "Code"
msgstr "Codice"
1 change: 1 addition & 0 deletions account_account_tag_code/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_account_tag
15 changes: 15 additions & 0 deletions account_account_tag_code/models/account_account_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import api, fields, models


class AccountAccountTag(models.Model):
_inherit = "account.account.tag"

code = fields.Char()

@api.depends("code")
def _compute_display_name(self):
for tag in self:
if tag.code:
tag.display_name = f"[{tag.code}] {tag.name}"
else:
tag.display_name = tag.name
3 changes: 3 additions & 0 deletions account_account_tag_code/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions account_account_tag_code/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- ForgeFlow
- Marina Alapont \<\<<[email protected]>\>\>
- [APSL](<https://www.apsl.tech>):
- Antoni Marroig \<\<<[email protected]>\>\>
2 changes: 2 additions & 0 deletions account_account_tag_code/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds a field 'code' to model 'account.account.tag'.
This field 'code' is useful to search specific tags without having problems with the translations.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions account_account_tag_code/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Module name</h2>
<p>This module was written to extend the functionality of ... to support ... and allow you to ...</p>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Installation</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To install this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.odoo.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Configuration</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To configure this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.odoo.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Usage</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To use this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
<p class="oe_mt32">For further information, please visit:
<ul>
<li><a href="https://www.odoo.com/forum/help-1">https://www.odoo.com/forum/help-1</a></li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.odoo.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Known issues / Roadmap</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.odoo.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row">
<div class="oe_span12">
<h2 class="oe_slogan">Credits</h2>
</div>
<div class="oe_span12">
<h3>Contributors</h3>
<ul>
<li>ForgeFlow &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</li>
</ul>
</div>
<div class="oe_span12">
<h3>Maintainer</h3>
<p>
This module is maintained by the OCA.<br/>
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.<br/>
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/>
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a>
</p>
</div>
</div>
</section>
1 change: 1 addition & 0 deletions account_account_tag_code/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_account_tag_display_name
26 changes: 26 additions & 0 deletions account_account_tag_code/tests/test_account_tag_display_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2014-2022 Acsone (http://acsone.eu)
# Copyright 2016-2022 Akretion (http://www.akretion.com/)
# @author Stéphane Bidoul <[email protected]>
# @author Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo.tests.common import TransactionCase


class TestAccountTag(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.tag = cls.env["account.account.tag"].create(
{
"name": "Test Tag Name",
}
)

def test_display_name_without_code(self):
self.assertEqual(self.tag.display_name, self.tag.name)

def test_display_name_with_code(self):
self.tag.code = "Test"
self.assertEqual(self.tag.display_name, f"[{self.tag.code}] {self.tag.name}")
24 changes: 24 additions & 0 deletions account_account_tag_code/views/account_account_tag_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="account_tag_view_form_code" model="ir.ui.view">
<field name="name">account.tag.view.form.code</field>
<field name="model">account.account.tag</field>
<field name="inherit_id" ref="account.account_tag_view_form" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="code" />
</field>
</field>
</record>

<record id="account_tag_view_tree_code" model="ir.ui.view">
<field name="name">account.tag.view.tree.code</field>
<field name="model">account.account.tag</field>
<field name="inherit_id" ref="account.account_tag_view_tree" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="code" />
</field>
</field>
</record>
</odoo>
Loading