Browse Source

Apr 25 [UPDT] : Bug Fixed 'dynamic_accounts_report'

dependabot/npm_and_yarn/odoo_website_helpdesk/static/src/cdn/minimist-1.2.8
AjmalCybro 2 years ago
parent
commit
730fcdb22f
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 5
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 1
      dynamic_accounts_report/report/general_ledger.py
  4. 1
      dynamic_accounts_report/static/src/js/general_ledger.js
  5. 2
      dynamic_accounts_report/static/src/xml/general_ledger_view.xml
  6. 35
      dynamic_accounts_report/wizard/general_ledger.py

2
dynamic_accounts_report/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Dynamic Financial Reports V16',
'version': '16.0.1.0.4',
'version': '16.0.1.0.5',
'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=gVQi9q9Rs-E&t=5s',
'summary': """Dynamic Financial Reports with drill

5
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -14,3 +14,8 @@
#### Version 16.0.1.0.2
#### UPDT AND BUGFIX
- Report Bug Fix: Correct the currency used in the General Ledger
#### 21.04.2023
#### Version 16.0.1.0.5
#### BUGFIX
- Report Bug Fix: Journal filter is not visible for any languages other than english, entries of all journals are taken for bank book and cash book for other languages.

1
dynamic_accounts_report/report/general_ledger.py

@ -13,6 +13,7 @@ class GeneralLedger(models.AbstractModel):
'debit_total': data.get('report_data')['debit_total'],
'credit_total': data.get('report_data')['credit_total'],
'title': data.get('report_data')['name'],
'eng_title': data.get('report_data')['eng_title'],
'company': self.env.company,
})
return data

1
dynamic_accounts_report/static/src/js/general_ledger.js

@ -120,6 +120,7 @@ odoo.define('dynamic_accounts_report.general_ledger', function (require) {
self.$('.filter_view_tb').html(QWeb.render('GLFilterView', {
filter_data: datas['filters'],
title : datas['name'],
eng_title : datas['eng_title'],
}));
self.$el.find('.journals').select2({
placeholder: ' Journals...',

2
dynamic_accounts_report/static/src/xml/general_ledger_view.xml

@ -205,7 +205,7 @@
</div>
</div>
</div>
<t t-if="title == 'General Ledger'">
<t t-if="eng_title == 'General Ledger'">
<div class="journals_filter" style="">
<a type="button" class="dropdown-toggle"
data-bs-toggle="dropdown">

35
dynamic_accounts_report/wizard/general_ledger.py

@ -50,32 +50,36 @@ class GeneralView(models.TransientModel):
new_title = ''
# todo:
# trans_title = self.env['ir.translation'].search([('value', '=', title),
# ('module', '=',
# 'dynamic_accounts_report')],
# limit=1).src
# to get the english translation of the title
record_id = self.env['ir.actions.client'].with_context(lang=self.env.user.lang). \
search([('name', '=', title)]).id
trans_title = self.env['ir.actions.client'].with_context(lang='en_US').search([('id', '=', record_id)]).name
company_id = self.env.companies.ids
if r.journal_ids:
journals = r.journal_ids
else:
journals = self.env['account.journal'].search(
[('company_id', 'in', company_id)])
if title == 'General Ledger':
if title == 'General Ledger' or trans_title == 'General Ledger':
if r.journal_ids:
journals = r.journal_ids
else:
journals = self.env['account.journal'].search(
[('company_id', 'in', company_id)])
new_title = title
if title == 'Bank Book':
eng_title = 'General Ledger'
if title == 'Bank Book' or trans_title == 'Bank Book':
journals = self.env['account.journal'].search(
[('type', '=', 'bank'), ('company_id', 'in', company_id)])
new_title = title
if title == 'Cash Book':
eng_title = 'Bank Book'
if title == 'Cash Book' or trans_title == 'Cash Book':
journals = self.env['account.journal'].search(
[('type', '=', 'cash'), ('company_id', 'in', company_id)])
new_title = title
eng_title = 'Cash Book'
r.write({
'titles': new_title,
})
@ -104,6 +108,7 @@ class GeneralView(models.TransientModel):
currency = self._get_currency()
return {
'name': new_title,
'eng_title': eng_title,
'type': 'ir.actions.client',
'tag': 'g_l',
'filters': filters,
@ -431,10 +436,10 @@ class GeneralView(models.TransientModel):
def get_accounts_line(self, account_id, title):
# trans_title = self.env['ir.translation'].search([('value', '=', title),
# ('module', '=',
# 'dynamic_accounts_report')],
#
# to get the english translation of the title
record_id = self.env['ir.actions.client'].with_context(lang=self.env.user.lang). \
search([('name', '=', title)]).id
trans_title = self.env['ir.actions.client'].with_context(lang='en_US').search([('id', '=', record_id)]).name
company_id = self.env.companies.ids
if self.journal_ids:
@ -442,16 +447,16 @@ class GeneralView(models.TransientModel):
else:
journals = self.env['account.journal'].search(
[('company_id', 'in', company_id)])
if title == 'General Ledger':
if title == 'General Ledger' or trans_title == 'General Ledger':
if self.journal_ids:
journals = self.journal_ids
else:
journals = self.env['account.journal'].search(
[('company_id', 'in', company_id)])
if title == 'Bank Book':
if title == 'Bank Book' or trans_title == 'Bank Book':
journals = self.env['account.journal'].search(
[('type', '=', 'bank'), ('company_id', 'in', company_id)])
if title == 'Cash Book':
if title == 'Cash Book' or trans_title == 'Cash Book':
journals = self.env['account.journal'].search(
[('type', '=', 'cash'), ('company_id', 'in', company_id)])

Loading…
Cancel
Save