-
-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
matthieu.saison
committed
Jun 6, 2024
1 parent
5046194
commit ffaad9b
Showing
9 changed files
with
223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Matthieu SAISON <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Matthieu SAISON <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Account Financial Reports Start and End dates", | ||
"version": "14.0.1.0.0", | ||
"category": "Reporting", | ||
"summary": "OCA Financial Reports", | ||
"author": "Akretion,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/account-financial-reporting", | ||
"depends": [ | ||
"account", | ||
"account_financial_report", | ||
"account_invoice_start_end_dates", | ||
], | ||
"data": [ | ||
"report/templates/general_ledger.xml", | ||
], | ||
"installable": True, | ||
"application": True, | ||
"auto_install": False, | ||
"license": "AGPL-3", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * account_financial_report_start_end_dates | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-05-31 13:46+0000\n" | ||
"PO-Revision-Date: 2024-05-31 13:46+0000\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_financial_report_start_end_dates | ||
#: code:addons/account_financial_report_start_end_dates/report/general_ledger_xlsx.py:0 | ||
#, python-format | ||
msgid "Debit" | ||
msgstr "Débit" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: model:ir.model.fields,field_description:account_financial_report_start_end_dates.field_report_account_financial_report_general_ledger__display_name | ||
msgid "Display Name" | ||
msgstr "Nom affiché" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: code:addons/account_financial_report_start_end_dates/report/general_ledger_xlsx.py:0 | ||
#, python-format | ||
msgid "End Date" | ||
msgstr "Date de fin" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: model_terms:ir.ui.view,arch_db:account_financial_report_start_end_dates.report_general_ledger_lines | ||
msgid "End date" | ||
msgstr "Date de fin" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: model:ir.model,name:account_financial_report_start_end_dates.model_report_account_financial_report_general_ledger | ||
msgid "General Ledger Report" | ||
msgstr "Etat du Grand livre" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: model:ir.model.fields,field_description:account_financial_report_start_end_dates.field_report_account_financial_report_general_ledger____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière modification le" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: code:addons/account_financial_report_start_end_dates/report/general_ledger_xlsx.py:0 | ||
#, python-format | ||
msgid "Start Date" | ||
msgstr "Date de début" | ||
|
||
#. module: account_financial_report_start_end_dates | ||
#: model_terms:ir.ui.view,arch_db:account_financial_report_start_end_dates.report_general_ledger_lines | ||
msgid "Start date" | ||
msgstr "Date de début" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import general_ledger | ||
from . import general_ledger_xlsx |
42 changes: 42 additions & 0 deletions
42
account_financial_report_start_end_dates/report/general_ledger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Matthieu SAISON <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class GeneralLedgerReport(models.AbstractModel): | ||
_inherit = "report.account_financial_report.general_ledger" | ||
|
||
@api.model | ||
def _get_move_line_data(self, move_line): | ||
move_line_data = super()._get_move_line_data(move_line) | ||
move_line_data.update({ | ||
"start_date": move_line["start_date"], | ||
"end_date": move_line["end_date"], | ||
}) | ||
|
||
return move_line_data | ||
|
||
@api.model | ||
def _calculate_centralization(self, centralized_ml, move_line, date_to): | ||
centralized_ml = super()._calculate_centralization( | ||
centralized_ml, move_line, date_to | ||
) | ||
jnl_id = move_line["journal_id"] | ||
month = move_line["date"].month | ||
for jnl_id in centralized_ml: | ||
for month in centralized_ml[jnl_id]: | ||
centralized_ml[jnl_id][month] |= { | ||
"start_date": False, | ||
"end_date": False, | ||
} | ||
return centralized_ml | ||
|
||
def _get_ml_fields(self): | ||
ml_fields = super()._get_ml_fields() | ||
res = ml_fields + [ | ||
"start_date", | ||
"end_date", | ||
] | ||
return res |
24 changes: 24 additions & 0 deletions
24
account_financial_report_start_end_dates/report/general_ledger_xlsx.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from odoo import _, models | ||
|
||
|
||
class GeneralLedgerXslx(models.AbstractModel): | ||
_inherit = "report.a_f_r.report_general_ledger_xlsx" | ||
|
||
def _get_report_columns(self, report): | ||
res = super()._get_report_columns(report) | ||
ures = {} | ||
deb_found = 0 | ||
for k, v in res.items(): | ||
if not deb_found: | ||
ures.update({k: v}) | ||
if v["header"] == _("Debit"): | ||
deb_found = 1 | ||
ures.update({ | ||
k: {"header": _("Start Date"), "field": "start_date", "width": 15} | ||
}) | ||
ures.update({ | ||
k + 1: {"header": _("End Date"), "field": "end_date", "width": 15} | ||
}) | ||
if deb_found: | ||
ures.update({k + 2: v}) | ||
return ures |
61 changes: 61 additions & 0 deletions
61
account_financial_report_start_end_dates/report/templates/general_ledger.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<template | ||
id="report_general_ledger_lines" | ||
inherit_id="account_financial_report.report_general_ledger_lines" | ||
> | ||
<xpath expr="//div[@class='act_as_row labels']/div[8]" position="after"> | ||
<!--## start_date--> | ||
<div class="act_as_cell amount" style="width: 3.51%;">Start date</div> | ||
<!--## end_date--> | ||
<div class="act_as_cell amount" style="width: 3.51%;">End date</div> | ||
</xpath> | ||
|
||
<xpath expr="//div[@class='act_as_row lines']/div[8]" position="after"> | ||
<!--## start_date--> | ||
<div class="act_as_cell" /> | ||
<!--## end_date--> | ||
<div class="act_as_cell" /> | ||
</xpath> | ||
|
||
<xpath | ||
expr="//t[@t-foreach="account_or_group_item_object['move_lines']"]/div/div[8]" | ||
position="after" | ||
> | ||
<!--## start_date--> | ||
<div class="act_as_cell left"> | ||
<t t-if="line['id']"> | ||
<span | ||
t-att-res-id="line['id']" | ||
res-model="account.move.line" | ||
view-type="form" | ||
> | ||
<t t-esc="line['start_date']" t-options="{'widget': 'date'}" /> | ||
</span> | ||
</t> | ||
<t t-else=""> | ||
<span> | ||
<t t-esc="line['start_date']" t-options="{'widget': 'date'}" /> | ||
</span> | ||
</t> | ||
</div> | ||
<!--## end_date--> | ||
<div class="act_as_cell left"> | ||
<t t-if="line['id']"> | ||
<span | ||
t-att-res-id="line['id']" | ||
res-model="account.move.line" | ||
view-type="form" | ||
> | ||
<t t-esc="line['end_date']" t-options="{'widget': 'date'}" /> | ||
</span> | ||
</t> | ||
<t t-else=""> | ||
<span> | ||
<t t-esc="line['end_date']" t-options="{'widget': 'date'}" /> | ||
</span> | ||
</t> | ||
</div> | ||
</xpath> | ||
</template> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
...unt_financial_report_start_end_dates/odoo/addons/account_financial_report_start_end_dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../account_financial_report_start_end_dates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |