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. 5
      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. 8
      dynamic_accounts_report/wizard/trial_balance.py

2
dynamic_accounts_report/__manifest__.py

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

5
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -31,3 +31,8 @@
#### Version 14.0.1.2.4 #### Version 14.0.1.2.4
#### UPDT #### UPDT
- Translation issue and Calendar format issue - 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

5
dynamic_accounts_report/wizard/ageing.py

@ -397,6 +397,7 @@ class AgeingView(models.TransientModel):
partners_amount[partner_id] += line_amount partners_amount[partner_id] += line_amount
if i + 1 == 5: if i + 1 == 5:
period5 = i + 1 period5 = i + 1
if partner_id:
lines[partner_id].append({ lines[partner_id].append({
'period5': period5, 'period5': period5,
'line': line, 'line': line,
@ -413,6 +414,7 @@ class AgeingView(models.TransientModel):
}) })
elif i + 1 == 4: elif i + 1 == 4:
period4 = i + 1 period4 = i + 1
if partner_id:
lines[partner_id].append({ lines[partner_id].append({
'period4': period4, 'period4': period4,
@ -430,6 +432,7 @@ class AgeingView(models.TransientModel):
}) })
elif i + 1 == 3: elif i + 1 == 3:
period3 = i + 1 period3 = i + 1
if partner_id:
lines[partner_id].append({ lines[partner_id].append({
'period3': period3, 'period3': period3,
@ -447,6 +450,7 @@ class AgeingView(models.TransientModel):
}) })
elif i + 1 == 2: elif i + 1 == 2:
period2 = i + 1 period2 = i + 1
if partner_id:
lines[partner_id].append({ lines[partner_id].append({
'period2': period2, 'period2': period2,
@ -464,6 +468,7 @@ class AgeingView(models.TransientModel):
}) })
else: else:
period1 = i + 1 period1 = i + 1
if partner_id:
lines[partner_id].append({ lines[partner_id].append({
'period1': period1, 'period1': period1,

11
dynamic_accounts_report/wizard/balance_sheet.py

@ -84,8 +84,17 @@ class BalanceSheetView(models.TransientModel):
new_records = list(filter(filter_code, records['Accounts'])) new_records = list(filter(filter_code, records['Accounts']))
records['Accounts'] = new_records 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([ 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, new_data = {'id': self.id, 'date_from': False,
'enable_filter': True, '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): def view_report(self, option, title):
r = self.env['account.general.ledger'].search([('id', '=', option[0])]) r = self.env['account.general.ledger'].search([('id', '=', option[0])])
new_title = '' new_title = ''
trans_title = self.env['ir.translation'].search([('value', '=', title), ('module', '=', 'dynamic_accounts_report')], limit=1).src
journals = r.journal_ids journals = r.journal_ids
if title == 'General Ledger': if title == 'General Ledger' or trans_title == 'General Ledger':
journals = r.journal_ids journals = r.journal_ids
new_title = 'General Ledger' new_title = title
if title == 'Bank Book': if title == 'Bank Book' or trans_title == 'Bank Book':
journals = self.env['account.journal'].search([('type', '=', 'bank')], journals = self.env['account.journal'].search([('type', '=', 'bank')],
limit=1) limit=1)
new_title = 'Bank Book' new_title = title
if title == 'Cash Book': if title == 'Cash Book' or trans_title == 'Cash Book':
journals = self.env['account.journal'].search([('type', '=', 'cash')], journals = self.env['account.journal'].search([('type', '=', 'cash')],
limit=1) limit=1)
new_title = 'Cash Book' new_title = title
r.write({ r.write({
'titles': new_title, 'titles': new_title,
}) })
@ -332,6 +334,7 @@ class GeneralView(models.TransientModel):
params = tuple(where_params) params = tuple(where_params)
else: else:
params = (tuple(accounts.ids),) + tuple(where_params) params = (tuple(accounts.ids),) + tuple(where_params)
cr.execute(sql, params) cr.execute(sql, params)
for row in cr.dictfetchall(): for row in cr.dictfetchall():

8
dynamic_accounts_report/wizard/trial_balance.py

@ -148,9 +148,9 @@ class TrialView(models.TransientModel):
wheres.append(where_clause.strip()) wheres.append(where_clause.strip())
filters = " AND ".join(wheres) filters = " AND ".join(wheres)
if data['target_move'] == 'posted': if data['target_move'] == 'posted':
filters += " AND account_move_line__move_id.state = 'posted'" filters += " AND account_move_line.parent_state = 'posted'"
else: 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'): if data.get('date_from'):
filters += " AND account_move_line.date >= '%s'" % data.get('date_from') filters += " AND account_move_line.date >= '%s'" % data.get('date_from')
if data.get('date_to'): if data.get('date_to'):
@ -207,9 +207,9 @@ class TrialView(models.TransientModel):
wheres.append(where_clause.strip()) wheres.append(where_clause.strip())
filters = " AND ".join(wheres) filters = " AND ".join(wheres)
if data['target_move'] == 'posted': if data['target_move'] == 'posted':
filters += " AND account_move_line__move_id.state = 'posted'" filters += " AND account_move_line.parent_state = 'posted'"
else: 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'): if data.get('date_from'):
filters += " AND account_move_line.date < '%s'" % data.get('date_from') filters += " AND account_move_line.date < '%s'" % data.get('date_from')

Loading…
Cancel
Save