Skip to content

Commit 7cbc773

Browse files
committed
[18.0][ADD] account_analytic
1 parent 11b8419 commit 7cbc773

File tree

14 files changed

+788
-0
lines changed

14 files changed

+788
-0
lines changed

account_analytic/README.rst

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
================
2+
Account Analytic
3+
================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:043875970c87ac25390dd30f6366fdd0d1d0bbbb6b11980a0e45d4fd131eb6ff
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github
20+
:target: https://github.com/OCA/account-analytic/tree/18.0/account_analytic
21+
:alt: OCA/account-analytic
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-account_analytic
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-analytic&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
The goal of this module is to ease analytic distribution management on
32+
account move. This module adds analytic distribution on account move.
33+
34+
If all lines of the account move have the same analytic distribution,
35+
the analytic distribution on the account move is automatically set with
36+
this value. If an analytic distribution is set on the account move, all
37+
lines of the account move will take this value.
38+
39+
**Table of contents**
40+
41+
.. contents::
42+
:local:
43+
44+
Bug Tracker
45+
===========
46+
47+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-analytic/issues>`_.
48+
In case of trouble, please check there if your issue has already been reported.
49+
If you spotted it first, help us to smash it by providing a detailed and welcomed
50+
`feedback <https://github.com/OCA/account-analytic/issues/new?body=module:%20account_analytic%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
51+
52+
Do not contact contributors directly about support or help with technical issues.
53+
54+
Credits
55+
=======
56+
57+
Authors
58+
-------
59+
60+
* Exo Software
61+
* Acsone SA/NV
62+
63+
Contributors
64+
------------
65+
66+
- Laetitia Gangloff <[email protected]>
67+
- Cédric Pigeon <[email protected]>
68+
- Pimolnat Suntian <[email protected]>
69+
- `Jarsa <https://www.jarsa.com>`__
70+
71+
- Alan Ramos
72+
73+
- Lois Rilo <[email protected]>
74+
- `Quartile <https://www.quartile.co>`__:
75+
76+
- Aung Ko Ko Lin
77+
78+
- `Exo Software <https://www.exosoftware.pt>`__:
79+
80+
- André Leite <[email protected]>
81+
- Fábio Paiva <[email protected]>
82+
83+
Maintainers
84+
-----------
85+
86+
This module is maintained by the OCA.
87+
88+
.. image:: https://odoo-community.org/logo.png
89+
:alt: Odoo Community Association
90+
:target: https://odoo-community.org
91+
92+
OCA, or the Odoo Community Association, is a nonprofit organization whose
93+
mission is to support the collaborative development of Odoo features and
94+
promote its widespread use.
95+
96+
.. |maintainer-andrel-exo| image:: https://github.com/andrel-exo.png?size=40px
97+
:target: https://github.com/andrel-exo
98+
:alt: andrel-exo
99+
100+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
101+
102+
|maintainer-andrel-exo|
103+
104+
This module is part of the `OCA/account-analytic <https://github.com/OCA/account-analytic/tree/18.0/account_analytic>`_ project on GitHub.
105+
106+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

account_analytic/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

account_analytic/__manifest__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu)
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
"name": "Account Analytic",
6+
"version": "18.0.1.0.0",
7+
"author": "Exo Software, Acsone SA/NV, Odoo Community Association (OCA)",
8+
"category": "Analytic Accounting",
9+
"website": "https://github.com/OCA/account-analytic",
10+
"depends": ["account", "base_view_inheritance_extension"],
11+
"data": ["views/account_move_views.xml"],
12+
"license": "AGPL-3",
13+
"installable": True,
14+
"application": False,
15+
"maintainers": ["andrel-exo"],
16+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * account_analytic
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0+e\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-08-29 09:51+0000\n"
10+
"PO-Revision-Date: 2025-08-29 09:51+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: account_analytic
19+
#: model:ir.model.fields,field_description:account_analytic.field_account_bank_statement_line__analytic_distribution
20+
#: model:ir.model.fields,field_description:account_analytic.field_account_move__analytic_distribution
21+
msgid "Analytic Distribution"
22+
msgstr ""
23+
24+
#. module: account_analytic
25+
#: model:ir.model.fields,field_description:account_analytic.field_account_move__analytic_precision
26+
msgid "Analytic Precision"
27+
msgstr ""
28+
29+
#. module: account_analytic
30+
#: model:ir.model.fields,field_description:account_analytic.field_account_move__distribution_analytic_account_ids
31+
msgid "Distribution Analytic Account"
32+
msgstr ""
33+
34+
#. module: account_analytic
35+
#: model:ir.model,name:account_analytic.model_account_move
36+
msgid "Journal Entry"
37+
msgstr ""

account_analytic/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import account_move
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from odoo import api, fields, models
2+
3+
4+
class AccountMove(models.Model):
5+
_name = "account.move"
6+
_inherit = ["account.move", "analytic.mixin"]
7+
8+
analytic_distribution = fields.Json(inverse="_inverse_analytic_distribution")
9+
10+
@api.depends("line_ids.analytic_distribution")
11+
def _compute_analytic_distribution(self):
12+
"""If all lines have the same analytic distribution, set it on the order.
13+
14+
If no lines exist, respect the value given by the user.
15+
"""
16+
for am in self:
17+
if am.line_ids:
18+
al = am.line_ids[0].analytic_distribution or False
19+
for ol in am.line_ids:
20+
if ol.analytic_distribution != al:
21+
al = False
22+
break
23+
am.analytic_distribution = al
24+
25+
def _inverse_analytic_distribution(self):
26+
"""When setting the analytic distribution`, apply it to all order lines."""
27+
for am in self:
28+
if am.analytic_distribution:
29+
am.line_ids.write({"analytic_distribution": am.analytic_distribution})
30+
31+
@api.onchange("analytic_distribution")
32+
def _onchange_analytic_distribution(self):
33+
"""When changing the analytic distribution, apply it to all order lines."""
34+
if self.analytic_distribution:
35+
self.line_ids.update({"analytic_distribution": self.analytic_distribution})

account_analytic/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- Laetitia Gangloff \<<[email protected]>\>
2+
- Cédric Pigeon \<<[email protected]>\>
3+
- Pimolnat Suntian \<<[email protected]>\>
4+
- [Jarsa](https://www.jarsa.com)
5+
- Alan Ramos
6+
- Lois Rilo \<<[email protected]>\>
7+
- [Quartile](https://www.quartile.co):
8+
- Aung Ko Ko Lin
9+
- [Exo Software](https://www.exosoftware.pt):
10+
- André Leite \<<[email protected]>\>
11+
- Fábio Paiva \<<[email protected]>\>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The goal of this module is to ease analytic distribution management on
2+
account move. This module adds analytic distribution on account move.
3+
4+
If all lines of the account move have the same analytic distribution,
5+
the analytic distribution on the account move is automatically set
6+
with this value. If an analytic distribution is set on the account
7+
move, all lines of the account move will take this value.
9.23 KB
Loading

0 commit comments

Comments
 (0)