Browse Source

[UPDT] Translation added

pull/298/head
Ajmal Cybro 4 years ago
parent
commit
d123587b70
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 5
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 1450
      dynamic_accounts_report/i18n/ar_001.po
  4. 153
      dynamic_accounts_report/wizard/ageing.py
  5. 11
      dynamic_accounts_report/wizard/balance_sheet.py
  6. 15
      dynamic_accounts_report/wizard/general_ledger.py
  7. 10
      dynamic_accounts_report/wizard/trial_balance.py

2
dynamic_accounts_report/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Dynamic Financial Reports',
'version': '14.0.1.2.4',
'version': '14.0.1.2.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

@ -31,3 +31,8 @@
#### Version 14.0.1.2.4
#### UPDT
- Translation issue and Calendar format issue
#### 15.01.2022
#### Version 14.0.1.2.5
#### UPDT
- Arabic Translation added

1450
dynamic_accounts_report/i18n/ar_001.po

File diff suppressed because it is too large

153
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)

11
dynamic_accounts_report/wizard/balance_sheet.py

@ -84,8 +84,17 @@ 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'].with_context(lang='en_US').search([
('name', 'ilike', tag)])
('name', 'ilike', tag_upd)])
new_data = {'id': self.id, 'date_from': False,
'enable_filter': True,

15
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,
})
@ -332,6 +334,7 @@ class GeneralView(models.TransientModel):
params = tuple(where_params)
else:
params = (tuple(accounts.ids),) + tuple(where_params)
cr.execute(sql, params)
for row in cr.dictfetchall():

10
dynamic_accounts_report/wizard/trial_balance.py

@ -148,9 +148,9 @@ class TrialView(models.TransientModel):
wheres.append(where_clause.strip())
filters = " AND ".join(wheres)
if data['target_move'] == 'posted':
filters += " AND account_move_line__move_id.state = 'posted'"
filters += " AND account_move_line.parent_state = 'posted'"
else:
filters += " AND account_move_line__move_id.state in ('draft','posted')"
filters += " AND account_move_line.parent_state in ('draft','posted')"
if data.get('date_from'):
filters += " AND account_move_line.date >= '%s'" % data.get('date_from')
if data.get('date_to'):
@ -158,7 +158,7 @@ class TrialView(models.TransientModel):
if data['journals']:
filters += ' AND jrnl.id IN %s' % str(tuple(data['journals'].ids) + tuple([0]))
tables += 'JOIN account_journal jrnl ON (account_move_line.journal_id=jrnl.id)'
tables += ' JOIN account_journal jrnl ON (account_move_line.journal_id=jrnl.id)'
# compute the balance, debit and credit for the provided accounts
request = (
"SELECT account_id AS id, SUM(debit) AS debit, SUM(credit) AS credit, (SUM(debit) - SUM(credit)) AS balance" + \
@ -207,9 +207,9 @@ class TrialView(models.TransientModel):
wheres.append(where_clause.strip())
filters = " AND ".join(wheres)
if data['target_move'] == 'posted':
filters += " AND account_move_line__move_id.state = 'posted'"
filters += " AND account_move_line.parent_state = 'posted'"
else:
filters += " AND account_move_line__move_id.state in ('draft','posted')"
filters += " AND account_move_line.parent_state in ('draft','posted')"
if data.get('date_from'):
filters += " AND account_move_line.date < '%s'" % data.get('date_from')

Loading…
Cancel
Save