Skip to content

Commit

Permalink
[IMP] account_analytic_distribution_manual: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BernatObrador committed Oct 9, 2024
1 parent 7b357fb commit 9983efa
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 44 deletions.
42 changes: 23 additions & 19 deletions account_analytic_distribution_manual/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ Account analytic distribution manual
: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--analytic-lightgray.png?logo=github
:target: https://github.com/OCA/account-analytic/tree/16.0/account_analytic_distribution_manual
:target: https://github.com/OCA/account-analytic/tree/17.0/account_analytic_distribution_manual
:alt: OCA/account-analytic
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-account_analytic_distribution_manual
:target: https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-account_analytic_distribution_manual
: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-analytic&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-analytic&target_branch=17.0
:alt: Try me on Runboat

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

This module provides an easy way to quickly autocomplete analytic accounts on any model that has a field for analytic accounts.
This module provides an easy way to quickly autocomplete analytic
accounts on any model that has a field for analytic accounts.

**Table of contents**

Expand All @@ -38,50 +39,53 @@ This module provides an easy way to quickly autocomplete analytic accounts on an
Configuration
=============

#. Go to Invoicing > Configuration > Analytic Accounting > Manual Analytic Distributions
#. Create or edit the necessary records.

1. Go to Invoicing > Configuration > Analytic Accounting > Manual
Analytic Distributions
2. Create or edit the necessary records.

Usage
=====

#. Go to Invoicing > Customer > Invoices
#. Open or create a invoice
#. On the invoice line, select the analytic account. A new field labeled "Manual Distribution" should appear at the top.
#. Select a record from the list, and it will be added to the distribution and the invoice lines.
1. Go to Invoicing > Customer > Invoices
2. Open or create a invoice
3. On the invoice line, select the analytic account. A new field labeled
"Manual Distribution" should appear at the top.
4. Select a record from the list, and it will be added to the
distribution and the invoice lines.

Known issues / Roadmap
======================

Compatibility with `Analytic Distribution Models` to use Manual Distribution as Default values
Compatibility with Analytic Distribution Models to use Manual
Distribution as Default values

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-analytic/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-analytic/issues/new?body=module:%20account_analytic_distribution_manual%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-analytic/issues/new?body=module:%20account_analytic_distribution_manual%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
~~~~~~~
-------

* Tecnativa

Contributors
~~~~~~~~~~~~
------------

* Tecnativa (https://www.tecnativa.com):
- Tecnativa (https://www.tecnativa.com):

* Carlos Lopez
- Carlos Lopez

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

This module is maintained by the OCA.

Expand All @@ -93,6 +97,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-analytic <https://github.com/OCA/account-analytic/tree/16.0/account_analytic_distribution_manual>`_ project on GitHub.
This module is part of the `OCA/account-analytic <https://github.com/OCA/account-analytic/tree/17.0/account_analytic_distribution_manual>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion account_analytic_distribution_manual/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def post_init_hook(cr, registry):
FROM
counted_tags tag
INNER JOIN
account_analytic_distribution distribution ON tag.id = distribution.tag_id;
account_analytic_distribution distribution
ON tag.id = distribution.tag_id;
"""
env.cr.execute(sql)
Expand Down
4 changes: 2 additions & 2 deletions account_analytic_distribution_manual/models/analytic_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class AnalyticMixin(models.AbstractModel):
readonly=False,
string="Analytic distribution (importable)",
help="Defining this field, it will set the analytical distribution in JSON "
"format, but using the analytic accounts names as keys of the dictionary, so it "
"eases the human input.",
"format, but using the analytic accounts names as keys of the dictionary, so "
"it eases the human input.",
)

@api.depends("analytic_distribution")
Expand Down
5 changes: 3 additions & 2 deletions account_analytic_distribution_manual/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def model_has_field(model):
return manual_distribution_field_name in self.env[model]._fields

def _merge_view_fields(all_models, new_models):
"""Merge new_models into all_models. Both are {modelname(str) ➔ fields(tuple)}."""
"""Merge new_models into all_models.
Both are {modelname(str) ➔ fields(tuple)}."""
for model, view_fields in new_models.items():
if model in all_models:
all_models[model] = tuple(set(all_models[model]) | set(view_fields))
Expand All @@ -67,7 +68,7 @@ def _merge_view_fields(all_models, new_models):
for node in root_node:
add_field(node, view_type, result.get("model"))
# check fields one2many
for (res_model, field_list) in result["models"].items():
for res_model, field_list in result["models"].items():
for field_name in field_list:
if field_name not in self.env[res_model]._fields:
continue
Expand Down
3 changes: 3 additions & 0 deletions account_analytic_distribution_manual/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions account_analytic_distribution_manual/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. Go to Invoicing \> Configuration \> Analytic Accounting \> Manual
Analytic Distributions
2. Create or edit the necessary records.
3 changes: 0 additions & 3 deletions account_analytic_distribution_manual/readme/CONFIGURE.rst

This file was deleted.

2 changes: 2 additions & 0 deletions account_analytic_distribution_manual/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Tecnativa (<https://www.tecnativa.com>):
- Carlos Lopez
3 changes: 0 additions & 3 deletions account_analytic_distribution_manual/readme/CONTRIBUTORS.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
This module provides an easy way to quickly autocomplete analytic accounts on any model that has a field for analytic accounts.
This module provides an easy way to quickly autocomplete analytic
accounts on any model that has a field for analytic accounts.
2 changes: 2 additions & 0 deletions account_analytic_distribution_manual/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Compatibility with Analytic Distribution Models to use Manual
Distribution as Default values
1 change: 0 additions & 1 deletion account_analytic_distribution_manual/readme/ROADMAP.rst

This file was deleted.

6 changes: 6 additions & 0 deletions account_analytic_distribution_manual/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1. Go to Invoicing \> Customer \> Invoices
2. Open or create a invoice
3. On the invoice line, select the analytic account. A new field
labeled "Manual Distribution" should appear at the top.
4. Select a record from the list, and it will be added to the
distribution and the invoice lines.
4 changes: 0 additions & 4 deletions account_analytic_distribution_manual/readme/USAGE.rst

This file was deleted.

21 changes: 13 additions & 8 deletions account_analytic_distribution_manual/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,9 @@ <h1 class="title">Account analytic distribution manual</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2e94cdbcdd48a9f51651a3e52c44e93e4e43fbe151a46aa14b15cd0d98e0d9bf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/account-analytic/tree/16.0/account_analytic_distribution_manual"><img alt="OCA/account-analytic" src="https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-analytic-16-0/account-analytic-16-0-account_analytic_distribution_manual"><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/account-analytic&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides an easy way to quickly autocomplete analytic accounts on any model that has a field for analytic accounts.</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/account-analytic/tree/17.0/account_analytic_distribution_manual"><img alt="OCA/account-analytic" src="https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-account_analytic_distribution_manual"><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/account-analytic&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>This module provides an easy way to quickly autocomplete analytic
accounts on any model that has a field for analytic accounts.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -389,7 +390,8 @@ <h1 class="title">Account analytic distribution manual</h1>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ol class="arabic simple">
<li>Go to Invoicing &gt; Configuration &gt; Analytic Accounting &gt; Manual Analytic Distributions</li>
<li>Go to Invoicing &gt; Configuration &gt; Analytic Accounting &gt; Manual
Analytic Distributions</li>
<li>Create or edit the necessary records.</li>
</ol>
</div>
Expand All @@ -398,20 +400,23 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<ol class="arabic simple">
<li>Go to Invoicing &gt; Customer &gt; Invoices</li>
<li>Open or create a invoice</li>
<li>On the invoice line, select the analytic account. A new field labeled “Manual Distribution” should appear at the top.</li>
<li>Select a record from the list, and it will be added to the distribution and the invoice lines.</li>
<li>On the invoice line, select the analytic account. A new field labeled
“Manual Distribution” should appear at the top.</li>
<li>Select a record from the list, and it will be added to the
distribution and the invoice lines.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
<p>Compatibility with <cite>Analytic Distribution Models</cite> to use Manual Distribution as Default values</p>
<p>Compatibility with Analytic Distribution Models to use Manual
Distribution as Default values</p>
</div>
<div class="section" id="bug-tracker">
<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/account-analytic/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/account-analytic/issues/new?body=module:%20account_analytic_distribution_manual%0Aversion:%2016.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/account-analytic/issues/new?body=module:%20account_analytic_distribution_manual%0Aversion:%2017.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 @@ -440,7 +445,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/account-analytic/tree/16.0/account_analytic_distribution_manual">OCA/account-analytic</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-analytic/tree/17.0/account_analytic_distribution_manual">OCA/account-analytic</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

0 comments on commit 9983efa

Please sign in to comment.