Skip to content

Commit

Permalink
[MIG] account_account_tag_code: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed May 2, 2024
1 parent a63ccdf commit 88ca7ef
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 20 deletions.
59 changes: 47 additions & 12 deletions account_account_tag_code/README.rst
Original file line number Diff line number Diff line change
@@ -1,36 +1,71 @@
=========================
========================
Account Account Tag Code
=========================

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.

========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`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>`__:

* Marina Alapont <[email protected]>
- Antoni Marroig <<[email protected]>>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -42,6 +77,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/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_asset_batch_compute>`_ project on GitHub.
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.
4 changes: 2 additions & 2 deletions account_account_tag_code/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{
"name": "Account Account Tag Code",
"summary": "Add a code field to the accounts tags",
"version": "16.0.1.0.0",
"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"],
"depends": ["account", "account_usability"],
"data": ["views/account_account_tag_views.xml"],
}
12 changes: 6 additions & 6 deletions account_account_tag_code/models/account_account_tag.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from odoo import fields, models
from odoo import api, fields, models


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

code = fields.Char()

def name_get(self):
res = super().name_get()
name_mapping = dict(res)
@api.depends("code")
def _compute_display_name(self):
for tag in self:
if tag.code:
name_mapping[tag.id] = "[" + tag.code + "] " + name_mapping[tag.id]
return list(name_mapping.items())
tag.display_name = f"[{tag.code}] {tag.name}"

Check warning on line 13 in account_account_tag_code/models/account_account_tag.py

View check run for this annotation

Codecov / codecov/patch

account_account_tag_code/models/account_account_tag.py#L13

Added line #L13 was not covered by tests
else:
tag.display_name = tag.name

Check warning on line 15 in account_account_tag_code/models/account_account_tag.py

View check run for this annotation

Codecov / codecov/patch

account_account_tag_code/models/account_account_tag.py#L15

Added line #L15 was not covered by tests
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.
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>

0 comments on commit 88ca7ef

Please sign in to comment.