Browse Source

Nov 24 : [FIX] Bug Fixed 'dynamic_accounts_report'

pull/295/head
AjmalCybro 2 years ago
parent
commit
313855fa40
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 5
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 18
      dynamic_accounts_report/wizard/balance_sheet.py

2
dynamic_accounts_report/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Dynamic Financial Reports V16',
'version': '16.0.1.0.8',
'version': '16.0.1.0.9',
'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

@ -30,3 +30,8 @@
#### BUGFIX
- Report Bug Fix: Problem with language while printing profit and loss report fixed.
- Report Bug Fix: Problem with language while opening cash flow statement.
### 20.11.2023
### version 16.0.1.0.9,
### BUGFIX
- Profit And Loss: multiple lines of the same account in the financial reports.

18
dynamic_accounts_report/wizard/balance_sheet.py

@ -108,7 +108,6 @@ class BalanceSheetView(models.TransientModel):
'strict_range': False,
'company_id': self.company_id,
'lang': lang}}
account_lines = self.get_account_lines(new_data)
report_lines = self.view_report_pdf(account_lines, new_data)[
'report_lines']
@ -136,7 +135,6 @@ class BalanceSheetView(models.TransientModel):
report_lines_move.append(each)
filter_movelines_parents(report_lines)
# for rec in report_lines_move:
# if rec['report_type'] == 'accounts':
# if rec['account'] in move_line_accounts:
@ -172,6 +170,7 @@ class BalanceSheetView(models.TransientModel):
final_report_lines.append(rec)
else:
final_report_lines.append(rec)
def filter_sum(obj):
sum_list = {}
for pl in parent_list:
@ -234,12 +233,22 @@ class BalanceSheetView(models.TransientModel):
item['name']['en_US']
else:
item['new_name'] = item['name']
merged_data = {}
for line in records['Accounts']:
account_id = line['account_id']
if account_id not in merged_data:
merged_data[account_id] = line
else:
merged_data[account_id]['debit'] += line['debit']
merged_data[account_id]['credit'] += line['credit']
merged_data[account_id]['balance'] += line['balance']
report_list = list(merged_data.values())
return {
'name': tag,
'type': 'ir.actions.client',
'tag': tag,
'filters': filters,
'report_lines': records['Accounts'],
'report_lines': report_list,
'debit_total': records['debit_total'],
'credit_total': records['credit_total'],
'debit_balance': records['debit_balance'],
@ -476,7 +485,8 @@ class BalanceSheetView(models.TransientModel):
WHERE += ' AND an.id IN %s' % str(
tuple(data.get('analytics').ids) + tuple([0]))
if data.get('account_tags'):
WHERE += ' AND act.id IN %s' % str(tuple(data.get('account_tags').ids)+ tuple([0]))
WHERE += ' AND act.id IN %s' % str(
tuple(data.get('account_tags').ids) + tuple([0]))
# if data['analytic_tags']:
# WHERE += ' AND anltag.account_analytic_tag_id IN %s' % str(

Loading…
Cancel
Save