-
-
diff --git a/dynamic_accounts_report/wizard/ageing.py b/dynamic_accounts_report/wizard/ageing.py
index 652ff29cc..d8b29ee2b 100644
--- a/dynamic_accounts_report/wizard/ageing.py
+++ b/dynamic_accounts_report/wizard/ageing.py
@@ -397,88 +397,93 @@ class AgeingView(models.TransientModel):
partners_amount[partner_id] += line_amount
if i + 1 == 5:
period5 = i + 1
- lines[partner_id].append({
- 'period5': period5,
- 'line': line,
- 'partner_id': partner_id,
- 'move': move_name,
- 'currency': currency_id,
- 'symbol': currency_symbol,
- 'jrnl': jrnl_id,
- 'acc_name': account_id,
- 'mov_id': move_id,
- 'acc_code': account_code,
- 'date': date_maturity,
- 'amount': line_amount,
- })
+ if partner_id:
+ lines[partner_id].append({
+ 'period5': period5,
+ 'line': line,
+ 'partner_id': partner_id,
+ 'move': move_name,
+ 'currency': currency_id,
+ 'symbol': currency_symbol,
+ 'jrnl': jrnl_id,
+ 'acc_name': account_id,
+ 'mov_id': move_id,
+ 'acc_code': account_code,
+ 'date': date_maturity,
+ 'amount': line_amount,
+ })
elif i + 1 == 4:
period4 = i + 1
- lines[partner_id].append({
-
- 'period4': period4,
- 'line': line,
- 'partner_id': partner_id,
- 'move': move_name,
- 'jrnl': jrnl_id,
- 'acc_name': account_id,
- 'currency': currency_id,
- 'symbol': currency_symbol,
- 'mov_id': move_id,
- 'acc_code': account_code,
- 'date': date_maturity,
- 'amount': line_amount,
- })
+ if partner_id:
+ lines[partner_id].append({
+
+ 'period4': period4,
+ 'line': line,
+ 'partner_id': partner_id,
+ 'move': move_name,
+ 'jrnl': jrnl_id,
+ 'acc_name': account_id,
+ 'currency': currency_id,
+ 'symbol': currency_symbol,
+ 'mov_id': move_id,
+ 'acc_code': account_code,
+ 'date': date_maturity,
+ 'amount': line_amount,
+ })
elif i + 1 == 3:
period3 = i + 1
- lines[partner_id].append({
-
- 'period3': period3,
- 'line': line,
- 'partner_id': partner_id,
- 'move': move_name,
- 'jrnl': jrnl_id,
- 'acc_name': account_id,
- 'currency': currency_id,
- 'symbol': currency_symbol,
- 'mov_id': move_id,
- 'acc_code': account_code,
- 'date': date_maturity,
- 'amount': line_amount,
- })
+ if partner_id:
+ lines[partner_id].append({
+
+ 'period3': period3,
+ 'line': line,
+ 'partner_id': partner_id,
+ 'move': move_name,
+ 'jrnl': jrnl_id,
+ 'acc_name': account_id,
+ 'currency': currency_id,
+ 'symbol': currency_symbol,
+ 'mov_id': move_id,
+ 'acc_code': account_code,
+ 'date': date_maturity,
+ 'amount': line_amount,
+ })
elif i + 1 == 2:
period2 = i + 1
- lines[partner_id].append({
-
- 'period2': period2,
- 'line': line,
- 'partner_id': partner_id,
- 'move': move_name,
- 'jrnl': jrnl_id,
- 'acc_name': account_id,
- 'currency': currency_id,
- 'symbol': currency_symbol,
- 'mov_id': move_id,
- 'acc_code': account_code,
- 'date': date_maturity,
- 'amount': line_amount,
- })
+ if partner_id:
+ lines[partner_id].append({
+
+ 'period2': period2,
+ 'line': line,
+ 'partner_id': partner_id,
+ 'move': move_name,
+ 'jrnl': jrnl_id,
+ 'acc_name': account_id,
+ 'currency': currency_id,
+ 'symbol': currency_symbol,
+ 'mov_id': move_id,
+ 'acc_code': account_code,
+ 'date': date_maturity,
+ 'amount': line_amount,
+ })
else:
period1 = i + 1
- lines[partner_id].append({
-
- 'period1': period1,
- 'line': line,
- 'partner_id': partner_id,
- 'move': move_name,
- 'jrnl': jrnl_id,
- 'acc_name': account_id,
- 'currency': currency_id,
- 'symbol': currency_symbol,
- 'mov_id': move_id,
- 'acc_code': account_code,
- 'date': date_maturity,
- 'amount': line_amount,
- })
+ if partner_id:
+ lines[partner_id].append({
+
+ 'period1': period1,
+ 'line': line,
+ 'partner_id': partner_id,
+ 'move': move_name,
+ 'jrnl': jrnl_id,
+ 'acc_name': account_id,
+ 'currency': currency_id,
+ 'symbol': currency_symbol,
+ 'mov_id': move_id,
+ 'acc_code': account_code,
+ 'date': date_maturity,
+ 'amount': line_amount,
+ })
history.append(partners_amount)
diff --git a/dynamic_accounts_report/wizard/balance_sheet.py b/dynamic_accounts_report/wizard/balance_sheet.py
index ac129752e..0c23807f4 100644
--- a/dynamic_accounts_report/wizard/balance_sheet.py
+++ b/dynamic_accounts_report/wizard/balance_sheet.py
@@ -38,6 +38,7 @@ class BalanceSheetView(models.TransientModel):
@api.model
def view_report(self, option, tag):
+
r = self.env['dynamic.balance.sheet.report'].search(
[('id', '=', option[0])])
data = {
@@ -83,9 +84,15 @@ class BalanceSheetView(models.TransientModel):
new_records = list(filter(filter_code, records['Accounts']))
records['Accounts'] = new_records
+ trans_tag = self.env['ir.translation'].search([('value', '=', tag), ('module', '=', 'dynamic_accounts_report')],
+ limit=1).src
+ if trans_tag:
+ tag_upd = trans_tag
+ else:
+ tag_upd = tag
- account_report_id = self.env['account.financial.report'].search([
- ('name', 'ilike', tag)])
+ account_report_id = self.env['account.financial.report'].with_context(lang='en_US').search([
+ ('name', 'ilike', tag_upd)])
new_data = {'id': self.id, 'date_from': False,
'enable_filter': True,
@@ -161,7 +168,6 @@ class BalanceSheetView(models.TransientModel):
parent_list = list(set(parent_list))
final_report_lines = []
-
for rec in report_lines_move:
if rec['report_type'] != 'accounts':
if rec['r_id'] in parent_list:
@@ -220,7 +226,6 @@ class BalanceSheetView(models.TransientModel):
rec['m_credit'] = "{:,.2f}".format(rec['credit']) + " " + symbol
rec['m_balance'] = "{:,.2f}".format(
rec['balance']) + " " + symbol
-
return {
'name': tag,
'type': 'ir.actions.client',
diff --git a/dynamic_accounts_report/wizard/balance_sheet_config.py b/dynamic_accounts_report/wizard/balance_sheet_config.py
index 6643ad25d..60a8aded7 100644
--- a/dynamic_accounts_report/wizard/balance_sheet_config.py
+++ b/dynamic_accounts_report/wizard/balance_sheet_config.py
@@ -39,7 +39,6 @@ class BalanceSheet(models.TransientModel):
item['level'] = set_report_level(item)
data['journal_items'] = journal_items
data['report_lines'] = report_lines
-
return data
def _compute_account_balance(self, accounts):
diff --git a/dynamic_accounts_report/wizard/general_ledger.py b/dynamic_accounts_report/wizard/general_ledger.py
index cb994b35d..51a80c4f1 100644
--- a/dynamic_accounts_report/wizard/general_ledger.py
+++ b/dynamic_accounts_report/wizard/general_ledger.py
@@ -42,18 +42,20 @@ class GeneralView(models.TransientModel):
def view_report(self, option, title):
r = self.env['account.general.ledger'].search([('id', '=', option[0])])
new_title = ''
+ trans_title = self.env['ir.translation'].search([('value', '=', title), ('module', '=', 'dynamic_accounts_report')], limit=1).src
+
journals = r.journal_ids
- if title == 'General Ledger':
+ if title == 'General Ledger' or trans_title == 'General Ledger':
journals = r.journal_ids
- new_title = 'General Ledger'
- if title == 'Bank Book':
+ new_title = title
+ if title == 'Bank Book' or trans_title == 'Bank Book':
journals = self.env['account.journal'].search([('type', '=', 'bank')],
limit=1)
- new_title = 'Bank Book'
- if title == 'Cash Book':
+ new_title = title
+ if title == 'Cash Book' or trans_title == 'Cash Book':
journals = self.env['account.journal'].search([('type', '=', 'cash')],
limit=1)
- new_title = 'Cash Book'
+ new_title = title
r.write({
'titles': new_title,
})