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

[18.0][MIG] account_financial_report: Migration to 18.0 #1253

Merged
merged 313 commits into from
Dec 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
313 commits
Select commit Hold shift + click to select a range
903ef05
Translated using Weblate (Portuguese (Brazil))
eduaparicio Jul 23, 2019
fb3f5cc
[FIX] account_financial_report: Update to bootstrap 4
pedroslopez Jun 21, 2019
58b8015
[FIX] account_financial_report: Don't fail with installed l10n
pedrobaeza Jun 3, 2019
5481f68
Translated using Weblate (French)
Jul 25, 2019
e5c1a1f
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Aug 2, 2019
185940e
Fix display of captions in pdf
Sep 17, 2019
24c2432
account_financial_report: fix Trial Balance line order
gaikaz Sep 18, 2019
291f898
Translated using Weblate (French)
Sep 23, 2019
79366c8
Translated using Weblate (French)
yterrettaz Sep 23, 2019
091a3f3
[12.0][FIX] - Hide ending balance if general ledger is filtered by pa…
sbejaoui Sep 25, 2019
1dbf6b1
[FIX] account_financial_report: Avoid slow vacuum due to ondelete=cas…
pedrobaeza Aug 17, 2019
88fbfd7
Translated using Weblate (French)
Martronic-SA Dec 24, 2019
b26ee9f
Added translation using Weblate (Croatian)
badbole Feb 5, 2020
1227d53
[12.0] account_financial_report: refactor
JoanSForgeFlow Jan 23, 2020
40c874a
[IMP] account_financial_report: black, isort
Mar 23, 2020
712d4a8
[MIG] account_financial_report: Migration to 13.0
Mar 23, 2020
e23bfa9
[FIX] account_financial_report: general_ledger
JoanSForgeFlow Apr 1, 2020
db9f316
[FIX] account_financial_report: Fix error when generating reports
Apr 9, 2020
72c6843
[FIX] account_financial_report: open_items
traviswaelbro Apr 16, 2020
7d9eb6e
account_financial_report: Increase columns width in general ledger
grindtildeath Mar 11, 2020
c00785c
fixup! account_financial_report: Increase columns width in general le…
Tonow-c2c May 6, 2020
88a00ef
FIX missing date in invoice
Jun 30, 2020
7d96ea4
[IMP] account_financial_report: open_items & aged_partner_balance
JoanSForgeFlow Apr 30, 2020
1774471
[IMP] account_financial_report: select accounts between two codes
JoanSForgeFlow Apr 30, 2020
cbaabca
[IMP] account_financial_report: open_items
JoanSForgeFlow Apr 29, 2020
e4377eb
[IMP] account_financial_report: multiple fixes and improvements
JordiBForgeFlow May 1, 2020
6f32057
[IMP] account_financial_report: Fix VAT Report and other improvements
JoanSForgeFlow May 22, 2020
74d5e67
[IMP] account_financial_report:
JoanSForgeFlow Jun 11, 2020
707b147
[IMP] account_financial_report:
JordiBForgeFlow Jun 12, 2020
67bc2be
[FIX] account_financial_report:
JoanSForgeFlow Jun 18, 2020
a711307
[IMP] account_financial_report: general_ledger
JoanSForgeFlow Jun 23, 2020
2cce2d0
Added translation using Weblate (Spanish (Argentina))
ibuioli Aug 9, 2020
c4b71ec
Translated using Weblate (Spanish (Argentina))
ibuioli Aug 9, 2020
7603bda
[FIX] duplicates in es.po
sbidoul Aug 11, 2020
3a55e90
Translated using Weblate (Spanish (Argentina))
ibuioli Aug 11, 2020
8cb9466
[FIX] translation not loaded
astirpe Aug 5, 2020
7562cfd
Translated using Weblate (Spanish (Argentina))
ibuioli Aug 21, 2020
cbacc14
[FIX+IMP] account_financial_report: data can be None + no context man…
pedrobaeza Aug 28, 2020
fd18f5c
[ADD] domain field for additional filtering
JoanSForgeFlow Aug 20, 2020
e8cdafc
[IMP] domain widget performance fix
JoanSForgeFlow Aug 20, 2020
fda4a2a
[FIX] General ledger XLSX: solved mistake in the info
JoanSForgeFlow Sep 4, 2020
cf05ddd
Translated using Weblate (Romanian)
dhongu Sep 23, 2020
e7c1f4b
Translated using Weblate (Romanian)
dhongu Sep 23, 2020
cdc98d4
Translated using Weblate (Romanian)
dhongu Sep 25, 2020
dc3431b
[UPD] Eficent -> ForgeFlow
MiquelRForgeFlow Sep 30, 2020
ed7ef8a
Translated using Weblate (Spanish (Argentina))
ibuioli Oct 5, 2020
e250c05
[IMP] account_financial_report: black, isort, prettier
tupaq Oct 11, 2020
1203417
[MIG] account_financial_report: Migration to 14.0
joao-p-marques Jan 25, 2021
2e232d9
[FIX] account_financial_report: Fix tests
joao-p-marques Feb 25, 2021
6e5ea71
[FIX] account_financial_report: Refactor tests
joao-p-marques Mar 1, 2021
fae08fa
Translated using Weblate (Spanish)
anasuarez1 Mar 10, 2021
c5db5c1
Added translation using Weblate (Spanish (Mexico))
alan196 Mar 17, 2021
1ede209
Translated using Weblate (Spanish (Mexico))
alan196 Mar 17, 2021
e8aa284
Translated using Weblate (French)
Yvesldff Mar 22, 2021
2e26792
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 31, 2021
3ce1d6b
[FIX] account_financial_report: Actions
Tardo Mar 23, 2021
ec9afd0
Translated using Weblate (Spanish (Argentina))
ibuioli Apr 2, 2021
6a3b231
[FIX] Default company should not be used since it doesn't mutate when…
Apr 6, 2021
4b0b7e5
Added translation using Weblate (French (France))
Yvesldff Apr 10, 2021
664a8ea
Translated using Weblate (French (France))
Yvesldff Apr 10, 2021
9db2069
[FIX] account_financial_report: fix VAT report template
JordiMForgeFlow Apr 19, 2021
4a32e76
[FIX] account_financial_report: fix test
MiquelRForgeFlow Apr 20, 2021
970f614
Translated using Weblate (Dutch)
bosd Apr 27, 2021
0abfff7
[FIX] account_financial_report: allow navigation on all fields
joao-p-marques Apr 27, 2021
70ad311
[FIX] account_financial_report: Fix tests
joao-p-marques Apr 28, 2021
f9c27f2
[FIX] account_financial_report: Don't include unaffected account if a…
joao-p-marques May 12, 2021
0b1044d
[FIX] account_financial_report: filter by correct data in trial balance
joao-p-marques May 13, 2021
6fc73b2
[account_financial_report][fix] display correct target_move in Trial …
JordiBForgeFlow Jun 12, 2021
93d3792
[IMP] account_financial_report: added 'auto sequence' option in Journ…
ValentinVinagre Jun 14, 2021
ab70fa5
Update translation files
oca-transbot Jun 15, 2021
1a8ab6d
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 25, 2021
d2c1aae
Translated using Weblate (Portuguese)
pedrocs-exo Jul 2, 2021
b445db9
[14.0][FIX] account_financial_report: fix method parameter order
ferran-S73 Aug 9, 2021
ea16c97
[14.0][IMP] account_financial_report: add keyword to function calls
ferran-S73 Aug 9, 2021
d8e7326
[14.0][FIX] account_financial_report: Incorrect format definition
Zar21 Jun 10, 2021
87d23aa
Translated using Weblate (Spanish)
ernestotejeda Aug 23, 2021
e0a41ec
[FIX] account_financial_report: Print report with details
SimoRubi Aug 23, 2021
edb0fcb
[14.0][FIX] account_financial_reporting: wrong view_id
Sep 15, 2021
f80eda0
[FIX] account_financial_report: Filter column creation to have correc…
joao-p-marques Sep 22, 2021
8b9bad9
Translated using Weblate (Italian)
francesco-ooops Dec 3, 2021
31bed0f
[13.0][FIX] account_financial_report: Correct all uses of
LoisRForgeFlow Oct 21, 2020
a04f638
[FIX] account_financial_report: filter cancelled journal items
JoanSForgeFlow Oct 21, 2020
68d7bb5
[IMP] account_financial_report: abstract for avoiding duplicated code…
JoanSForgeFlow Dec 24, 2020
60de523
[UPD] Update account_financial_report.pot
StefanRijnhart Jan 6, 2021
6d80804
Translated using Weblate (Spanish (Argentina))
ibuioli Jan 9, 2022
132df3a
[FIX] account_financial_report: use proper methods to set context
i-vyshnevska Feb 14, 2022
dba1ed1
[IMP] account_financial_report: black, isort, prettier
JasminSForgeFlow Mar 15, 2022
2b45a4c
[MIG] account_financial_report: Migration to 15.0
JasminSForgeFlow Mar 16, 2022
10fd4a2
[14.0][FIX] account_financial_report: Memory problems setting filters
May 10, 2022
3c016f3
Translated using Weblate (Catalan)
jabelchi May 26, 2022
4ac0f4e
[IMP] account_financial_report: common format for all amounts
LoisRForgeFlow Jul 19, 2022
9830cc3
[FIX] account_financial_report: run test after install
LoisRForgeFlow Jul 20, 2022
6fc4ea5
Translated using Weblate (Spanish)
pedrobaeza Aug 26, 2022
0cd327f
[IMP] account_financial_report: Remove "Cur." column (currency is now…
victoralmau Sep 1, 2022
2e678ee
[IMP] account_financial_report: Add "Cumul cur." column to general_le…
victoralmau Sep 1, 2022
50775bc
[IMP] account_financial_report: Hide values that have the same curren…
victoralmau Sep 8, 2022
0c66ecf
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 17, 2022
1136d89
[FIX] account_financial_report: Sort journal ledger by move_id
victoralmau Sep 5, 2022
4f8823b
[IMP] account_financial_report: Add tax_line_id field to taxes column…
victoralmau Sep 15, 2022
9807b68
[IMP] account_financial_report: Refactor
victoralmau Sep 14, 2022
f400a79
[IMP] account_financial_report: Add tax grouping in general ledger
victoralmau Sep 17, 2022
77d2da3
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 26, 2022
f41e8a6
[FIX] account_financial_report: Don't show cancelled items when click…
victoralmau Oct 26, 2022
5868931
[FIX] account_financial_report: Show records in general ledger when n…
victoralmau Nov 29, 2022
8e2e3f6
[14.0][FIX] account_financial_report: sort based partner name in open…
fredzamoabg Jan 13, 2022
7395d1b
[14.0][FIX] account_financial_report: Run compute in multi
hildickethan Feb 15, 2022
dd455ba
[FIX] account_financial_report: Trial Balance with 'hide account at 0'
Feb 23, 2022
9efca74
[FIX] account_financial_report: trial balance hierarchy
May 27, 2022
4af9e02
[IMP] account_financial_report: Remove 'Computed Accounts' option fro…
May 31, 2022
8f6ee42
[IMP] account_financial_report: Completes the functionality of hide_p…
omar7r Apr 11, 2022
c9e2b9d
[IMP] account_financial_report: Improve domain to reduce code in gene…
victoralmau Nov 10, 2022
10a1fa4
[FIX] account_financial_report: Set the correct value of column 'Cumu…
victoralmau Nov 9, 2022
0e20eeb
[FIX] account_financial_report: Change partner_domain to misc_grouped…
victoralmau Nov 11, 2022
4de4c3d
[MIG] account_financial_report: Migration to 16.0
ramiadavid Dec 20, 2022
0ca6453
[IMP] account_financial_report: change report access groups to only '…
ramiadavid Dec 24, 2022
b977a04
[UPD] Update account_financial_report.pot
Dec 24, 2022
562b635
[UPD] README.rst
OCA-git-bot Dec 24, 2022
10105cf
Update translation files
weblate Dec 24, 2022
9816800
[16.0][FIX] account_financial_report: generate ledger document
Reyes4711-S73 Dec 28, 2022
712d837
account_financial_report 16.0.1.0.1
OCA-git-bot Dec 28, 2022
9152880
Translated using Weblate (Croatian)
badbole Jan 5, 2023
74787ee
[IMP] account_financial_report: extensibility: ml fields
AaronHForgeFlow Nov 22, 2022
4104852
[IMP] account_financial_report: extensibility xlsx: allow to use othe…
AaronHForgeFlow Nov 22, 2022
8c0dd65
account_financial_report 16.0.1.0.2
OCA-git-bot Jan 16, 2023
fcdf1ba
[FIX] account_financial_report: General ledger changes:
victoralmau Jan 5, 2023
80559a3
account_financial_report 16.0.1.1.0
OCA-git-bot Jan 17, 2023
babce27
[IMP] account_financial_report: Trial balance changes:
victoralmau Jan 10, 2023
5fc1cd6
[UPD] Update account_financial_report.pot
Jan 25, 2023
33a7178
account_financial_report 16.0.1.2.0
OCA-git-bot Jan 25, 2023
aeffc24
Update translation files
weblate Jan 25, 2023
85632d7
[FIX] account_financial_report: endless installation
yajo Feb 9, 2023
efd547f
account_financial_report 16.0.1.2.1
OCA-git-bot Feb 9, 2023
6c08332
Translated using Weblate (Portuguese (Brazil))
douglascstd Feb 13, 2023
defdc2f
[IMP] account_financial_report: Remove amount_different_company_curre…
victoralmau Jan 17, 2023
05344b6
account_financial_report 16.0.1.2.2
OCA-git-bot Feb 28, 2023
64e5e62
Added translation using Weblate (Turkish)
tate11 Mar 7, 2023
182d3e6
Translated using Weblate (Turkish)
tate11 Mar 7, 2023
e4ab579
[FIX] account_financial_report: Assure the aml order
pedrobaeza Mar 16, 2023
4f2f39c
account_financial_report 16.0.1.2.3
OCA-git-bot Mar 16, 2023
4359fc8
[FIX] account_financial_report: Account group styling in qweb and xlsx
florian-dacosta Mar 20, 2023
18d0513
account_financial_report 16.0.1.3.0
OCA-git-bot Mar 20, 2023
dcfe9e8
Fixed the amount_residual_currency on partial reconcile
are-agilebg Oct 7, 2022
6edf341
[FIX] account_financial_report: Replace wrong field `amount_currency`…
RachidAlassir Mar 21, 2023
a1df840
Translated using Weblate (Spanish)
gerard-vacas Mar 22, 2023
b334842
account_financial_report 16.0.1.3.1
OCA-git-bot Mar 24, 2023
d33d89e
[FIX] account_financial_report fix to take the id of the currency if …
Apr 11, 2023
e607fba
account_financial_report 16.0.1.3.2
OCA-git-bot Apr 18, 2023
2817ae0
[FIX] account_financial_report: Replace deprecated t-raw to t-out
ramiadavid Apr 28, 2023
8048c11
[FIX] account_financial_report: Fix report links with domain
ramiadavid Apr 28, 2023
14e3724
[IMP] account_financial_report: Show move_name in entry column from g…
victoralmau Apr 24, 2023
558dc23
account_financial_report 16.0.1.3.3
OCA-git-bot Apr 28, 2023
1145edd
account_financial_report 16.0.1.3.4
OCA-git-bot Apr 28, 2023
2284ee0
Translated using Weblate (Italian)
mymage May 9, 2023
799a41e
Translated using Weblate (French)
sanrav May 10, 2023
bdcd178
Translated using Weblate (French (France) (fr_FR))
sanrav May 10, 2023
0637c89
Translated using Weblate (Italian)
francesco-ooops May 12, 2023
fce8322
[FIX] account_financial_report: Prevent error related to currency fro…
victoralmau Apr 27, 2023
428337a
account_financial_report 16.0.1.3.5
OCA-git-bot May 15, 2023
97e4ccb
Translated using Weblate (Spanish)
Ivorra78 May 31, 2023
1035429
Translated using Weblate (Portuguese (Brazil))
adrianojprado Jul 31, 2023
2da30a0
[UPD] README.rst
OCA-git-bot Sep 3, 2023
9063f74
[FIX] account_financial_report: Prevent error related to currency fro…
victoralmau Jul 25, 2023
f16b46e
[FIX] account_financial_report: Initial currency balance value on tri…
aritzolea Sep 14, 2023
72211f3
oca-github-bot post-merge updates
OCA-git-bot Sep 18, 2023
630df3c
[FIX] account_financial_report: Empty format
SirTakobi May 24, 2023
6f74778
[BOT] post-merge updates
OCA-git-bot Sep 28, 2023
0fbb9fe
Update translation files
weblate Oct 9, 2023
2492c11
Translated using Weblate (Spanish)
victoralmau Oct 11, 2023
35c26b2
[IMP] account_financial_report: test performance improvement
josep-tecnativa Oct 13, 2023
e04bd65
[BOT] post-merge updates
OCA-git-bot Oct 13, 2023
d01c996
Translated using Weblate (Italian)
francesco-ooops Oct 13, 2023
ac9050f
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 13, 2023
e9a8829
Avoid error on installation with missing analytic account
grindtildeath Oct 13, 2023
f4ccf43
[BOT] post-merge updates
OCA-git-bot Oct 16, 2023
4c69210
Added translation using Weblate (Swedish)
jakobkrabbe Oct 25, 2023
4cb2dec
Translated using Weblate (Swedish)
jakobkrabbe Oct 25, 2023
fbced32
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 28, 2023
41a6c5b
Translated using Weblate (French)
Nov 1, 2023
30d272a
Translated using Weblate (Dutch)
Nov 14, 2023
8d977ef
Translated using Weblate (Portuguese (Brazil))
adrianojprado Dec 27, 2023
d0c267e
[FIX] account_financial_report: fixing bug when calculation of credit…
May 23, 2023
b781441
[15.0][FIX] account_financial_report: generate ledger document
Reyes4711-S73 Dec 26, 2022
099d534
[BOT] post-merge updates
OCA-git-bot Jan 3, 2024
c07f297
Translated using Weblate (Spanish)
pedrobaeza Jan 9, 2024
f202a33
Translated using Weblate (Swedish)
jakobkrabbe Jan 23, 2024
0b128f0
[IMP] account_financial_report: pre-commit auto fixes
norlinhenrik Jan 24, 2024
e6904a2
[MIG] account_financial_report: Migration to 17.0
norlinhenrik Jan 24, 2024
2671e21
[FIX] account_financial_report: optimize computation of analytic acco…
yajo Feb 1, 2024
d2c0d9c
[16.0][FIX]account_financial_report: missing accounts
ChristophAbenthungCibex Jan 22, 2024
2643fdd
[IMP] account_financial_report: Add Missing partner support in trial …
victoralmau Feb 15, 2024
2024473
[IMP] account_financial_report: Change Missing Partner as translatable
victoralmau Feb 16, 2024
e00e8f8
[FIX] account_financial_report: show currency name instead of dictionary
eLBati Mar 4, 2024
0a4dd5d
[FIX] account_financial_report: Filter correctly by account_type in G…
victoralmau Mar 19, 2024
9bf1147
[IMP] account_financial_report: reversed variable only_one_unaffected…
norlinhenrik Mar 31, 2024
02fc952
[FIX] account_financial_report: report_action javascript
norlinhenrik Mar 31, 2024
ab32ee5
[UPD] Update account_financial_report.pot
Apr 11, 2024
d7b2fe7
[BOT] post-merge updates
OCA-git-bot Apr 11, 2024
e3e9644
Update translation files
weblate Apr 12, 2024
0806ab7
Translated using Weblate (Italian)
mymage Apr 19, 2024
18a8cef
Translated using Weblate (Turkish)
tate11 Apr 20, 2024
6d69373
[17.0][IMP] account_financial_report: Set custom intervales in aged r…
carolinafernandez-tecnativa Apr 15, 2024
c5efc89
[UPD] Update account_financial_report.pot
Apr 23, 2024
2dee42d
[BOT] post-merge updates
OCA-git-bot Apr 23, 2024
5036126
Update translation files
weblate Apr 23, 2024
d53a1b2
Translated using Weblate (Spanish)
Ivorra78 Apr 24, 2024
376ab69
Translated using Weblate (Italian)
mymage Apr 29, 2024
849112b
[FIX] account_financial_report: fix error false due_date
Saran440 May 2, 2024
8200686
[BOT] post-merge updates
OCA-git-bot May 3, 2024
7c5d5a8
[FIX] account_financial_report: aged partner compute due date
Saran440 May 7, 2024
7bc9656
[BOT] post-merge updates
OCA-git-bot May 7, 2024
ac36c6f
Translated using Weblate (Italian)
mymage May 17, 2024
ad5a4d3
[IMP] account_financial_report: Change font size
pilarvargas-tecnativa Apr 29, 2024
0c236dd
[BOT] post-merge updates
OCA-git-bot May 21, 2024
b5f2e19
Translated using Weblate (Swedish)
jakobkrabbe Jun 4, 2024
d4cbff6
Translated using Weblate (Italian)
francesco-ooops Jun 10, 2024
30ff4a2
Translated using Weblate (Italian)
mymage Jun 12, 2024
cca4c04
Replace 'Camptocamp SA' with 'Camptocamp'
vvrossem Jun 13, 2024
c734ee2
[BOT] post-merge updates
OCA-git-bot Jun 14, 2024
2afff02
Translated using Weblate (Spanish)
victoralmau Jun 14, 2024
dff8bd7
Translated using Weblate (Portuguese)
pedrocs-exo Jun 16, 2024
48d1375
Translated using Weblate (Italian)
mymage Jul 1, 2024
bf4cea4
Translated using Weblate (Italian)
mymage Jul 8, 2024
824be52
Translated using Weblate (Italian)
mymage Aug 7, 2024
3ca5cef
Translated using Weblate (Spanish)
carolinafernandez-tecnativa Aug 8, 2024
5bb0106
[FIX] account_financial_report: Export to XLSX after report preview
carolinafernandez-tecnativa Aug 12, 2024
b6d6009
[BOT] post-merge updates
OCA-git-bot Aug 13, 2024
e6ea9c9
Translated using Weblate (Italian)
mymage Aug 30, 2024
f3a8695
[FIX] account_financial_report: fix ValueError
SilvioC2C Aug 29, 2024
1af1121
[BOT] post-merge updates
OCA-git-bot Sep 27, 2024
3d36527
[FIX] account_financial_report: Display the values of Amount cur. + C…
victoralmau Oct 10, 2024
1582443
[BOT] post-merge updates
OCA-git-bot Oct 17, 2024
2ff0661
Translated using Weblate (Italian)
mymage Oct 22, 2024
38dab02
[FIX] account_financial_report: in XLSX report, display null ending b…
alexis-via Oct 24, 2024
8a20028
[FIX] account_financial_report: partner trial balance: sort by partne…
alexis-via Sep 16, 2022
50270b6
[FIX] account_financial_report: crash in XSLX report on partner balance
alexis-via Jun 14, 2024
2dad961
[FIX] account_financial_report: Open Items report now sorted by accou…
alexis-via Oct 24, 2024
3273d27
[IMP] account_financial_report: avoid crash if data structure changes…
alexis-via Oct 24, 2024
580a6b7
[FIX] account_financial_report : fix wizard model names sent to qweb …
florian-dacosta Oct 29, 2024
de2e844
[BOT] post-merge updates
OCA-git-bot Oct 29, 2024
6c4b97d
[UPD] Update account_financial_report.pot
Oct 30, 2024
a67a805
[BOT] post-merge updates
OCA-git-bot Oct 30, 2024
bb5fa66
Update translation files
weblate Oct 30, 2024
01b2e35
[IMP] account_financial_report: Change t-esc and t-raw to t-out from …
victoralmau Oct 30, 2024
9c59add
[IMP] account_financial_report: Add Amount cur. to General Ledger tot…
victoralmau Oct 17, 2024
f4a3a26
[BOT] post-merge updates
OCA-git-bot Nov 29, 2024
e4e301a
[IMP] account_financial_report: Change t-esc and t-raw to t-out from …
victoralmau May 2, 2024
0e6c436
[IMP] account_financial_report: Add grouping by analytical account in…
victoralmau Jul 3, 2024
4413611
[FIX] account_financial_report: KeyError rendering report
yajo Dec 3, 2024
c46e83a
[IMP] account_financial_report: pre-commit auto fixes
chaule97 Nov 13, 2024
01f22b8
[MIG] account_financial_report: Migration to 18.0
chaule97 Nov 18, 2024
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
Prev Previous commit
[MIG] account_financial_report: Migration to 18.0
chaule97 committed Dec 4, 2024
commit 01f22b825679e2b2cf353e59ac1de9273569922d
11 changes: 9 additions & 2 deletions account_financial_report/README.rst
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ Example of configuration inferior limit:
It means the first interval is from 0 to 15, the second from 16 to 30,
and the third is 61+.

Go on 'Invoicing' -> 'Reports' -> 'OCA accounting reports' -> 'Aged
Go on 'Invoicing' -> 'Reporting' -> 'OCA accounting reports' -> 'Aged
Partner Balance'

When wizard is open, you need to select your interval configuration and
@@ -167,7 +167,7 @@ Contributors
- Pedro M. Baeza
- Sergio Teruel
- Ernesto Tejeda
- Jo??o Marques
- João Marques
- Alexandre D. D??az
- V??ctor Mart??nez
- Carolina Fernandez
@@ -180,10 +180,17 @@ Contributors
- Lois Rilo <lois.rilo@forgeflow.com>
- Saran Lim. <saranl@ecosoft.co.th>
- Omar Casti??eira <omar@comunitea.com>
- Chau Le <chaulb@trobz.com>

Much of the work in this module was done at a sprint in Sorrento, Italy
in April 2016.

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.

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

5 changes: 3 additions & 2 deletions account_financial_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# Copyright 2021 Tecnativa - Jo??o Marques
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Financial Reports",
"version": "17.0.1.5.0",
"version": "18.0.1.0.0",
"category": "Reporting",
"summary": "OCA Financial Reports",
"author": "Camptocamp,"
@@ -47,6 +47,7 @@
"assets": {
"web.assets_backend": [
"account_financial_report/static/src/js/*",
"account_financial_report/static/src/scss/*",
"account_financial_report/static/src/xml/**/*",
],
},
2 changes: 1 addition & 1 deletion account_financial_report/models/account.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ?? 2011 Guewen Baconnier (Camptocamp)
# © 2011 Guewen Baconnier (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from odoo import fields, models

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2023 Ernesto García
# Copyright 2023 Carolina Fernandez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import ValidationError


@@ -21,7 +21,7 @@ class AccountAgeReportConfiguration(models.Model):
def _check_line_ids(self):
for rec in self:
if not rec.line_ids:
raise ValidationError(_("Must complete Configuration Lines"))
raise ValidationError(self.env._("Must complete Configuration Lines"))


class AccountAgeReportConfigurationLine(models.Model):
@@ -36,12 +36,14 @@ class AccountAgeReportConfigurationLine(models.Model):
def _check_inferior_limit(self):
for rec in self:
if rec.inferior_limit <= 0:
raise ValidationError(_("Inferior Limit must be greather than zero"))
raise ValidationError(
self.env._("Inferior Limit must be greather than zero")
)

_sql_constraints = [
(
"unique_name_config_combination",
"UNIQUE(name,account_age_report_config_id)",
_("Name must be unique per report configuration"),
"Name must be unique per report configuration",
)
]
2 changes: 1 addition & 1 deletion account_financial_report/models/account_group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ?? 2018 Forest and Biomass Romania SA
# © 2018 Forest and Biomass Romania SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models
@@ -33,16 +33,16 @@
"""Forms complete name of location from parent location to child location."""
for group in self:
if group.parent_id.complete_name:
group.complete_name = f"{group.parent_id.complete_name}/{group.name}"

Check warning on line 36 in account_financial_report/models/account_group.py

Codecov / codecov/patch

account_financial_report/models/account_group.py#L36

Added line #L36 was not covered by tests
else:
group.complete_name = group.name

Check warning on line 38 in account_financial_report/models/account_group.py

Codecov / codecov/patch

account_financial_report/models/account_group.py#L38

Added line #L38 was not covered by tests

@api.depends("code_prefix_start", "parent_id.complete_code")
def _compute_complete_code(self):
"""Forms complete code of location from parent location to child location."""
for group in self:
if group.parent_id.complete_code:
group.complete_code = (

Check warning on line 45 in account_financial_report/models/account_group.py

Codecov / codecov/patch

account_financial_report/models/account_group.py#L45

Added line #L45 was not covered by tests
f"{group.parent_id.complete_code}/{group.code_prefix_start}"
)
else:
2 changes: 1 addition & 1 deletion account_financial_report/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ Example of configuration inferior limit:

It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+.

Go on 'Invoicing' -> 'Reports' -> 'OCA accounting reports' -> 'Aged Partner Balance'
Go on 'Invoicing' -> 'Reporting' -> 'OCA accounting reports' -> 'Aged Partner Balance'

When wizard is open, you need to select your interval configuration and print report.

3 changes: 2 additions & 1 deletion account_financial_report/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
- Pedro M. Baeza
- Sergio Teruel
- Ernesto Tejeda
- Jo??o Marques
- João Marques
- Alexandre D. D??az
- V??ctor Mart??nez
- Carolina Fernandez
@@ -30,6 +30,7 @@
- Lois Rilo \<<lois.rilo@forgeflow.com>\>
- Saran Lim. \<<saranl@ecosoft.co.th>\>
- Omar Casti??eira \<<omar@comunitea.com>\>
- Chau Le \<<chaulb@trobz.com>\>

Much of the work in this module was done at a sprint in Sorrento, Italy
in April 2016.
1 change: 1 addition & 0 deletions account_financial_report/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp.
6 changes: 3 additions & 3 deletions account_financial_report/report/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ?? 2015 Yannick Vaucher (Camptocamp)
# ?? 2016 Damien Crier (Camptocamp)
# ?? 2016 Julien Coux (Camptocamp)
# © 2015 Yannick Vaucher (Camptocamp)
# © 2016 Damien Crier (Camptocamp)
# © 2016 Julien Coux (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-

from . import abstract_report
4 changes: 3 additions & 1 deletion account_financial_report/report/abstract_report.py
Original file line number Diff line number Diff line change
@@ -28,31 +28,31 @@
("reconciled", "=", False),
]
if partner_ids:
domain += [("partner_id", "in", partner_ids)]

Check warning on line 31 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L31

Added line #L31 was not covered by tests
if only_posted_moves:
domain += [("move_id.state", "=", "posted")]
else:
domain += [("move_id.state", "in", ["posted", "draft"])]

Check warning on line 35 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L35

Added line #L35 was not covered by tests
if date_from:
domain += [("date", ">", date_from)]

Check warning on line 37 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L37

Added line #L37 was not covered by tests
return domain

@api.model
def _get_new_move_lines_domain(
self, new_ml_ids, account_ids, company_id, partner_ids, only_posted_moves
):
domain = [

Check warning on line 44 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L44

Added line #L44 was not covered by tests
("account_id", "in", account_ids),
("company_id", "=", company_id),
("id", "in", new_ml_ids),
]
if partner_ids:
domain += [("partner_id", "in", partner_ids)]

Check warning on line 50 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L50

Added line #L50 was not covered by tests
if only_posted_moves:
domain += [("move_id.state", "=", "posted")]

Check warning on line 52 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L52

Added line #L52 was not covered by tests
else:
domain += [("move_id.state", "in", ["posted", "draft"])]
return domain

Check warning on line 55 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L54-L55

Added lines #L54 - L55 were not covered by tests

def _recalculate_move_lines(
self,
@@ -69,47 +69,47 @@
debit_amount_currency,
credit_amount_currency,
):
debit_ids = set(debit_ids)
credit_ids = set(credit_ids)
in_credit_but_not_in_debit = credit_ids - debit_ids
reconciled_ids = list(debit_ids) + list(in_credit_but_not_in_debit)
reconciled_ids = set(reconciled_ids)
ml_ids = set(ml_ids)
new_ml_ids = reconciled_ids - ml_ids
new_ml_ids = list(new_ml_ids)
new_domain = self._get_new_move_lines_domain(

Check warning on line 80 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L72-L80

Added lines #L72 - L80 were not covered by tests
new_ml_ids, account_ids, company_id, partner_ids, only_posted_moves
)
company_currency = self.env["res.company"].browse(company_id).currency_id
ml_fields = self._get_ml_fields()
new_move_lines = self.env["account.move.line"].search_read(

Check warning on line 85 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L83-L85

Added lines #L83 - L85 were not covered by tests
domain=new_domain, fields=ml_fields
)
move_lines = move_lines + new_move_lines

Check warning on line 88 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L88

Added line #L88 was not covered by tests
for move_line in move_lines:
ml_id = move_line["id"]

Check warning on line 90 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L90

Added line #L90 was not covered by tests
if ml_id in debit_ids:
if move_line.get("amount_residual", False):
move_line["amount_residual"] += debit_amount[ml_id]

Check warning on line 93 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L93

Added line #L93 was not covered by tests
else:
move_line["amount_residual"] = debit_amount[ml_id]

Check warning on line 95 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L95

Added line #L95 was not covered by tests
if move_line.get("amount_residual_currency", False):
move_line["amount_residual_currency"] += debit_amount_currency[

Check warning on line 97 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L97

Added line #L97 was not covered by tests
ml_id
]
else:
move_line["amount_residual_currency"] = debit_amount_currency[ml_id]

Check warning on line 101 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L101

Added line #L101 was not covered by tests
if ml_id in credit_ids:
if move_line.get("amount_residual", False):
move_line["amount_residual"] -= credit_amount[ml_id]

Check warning on line 104 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L104

Added line #L104 was not covered by tests
else:
move_line["amount_residual"] = -credit_amount[ml_id]

Check warning on line 106 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L106

Added line #L106 was not covered by tests
if move_line.get("amount_residual_currency", False):
move_line["amount_residual_currency"] -= credit_amount_currency[

Check warning on line 108 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L108

Added line #L108 was not covered by tests
ml_id
]
else:
move_line["amount_residual_currency"] = -credit_amount_currency[

Check warning on line 112 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L112

Added line #L112 was not covered by tests
ml_id
]
# Set amount_currency=0 to keep the same behaviour as in v13
@@ -119,8 +119,8 @@
"currency_id" not in move_line
or move_line["currency_id"] == company_currency.id
):
move_line["amount_currency"] = 0
return move_lines

Check warning on line 123 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L122-L123

Added lines #L122 - L123 were not covered by tests

def _get_accounts_data(self, accounts_ids):
accounts = self.env["account.account"].browse(accounts_ids)
@@ -143,14 +143,16 @@
return accounts_data

def _get_journals_data(self, journals_ids):
journals = self.env["account.journal"].browse(journals_ids)
journals = self.env["account.journal"].search_fetch(
[("id", "in", journals_ids)], ["code"]
)
journals_data = {}
for journal in journals:
journals_data.update({journal.id: {"id": journal.id, "code": journal.code}})
return journals_data

def _get_ml_fields(self):
return self.COMMON_ML_FIELDS + [

Check warning on line 155 in account_financial_report/report/abstract_report.py

Codecov / codecov/patch

account_financial_report/report/abstract_report.py#L155

Added line #L155 was not covered by tests
"amount_residual",
"reconciled",
"currency_id",
6 changes: 3 additions & 3 deletions account_financial_report/report/abstract_report_xlsx.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# Copyright 2021 Tecnativa - Jo??o Marques
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models

@@ -11,34 +11,34 @@
_inherit = "report.report_xlsx.abstract"

def get_workbook_options(self):
vals = super().get_workbook_options()
vals.update({"constant_memory": True})
return vals

Check warning on line 16 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L14-L16

Added lines #L14 - L16 were not covered by tests

def generate_xlsx_report(self, workbook, data, objects):
# Initialize report variables
report_data = {

Check warning on line 20 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L20

Added line #L20 was not covered by tests
"workbook": None,
"sheet": None, # main sheet which will contains report
"columns": None, # columns of the report
"row_pos": None, # row_pos must be incremented at each writing lines
"formats": None,
}
self._define_formats(workbook, report_data)

Check warning on line 27 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L27

Added line #L27 was not covered by tests
# Get report data
report_name = self._get_report_name(objects, data=data)

Check warning on line 29 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L29

Added line #L29 was not covered by tests
report_footer = self._get_report_footer()
filters = self._get_report_filters(objects)
report_data["columns"] = self._get_report_columns(objects)
report_data["workbook"] = workbook
report_data["sheet"] = workbook.add_worksheet(report_name[:31])
self._set_column_width(report_data)

Check warning on line 35 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L31-L35

Added lines #L31 - L35 were not covered by tests
# Fill report
report_data["row_pos"] = 0
self._write_report_title(report_name, report_data)
self._write_filters(filters, report_data)
self._generate_report_content(workbook, objects, data, report_data)
self._write_report_footer(report_footer, report_data)

Check warning on line 41 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L37-L41

Added lines #L37 - L41 were not covered by tests

def _define_formats(self, workbook, report_data):
"""Add cell formats to current workbook.
@@ -54,8 +54,8 @@
* format_amount
* format_percent_bold_italic
"""
currency_id = self.env["res.company"]._default_currency_id()
report_data["formats"] = {

Check warning on line 58 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L57-L58

Added lines #L57 - L58 were not covered by tests
"format_bold": workbook.add_format({"bold": True}),
"format_right": workbook.add_format({"align": "right"}),
"format_left": workbook.add_format({"align": "left"}),
@@ -80,14 +80,14 @@
{"bold": True, "italic": True}
),
}
report_data["formats"]["format_amount"].set_num_format(

Check warning on line 83 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L83

Added line #L83 was not covered by tests
"#,##0." + "0" * currency_id.decimal_places
)
report_data["formats"]["format_header_amount"].set_num_format(

Check warning on line 86 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L86

Added line #L86 was not covered by tests
"#,##0." + "0" * currency_id.decimal_places
)
report_data["formats"]["format_percent_bold_italic"].set_num_format("#,##0.00%")
report_data["formats"]["format_amount_bold"].set_num_format(

Check warning on line 90 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L89-L90

Added lines #L89 - L90 were not covered by tests
"#,##0." + "0" * currency_id.decimal_places
)

@@ -96,13 +96,13 @@
Columns are defined with `_get_report_columns` method.
"""
for position, column in report_data["columns"].items():
report_data["sheet"].set_column(position, position, column["width"])

Check warning on line 99 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L99

Added line #L99 was not covered by tests

def _write_report_title(self, title, report_data):
"""Write report title on current line using all defined columns width.
Columns are defined with `_get_report_columns` method.
"""
report_data["sheet"].merge_range(

Check warning on line 105 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L105

Added line #L105 was not covered by tests
report_data["row_pos"],
0,
report_data["row_pos"],
@@ -110,15 +110,15 @@
title,
report_data["formats"]["format_bold"],
)
report_data["row_pos"] += 3

Check warning on line 113 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L113

Added line #L113 was not covered by tests

def _write_report_footer(self, footer, report_data):
"""Write report footer .
Columns are defined with `_get_report_columns` method.
"""
if footer:
report_data["row_pos"] += 1
report_data["sheet"].merge_range(

Check warning on line 121 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L120-L121

Added lines #L120 - L121 were not covered by tests
report_data["row_pos"],
0,
report_data["row_pos"],
@@ -126,7 +126,7 @@
footer,
report_data["formats"]["format_left"],
)
report_data["row_pos"] += 1

Check warning on line 129 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L129

Added line #L129 was not covered by tests

def _write_filters(self, filters, report_data):
"""Write one line per filters on starting on current line.
@@ -140,7 +140,7 @@
col_count_filter_value = self._get_col_count_filter_value()
col_value = col_name + col_count_filter_name + 1
for title, value in filters:
report_data["sheet"].merge_range(

Check warning on line 143 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L143

Added line #L143 was not covered by tests
report_data["row_pos"],
col_name,
report_data["row_pos"],
@@ -148,21 +148,21 @@
title,
report_data["formats"]["format_header_left"],
)
report_data["sheet"].merge_range(

Check warning on line 151 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L151

Added line #L151 was not covered by tests
report_data["row_pos"],
col_value,
report_data["row_pos"],
col_value + col_count_filter_value - 1,
value,
)
report_data["row_pos"] += 1
report_data["row_pos"] += 2

Check warning on line 159 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L158-L159

Added lines #L158 - L159 were not covered by tests

def write_array_title(self, title, report_data):
"""Write array title on current line using all defined columns width.
Columns are defined with `_get_report_columns` method.
"""
report_data["sheet"].merge_range(

Check warning on line 165 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L165

Added line #L165 was not covered by tests
report_data["row_pos"],
0,
report_data["row_pos"],
@@ -170,30 +170,30 @@
title,
report_data["formats"]["format_bold"],
)
report_data["row_pos"] += 1

Check warning on line 173 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L173

Added line #L173 was not covered by tests

def write_array_header(self, report_data):
"""Write array header on current line using all defined columns name.
Columns are defined with `_get_report_columns` method.
"""
for col_pos, column in report_data["columns"].items():
report_data["sheet"].write(

Check warning on line 180 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L180

Added line #L180 was not covered by tests
report_data["row_pos"],
col_pos,
column["header"],
report_data["formats"]["format_header_center"],
)
report_data["row_pos"] += 1

Check warning on line 186 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L186

Added line #L186 was not covered by tests

def write_line(self, line_object, report_data):
"""Write a line on current line using all defined columns field name.
Columns are defined with `_get_report_columns` method.
"""
for col_pos, column in report_data["columns"].items():
value = getattr(line_object, column["field"])
cell_type = column.get("type", "string")

Check warning on line 194 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L193-L194

Added lines #L193 - L194 were not covered by tests
if cell_type == "many2one":
report_data["sheet"].write_string(

Check warning on line 196 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L196

Added line #L196 was not covered by tests
report_data["row_pos"],
col_pos,
value.name or "",
@@ -204,14 +204,14 @@
hasattr(line_object, "account_group_id")
and line_object.account_group_id
):
report_data["sheet"].write_string(

Check warning on line 207 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L207

Added line #L207 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_bold"],
)
else:
report_data["sheet"].write_string(

Check warning on line 214 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L214

Added line #L214 was not covered by tests
report_data["row_pos"], col_pos, value or ""
)
elif cell_type == "amount":
@@ -219,28 +219,28 @@
hasattr(line_object, "account_group_id")
and line_object.account_group_id
):
cell_format = report_data["formats"]["format_amount_bold"]

Check warning on line 222 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L222

Added line #L222 was not covered by tests
else:
cell_format = report_data["formats"]["format_amount"]
report_data["sheet"].write_number(

Check warning on line 225 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L224-L225

Added lines #L224 - L225 were not covered by tests
report_data["row_pos"], col_pos, float(value), cell_format
)
elif cell_type == "amount_currency":
if line_object.currency_id:
format_amt = self._get_currency_amt_format(line_object, report_data)
report_data["sheet"].write_number(

Check warning on line 231 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L230-L231

Added lines #L230 - L231 were not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
report_data["row_pos"] += 1

Check warning on line 234 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L234

Added line #L234 was not covered by tests

def write_line_from_dict(self, line_dict, report_data):
"""Write a line on current line"""
for col_pos, column in report_data["columns"].items():
value = line_dict.get(column["field"], False)
cell_type = column.get("type", "string")

Check warning on line 240 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L239-L240

Added lines #L239 - L240 were not covered by tests
if cell_type == "string":
if line_dict.get("type", "") == "group_type":
report_data["sheet"].write_string(

Check warning on line 243 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L243

Added line #L243 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
@@ -252,8 +252,8 @@
and not isinstance(value, bool)
and not isinstance(value, int)
):
value = value and value.strftime("%d/%m/%Y")
report_data["sheet"].write_string(

Check warning on line 256 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L255-L256

Added lines #L255 - L256 were not covered by tests
report_data["row_pos"], col_pos, value or ""
)
elif cell_type == "amount":
@@ -261,30 +261,30 @@
line_dict.get("account_group_id", False)
and line_dict["account_group_id"]
):
cell_format = report_data["formats"]["format_amount_bold"]

Check warning on line 264 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L264

Added line #L264 was not covered by tests
else:
cell_format = report_data["formats"]["format_amount"]
report_data["sheet"].write_number(

Check warning on line 267 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L266-L267

Added lines #L266 - L267 were not covered by tests
report_data["row_pos"], col_pos, float(value), cell_format
)
elif cell_type == "amount_currency":
if line_dict.get("currency_name", False):
format_amt = self._get_currency_amt_format_dict(

Check warning on line 272 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L272

Added line #L272 was not covered by tests
line_dict, report_data
)
report_data["sheet"].write_number(

Check warning on line 275 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L275

Added line #L275 was not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
elif cell_type == "currency_name":
report_data["sheet"].write_string(

Check warning on line 279 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L279

Added line #L279 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_right"],
)
else:
self.write_non_standard_column(cell_type, col_pos, value)
report_data["row_pos"] += 1

Check warning on line 287 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L286-L287

Added lines #L286 - L287 were not covered by tests

def write_initial_balance(self, my_object, label, report_data):
"""Write a specific initial balance line on current line
@@ -292,7 +292,7 @@
Columns are defined with `_get_report_columns` method.
"""
col_pos_label = self._get_col_pos_initial_balance_label()
report_data["sheet"].write(

Check warning on line 295 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L295

Added line #L295 was not covered by tests
report_data["row_pos"],
col_pos_label,
label,
@@ -300,14 +300,14 @@
)
for col_pos, column in report_data["columns"].items():
if column.get("field_initial_balance"):
value = getattr(my_object, column["field_initial_balance"])
cell_type = column.get("type", "string")

Check warning on line 304 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L303-L304

Added lines #L303 - L304 were not covered by tests
if cell_type == "string":
report_data["sheet"].write_string(

Check warning on line 306 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L306

Added line #L306 was not covered by tests
report_data["row_pos"], col_pos, value or ""
)
elif cell_type == "amount":
report_data["sheet"].write_number(

Check warning on line 310 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L310

Added line #L310 was not covered by tests
report_data["row_pos"],
col_pos,
float(value),
@@ -318,29 +318,29 @@
format_amt = self._get_currency_amt_format(
my_object, report_data
)
report_data["sheet"].write_number(

Check warning on line 321 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L321

Added line #L321 was not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
elif column.get("field_currency_balance"):
value = getattr(my_object, column["field_currency_balance"])
cell_type = column.get("type", "string")

Check warning on line 326 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L325-L326

Added lines #L325 - L326 were not covered by tests
if cell_type == "many2one":
if my_object.currency_id:
report_data["sheet"].write_string(

Check warning on line 329 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L329

Added line #L329 was not covered by tests
report_data["row_pos"],
col_pos,
value.name or "",
report_data["formats"]["format_right"],
)
report_data["row_pos"] += 1

Check warning on line 335 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L335

Added line #L335 was not covered by tests

def write_initial_balance_from_dict(self, my_object, label, report_data):
"""Write a specific initial balance line on current line
using defined columns field_initial_balance name.
Columns are defined with `_get_report_columns` method.
"""
col_pos_label = self._get_col_pos_initial_balance_label()
report_data["sheet"].write(

Check warning on line 343 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L342-L343

Added lines #L342 - L343 were not covered by tests
report_data["row_pos"],
col_pos_label,
label,
@@ -348,14 +348,14 @@
)
for col_pos, column in report_data["columns"].items():
if column.get("field_initial_balance"):
value = my_object.get(column["field_initial_balance"], False)
cell_type = column.get("type", "string")

Check warning on line 352 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L351-L352

Added lines #L351 - L352 were not covered by tests
if cell_type == "string":
report_data["sheet"].write_string(

Check warning on line 354 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L354

Added line #L354 was not covered by tests
report_data["row_pos"], col_pos, value or ""
)
elif cell_type == "amount":
report_data["sheet"].write_number(

Check warning on line 358 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L358

Added line #L358 was not covered by tests
report_data["row_pos"],
col_pos,
float(value),
@@ -363,24 +363,24 @@
)
elif cell_type == "amount_currency":
if my_object["currency_id"]:
format_amt = self._get_currency_amt_format(

Check warning on line 366 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L366

Added line #L366 was not covered by tests
my_object, report_data
)
report_data["sheet"].write_number(

Check warning on line 369 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L369

Added line #L369 was not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
elif column.get("field_currency_balance"):
value = my_object.get(column["field_currency_balance"], False)
cell_type = column.get("type", "string")

Check warning on line 374 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L373-L374

Added lines #L373 - L374 were not covered by tests
if cell_type == "many2one":
if my_object["currency_id"]:
report_data["sheet"].write_string(

Check warning on line 377 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L377

Added line #L377 was not covered by tests
report_data["row_pos"],
col_pos,
value.name or "",
report_data["formats"]["format_right"],
)
report_data["row_pos"] += 1

Check warning on line 383 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L383

Added line #L383 was not covered by tests

def write_ending_balance(self, my_object, name, label, report_data):
"""Write a specific ending balance line on current line
@@ -388,7 +388,7 @@
Columns are defined with `_get_report_columns` method.
"""
for i in range(0, len(report_data["columns"])):
report_data["sheet"].write(

Check warning on line 391 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L391

Added line #L391 was not covered by tests
report_data["row_pos"],
i,
"",
@@ -396,7 +396,7 @@
)
row_count_name = self._get_col_count_final_balance_name()
col_pos_label = self._get_col_pos_final_balance_label()
report_data["sheet"].merge_range(

Check warning on line 399 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L399

Added line #L399 was not covered by tests
report_data["row_pos"],
0,
report_data["row_pos"],
@@ -404,7 +404,7 @@
name,
report_data["formats"]["format_header_left"],
)
report_data["sheet"].write(

Check warning on line 407 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L407

Added line #L407 was not covered by tests
report_data["row_pos"],
col_pos_label,
label,
@@ -412,17 +412,17 @@
)
for col_pos, column in report_data["columns"].items():
if column.get("field_final_balance"):
value = getattr(my_object, column["field_final_balance"])
cell_type = column.get("type", "string")

Check warning on line 416 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L415-L416

Added lines #L415 - L416 were not covered by tests
if cell_type == "string":
report_data["sheet"].write_string(

Check warning on line 418 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L418

Added line #L418 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_header_right"],
)
elif cell_type == "amount":
report_data["sheet"].write_number(

Check warning on line 425 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L425

Added line #L425 was not covered by tests
report_data["row_pos"],
col_pos,
float(value),
@@ -433,21 +433,21 @@
format_amt = self._get_currency_amt_header_format(
my_object, report_data
)
report_data["sheet"].write_number(

Check warning on line 436 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L436

Added line #L436 was not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
elif column.get("field_currency_balance"):
value = getattr(my_object, column["field_currency_balance"])
cell_type = column.get("type", "string")

Check warning on line 441 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L440-L441

Added lines #L440 - L441 were not covered by tests
if cell_type == "many2one":
if my_object.currency_id:
report_data["sheet"].write_string(

Check warning on line 444 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L444

Added line #L444 was not covered by tests
report_data["row_pos"],
col_pos,
value.name or "",
report_data["formats"]["format_header_right"],
)
report_data["row_pos"] += 1

Check warning on line 450 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L450

Added line #L450 was not covered by tests

def write_ending_balance_from_dict(self, my_object, name, label, report_data):
"""Write a specific ending balance line on current line
@@ -455,15 +455,15 @@
Columns are defined with `_get_report_columns` method.
"""
for i in range(0, len(report_data["columns"])):
report_data["sheet"].write(

Check warning on line 458 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L458

Added line #L458 was not covered by tests
report_data["row_pos"],
i,
"",
report_data["formats"]["format_header_right"],
)
row_count_name = self._get_col_count_final_balance_name()
col_pos_label = self._get_col_pos_final_balance_label()
report_data["sheet"].merge_range(

Check warning on line 466 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L464-L466

Added lines #L464 - L466 were not covered by tests
report_data["row_pos"],
0,
report_data["row_pos"],
@@ -471,7 +471,7 @@
name,
report_data["formats"]["format_header_left"],
)
report_data["sheet"].write(

Check warning on line 474 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L474

Added line #L474 was not covered by tests
report_data["row_pos"],
col_pos_label,
label,
@@ -479,17 +479,17 @@
)
for col_pos, column in report_data["columns"].items():
if column.get("field_final_balance"):
value = my_object.get(column["field_final_balance"], False)
cell_type = column.get("type", "string")

Check warning on line 483 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L482-L483

Added lines #L482 - L483 were not covered by tests
if cell_type == "string":
report_data["sheet"].write_string(

Check warning on line 485 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L485

Added line #L485 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_header_right"],
)
elif cell_type == "amount":
report_data["sheet"].write_number(

Check warning on line 492 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L492

Added line #L492 was not covered by tests
report_data["row_pos"],
col_pos,
float(value),
@@ -497,89 +497,89 @@
)
elif cell_type == "amount_currency":
if my_object["currency_id"]:
format_amt = self._get_currency_amt_format_dict(

Check warning on line 500 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L500

Added line #L500 was not covered by tests
my_object, report_data
)
report_data["sheet"].write_number(

Check warning on line 503 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L503

Added line #L503 was not covered by tests
report_data["row_pos"], col_pos, float(value), format_amt
)
elif column.get("field_currency_balance"):
value = my_object.get(column["field_currency_balance"], False)
cell_type = column.get("type", "string")

Check warning on line 508 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L507-L508

Added lines #L507 - L508 were not covered by tests
if cell_type == "many2one":
if my_object["currency_id"]:
report_data["sheet"].write_string(

Check warning on line 511 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L511

Added line #L511 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_header_right"],
)
elif cell_type == "currency_name":
report_data["sheet"].write_string(

Check warning on line 518 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L518

Added line #L518 was not covered by tests
report_data["row_pos"],
col_pos,
value or "",
report_data["formats"]["format_header_right"],
)
report_data["row_pos"] += 1

Check warning on line 524 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L524

Added line #L524 was not covered by tests

def _get_currency_amt_format(self, line_object, report_data):
"""Return amount format specific for each currency."""
if "account_group_id" in line_object and line_object["account_group_id"]:
format_amt = report_data["formats"]["format_amount_bold"]
field_prefix = "format_amount_bold"

Check warning on line 530 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L529-L530

Added lines #L529 - L530 were not covered by tests
else:
format_amt = report_data["formats"]["format_amount"]
field_prefix = "format_amount"

Check warning on line 533 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L532-L533

Added lines #L532 - L533 were not covered by tests
if "currency_id" in line_object and line_object.get("currency_id", False):
if isinstance(line_object["currency_id"], int):
currency = self.env["res.currency"].browse(line_object["currency_id"])

Check warning on line 536 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L536

Added line #L536 was not covered by tests
else:
currency = line_object["currency_id"]
field_name = f"{field_prefix}_{currency.name}"

Check warning on line 539 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L538-L539

Added lines #L538 - L539 were not covered by tests
if hasattr(self, field_name):
format_amt = getattr(self, field_name)

Check warning on line 541 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L541

Added line #L541 was not covered by tests
else:
format_amt = report_data["workbook"].add_format()
report_data["field_name"] = format_amt
format_amt.set_num_format(self._report_xlsx_currency_format(currency))
return format_amt

Check warning on line 546 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L543-L546

Added lines #L543 - L546 were not covered by tests

def _get_currency_amt_format_dict(self, line_dict, report_data):
"""Return amount format specific for each currency."""
if line_dict.get("account_group_id", False) and line_dict["account_group_id"]:
format_amt = report_data["formats"]["format_amount_bold"]
field_prefix = "format_amount_bold"

Check warning on line 552 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L551-L552

Added lines #L551 - L552 were not covered by tests
else:
format_amt = report_data["formats"]["format_amount"]
field_prefix = "format_amount"

Check warning on line 555 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L554-L555

Added lines #L554 - L555 were not covered by tests
if line_dict.get("currency_id", False) and line_dict["currency_id"]:
if isinstance(line_dict["currency_id"], int):
currency = self.env["res.currency"].browse(line_dict["currency_id"])

Check warning on line 558 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L558

Added line #L558 was not covered by tests
else:
currency = line_dict["currency_id"]
field_name = f"{field_prefix}_{currency.name}"

Check warning on line 561 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L560-L561

Added lines #L560 - L561 were not covered by tests
if hasattr(self, field_name):
format_amt = getattr(self, field_name)

Check warning on line 563 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L563

Added line #L563 was not covered by tests
else:
format_amt = report_data["workbook"].add_format()
report_data["field_name"] = format_amt
format_amt.set_num_format(self._report_xlsx_currency_format(currency))
return format_amt

Check warning on line 568 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L565-L568

Added lines #L565 - L568 were not covered by tests

def _get_currency_amt_header_format(self, line_object, report_data):
"""Return amount header format for each currency."""
format_amt = report_data["formats"]["format_header_amount"]

Check warning on line 572 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L572

Added line #L572 was not covered by tests
if line_object.currency_id:
field_name = "format_header_amount_%s" % line_object.currency_id.name
field_name = f"format_header_amount_{line_object.currency_id.name}"

Check warning on line 574 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L574

Added line #L574 was not covered by tests
if hasattr(self, field_name):
format_amt = getattr(self, field_name)
else:
format_amt = report_data["workbook"].add_format(

Check warning on line 578 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L578

Added line #L578 was not covered by tests
{"bold": True, "border": True, "bg_color": "#FFFFCC"}
)
report_data["field_name"] = format_amt
format_amount = "#,##0." + (

Check warning on line 582 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L581-L582

Added lines #L581 - L582 were not covered by tests
"0" * line_object.currency_id.decimal_places
)
format_amt.set_num_format(format_amount)
@@ -587,18 +587,18 @@

def _get_currency_amt_header_format_dict(self, line_object, report_data):
"""Return amount header format for each currency."""
format_amt = report_data["formats"]["format_header_amount"]

Check warning on line 590 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L590

Added line #L590 was not covered by tests
if line_object["currency_id"]:
field_name = "format_header_amount_%s" % line_object["currency_name"]
field_name = f"format_header_amount_{line_object['currency_name']}"

Check warning on line 592 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L592

Added line #L592 was not covered by tests
if hasattr(self, field_name):
format_amt = getattr(self, field_name)
else:
format_amt = report_data["workbook"].add_format(

Check warning on line 596 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L596

Added line #L596 was not covered by tests
{"bold": True, "border": True, "bg_color": "#FFFFCC"}
)
report_data["field_name"] = format_amt
currency = self.env["res.currency"].browse(line_object["currency_id"])
format_amount = "#,##0." + ("0" * currency.decimal_places)

Check warning on line 601 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L599-L601

Added lines #L599 - L601 were not covered by tests
format_amt.set_num_format(format_amount)
return format_amt

@@ -610,7 +610,7 @@

def _get_report_complete_name(self, report, prefix, data=None):
if report.company_id:
suffix = (

Check warning on line 613 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L613

Added line #L613 was not covered by tests
f" - {report.company_id.name} - {report.company_id.currency_id.name}"
)
return prefix + suffix
@@ -688,7 +688,7 @@
"""
:return: the columns position used for final balance label.
"""
raise NotImplementedError()

Check warning on line 691 in account_financial_report/report/abstract_report_xlsx.py

Codecov / codecov/patch

account_financial_report/report/abstract_report_xlsx.py#L691

Added line #L691 was not covered by tests

def write_non_standard_column(self, cell_type, col_pos, value):
"""
36 changes: 16 additions & 20 deletions account_financial_report/report/aged_partner_balance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ?? 2016 Julien Coux (Camptocamp)
# © 2016 Julien Coux (Camptocamp)
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

@@ -61,82 +61,78 @@
ag_pb_data[acc_id]["30_days"] += residual
ag_pb_data[acc_id][prt_id]["30_days"] += residual
elif today <= due_date + timedelta(days=60):
ag_pb_data[acc_id]["60_days"] += residual
ag_pb_data[acc_id][prt_id]["60_days"] += residual

Check warning on line 65 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L64-L65

Added lines #L64 - L65 were not covered by tests
elif today <= due_date + timedelta(days=90):
ag_pb_data[acc_id]["90_days"] += residual
ag_pb_data[acc_id][prt_id]["90_days"] += residual

Check warning on line 68 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L67-L68

Added lines #L67 - L68 were not covered by tests
elif today <= due_date + timedelta(days=120):
ag_pb_data[acc_id]["120_days"] += residual
ag_pb_data[acc_id][prt_id]["120_days"] += residual

Check warning on line 71 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L70-L71

Added lines #L70 - L71 were not covered by tests
else:
ag_pb_data[acc_id]["older"] += residual
ag_pb_data[acc_id][prt_id]["older"] += residual

Check warning on line 74 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L73-L74

Added lines #L73 - L74 were not covered by tests
if due_date:
days_difference = abs((today - due_date).days)
for index, line in enumerate(interval_lines):
lower_limit = (
0 if not index else interval_lines[index - 1].inferior_limit
)
next_line = (
interval_lines[index] if index < len(interval_lines) else None
)
interval_range = self._get_values_for_range_intervals(
lower_limit, next_line.inferior_limit
)
if (
days_difference in interval_range
or days_difference == line.inferior_limit
):
ag_pb_data[acc_id][line] += residual
ag_pb_data[acc_id][prt_id][line] += residual
break

days_difference = abs((today - due_date).days)
for index, line in enumerate(interval_lines):
lower_limit = 0 if not index else interval_lines[index - 1].inferior_limit
next_line = interval_lines[index] if index < len(interval_lines) else None
interval_range = self._get_values_for_range_intervals(
lower_limit, next_line.inferior_limit
)
if (
days_difference in interval_range
or days_difference == line.inferior_limit
):
ag_pb_data[acc_id][line] += residual
ag_pb_data[acc_id][prt_id][line] += residual
break
return ag_pb_data

def _get_values_for_range_intervals(self, num1, num2):
min_num = min(num1, num2)
max_num = max(num1, num2)
if abs(num2 - num1) == 1:
return [max_num]

Check warning on line 96 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L96

Added line #L96 was not covered by tests
return list(range(min_num + 1, max_num))

def _get_account_partial_reconciled(self, company_id, date_at_object):
domain = [("max_date", ">", date_at_object), ("company_id", "=", company_id)]
fields = [

Check warning on line 101 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L100-L101

Added lines #L100 - L101 were not covered by tests
"debit_move_id",
"credit_move_id",
"amount",
"debit_amount_currency",
"credit_amount_currency",
]
accounts_partial_reconcile = self.env["account.partial.reconcile"].search_read(

Check warning on line 108 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L108

Added line #L108 was not covered by tests
domain=domain, fields=fields
)
debit_amount = {}
debit_amount_currency = {}
credit_amount = {}
credit_amount_currency = {}

Check warning on line 114 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L111-L114

Added lines #L111 - L114 were not covered by tests
for account_partial_reconcile_data in accounts_partial_reconcile:
debit_move_id = account_partial_reconcile_data["debit_move_id"][0]
credit_move_id = account_partial_reconcile_data["credit_move_id"][0]

Check warning on line 117 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L116-L117

Added lines #L116 - L117 were not covered by tests
if debit_move_id not in debit_amount.keys():
debit_amount[debit_move_id] = 0.0
debit_amount_currency[debit_move_id] = 0.0
debit_amount_currency[debit_move_id] += account_partial_reconcile_data[

Check warning on line 121 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L119-L121

Added lines #L119 - L121 were not covered by tests
"debit_amount_currency"
]
debit_amount[debit_move_id] += account_partial_reconcile_data["amount"]

Check warning on line 124 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L124

Added line #L124 was not covered by tests
if credit_move_id not in credit_amount.keys():
credit_amount[credit_move_id] = 0.0
credit_amount_currency[credit_move_id] = 0.0
credit_amount[credit_move_id] += account_partial_reconcile_data["amount"]
credit_amount_currency[credit_move_id] += account_partial_reconcile_data[

Check warning on line 129 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L126-L129

Added lines #L126 - L129 were not covered by tests
"credit_amount_currency"
]
account_partial_reconcile_data.update(

Check warning on line 132 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L132

Added line #L132 was not covered by tests
{"debit_move_id": debit_move_id, "credit_move_id": credit_move_id}
)
return (

Check warning on line 135 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L135

Added line #L135 was not covered by tests
accounts_partial_reconcile,
debit_amount,
credit_amount,
@@ -165,7 +161,7 @@
partners_data = {}
ag_pb_data = {}
if date_at_object < date.today():
(

Check warning on line 164 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L164

Added line #L164 was not covered by tests
acc_partial_rec,
debit_amount,
credit_amount,
@@ -173,14 +169,14 @@
credit_amount_currency,
) = self._get_account_partial_reconciled(company_id, date_at_object)
if acc_partial_rec:
ml_ids = list(map(operator.itemgetter("id"), move_lines))
debit_ids = list(

Check warning on line 173 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L172-L173

Added lines #L172 - L173 were not covered by tests
map(operator.itemgetter("debit_move_id"), acc_partial_rec)
)
credit_ids = list(

Check warning on line 176 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L176

Added line #L176 was not covered by tests
map(operator.itemgetter("credit_move_id"), acc_partial_rec)
)
move_lines = self._recalculate_move_lines(

Check warning on line 179 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L179

Added line #L179 was not covered by tests
move_lines,
debit_ids,
credit_ids,
@@ -207,8 +203,8 @@
prt_id = move_line["partner_id"][0]
prt_name = move_line["partner_id"][1]
else:
prt_id = 0
prt_name = ""

Check warning on line 207 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L206-L207

Added lines #L206 - L207 were not covered by tests
if prt_id not in partners_ids:
partners_data.update({prt_id: {"id": prt_id, "name": prt_name}})
partners_ids.add(prt_id)
@@ -220,15 +216,15 @@
if show_move_line_details:
if move_line["ref"] == move_line["name"]:
if move_line["ref"]:
ref_label = move_line["ref"]

Check warning on line 219 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L219

Added line #L219 was not covered by tests
else:
ref_label = ""
elif not move_line["ref"]:
ref_label = move_line["name"]
elif not move_line["name"]:
ref_label = move_line["ref"]

Check warning on line 225 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L225

Added line #L225 was not covered by tests
else:
ref_label = move_line["ref"] + " - " + move_line["name"]

Check warning on line 227 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L227

Added line #L227 was not covered by tests
move_line_data.update(
{
"line_rec": line_model.browse(move_line["id"]),
@@ -279,13 +275,13 @@
elif today <= due_date + timedelta(days=30):
ml["30_days"] += amount
elif today <= due_date + timedelta(days=60):
ml["60_days"] += amount

Check warning on line 278 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L278

Added line #L278 was not covered by tests
elif today <= due_date + timedelta(days=90):
ml["90_days"] += amount

Check warning on line 280 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L280

Added line #L280 was not covered by tests
elif today <= due_date + timedelta(days=120):
ml["120_days"] += amount

Check warning on line 282 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L282

Added line #L282 was not covered by tests
else:
ml["older"] += amount

Check warning on line 284 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L284

Added line #L284 was not covered by tests
if due_date:
days_difference = abs((today - due_date).days)
for index, interval_line in enumerate(interval_lines):
@@ -370,8 +366,8 @@
interval_lines = self.env.context["age_partner_config"].line_ids
for account in aged_partner_data:
if abs(account["residual"]) > 0.01:
total = account["residual"]
account.update(

Check warning on line 370 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L369-L370

Added lines #L369 - L370 were not covered by tests
{
"percent_current": abs(
round((account["current"] / total) * 100, 2)
@@ -394,7 +390,7 @@
}
)
for interval_line in interval_lines:
account[f"percent_{interval_line.id}"] = abs(

Check warning on line 393 in account_financial_report/report/aged_partner_balance.py

Codecov / codecov/patch

account_financial_report/report/aged_partner_balance.py#L393

Added line #L393 was not covered by tests
round((account[interval_line] / total) * 100, 2)
)
else:
Loading

Unchanged files with check annotations Beta

# Eg: https://github.com/odoo/odoo/blob/8479b4e/addons/sale/models/account_move_line.py#L158
for key in record.analytic_distribution:
for account_id in map(int, key.split(",")):
batch_by_analytic_account[account_id] += record

Check warning on line 26 in account_financial_report/models/account_move_line.py

Codecov / codecov/patch

account_financial_report/models/account_move_line.py#L26

Added line #L26 was not covered by tests
existing_account_ids = set(
self.env["account.analytic.account"]
.browse(batch_by_analytic_account)
self.analytic_account_ids = [Command.clear()]
for account_id, records in batch_by_analytic_account.items():
if account_id in existing_account_ids:
records.analytic_account_ids = [Command.link(account_id)]

Check warning on line 37 in account_financial_report/models/account_move_line.py

Codecov / codecov/patch

account_financial_report/models/account_move_line.py#L37

Added line #L37 was not covered by tests
def init(self):
"""
# In Big DataBase every time you change the domain widget this method
# takes a lot of time. This improves performance
if self.env.context.get("skip_search_count"):
return 0

Check warning on line 69 in account_financial_report/models/account_move_line.py

Codecov / codecov/patch

account_financial_report/models/account_move_line.py#L69

Added line #L69 was not covered by tests
return super().search_count(domain, limit=limit)
@api.model
def _render_xlsx(self, report_ref, docids, data=None):
context = self._prepare_account_financial_report_context(data)
obj = self.with_context(**context) if context else self
return super(IrActionsReport, obj)._render_xlsx(report_ref, docids, data=data)

Check warning on line 27 in account_financial_report/models/ir_actions_report.py

Codecov / codecov/patch

account_financial_report/models/ir_actions_report.py#L25-L27

Added lines #L25 - L27 were not covered by tests