Browse Source

[UPDT] Translation added

pull/195/head
Ajmal Cybro 4 years ago
parent
commit
3f3aeedc4d
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 7
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 1450
      dynamic_accounts_report/i18n/ar_001.po
  4. 6
      dynamic_accounts_report/static/src/js/financial_reports.js
  5. 154
      dynamic_accounts_report/wizard/ageing.py
  6. 15
      dynamic_accounts_report/wizard/balance_sheet.py
  7. 13
      dynamic_accounts_report/wizard/general_ledger.py

2
dynamic_accounts_report/__manifest__.py

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

7
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -10,4 +10,9 @@
#### 20.12.2021
#### Version 15.0.1.0.1
#### UPDT
- Translation issue and Calendar format issue
- Translation issue and Calendar format issue
#### 15.01.2022
#### Version 15.0.1.0.2
#### UPDT
- Arabic Translation added

1450
dynamic_accounts_report/i18n/ar_001.po

File diff suppressed because it is too large

6
dynamic_accounts_report/static/src/js/financial_reports.js

@ -83,7 +83,7 @@ odoo.define('dynamic_accounts_report.financial_reports', function (require) {
self._rpc({
model: 'dynamic.balance.sheet.report',
method: 'view_report',
args: [[this.wizard_id], action_title],
args: [[this.wizard_id], action_title, self.searchModel.config.context.lang],
}).then(function(datas) {
if (initial_render) {
@ -164,7 +164,7 @@ odoo.define('dynamic_accounts_report.financial_reports', function (require) {
model: 'dynamic.balance.sheet.report',
method: 'view_report',
args: [
[self.wizard_id], action_title
[self.wizard_id], action_title, self.searchModel.config.context.lang
],
}).then(function(data) {
var action = {
@ -194,7 +194,7 @@ odoo.define('dynamic_accounts_report.financial_reports', function (require) {
model: 'dynamic.balance.sheet.report',
method: 'view_report',
args: [
[self.wizard_id], action_title
[self.wizard_id], action_title, self.searchModel.config.context.lang
],
}).then(function(data) {
var action = {

154
dynamic_accounts_report/wizard/ageing.py

@ -301,6 +301,7 @@ class AgeingView(models.TransientModel):
aml_ids = cr.fetchall()
aml_ids = aml_ids and [x[0] for x in aml_ids] or []
for line in self.env['account.move.line'].browse(aml_ids):
print("skljskl", line.partner_id)
partner_id = line.partner_id.id or False
move_id = line.move_id.id
move_name = line.move_id.name
@ -415,88 +416,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)

15
dynamic_accounts_report/wizard/balance_sheet.py

@ -37,7 +37,7 @@ class BalanceSheetView(models.TransientModel):
date_to = fields.Date(string="End date")
@api.model
def view_report(self, option, tag):
def view_report(self, option, tag, lang):
r = self.env['dynamic.balance.sheet.report'].search(
[('id', '=', option[0])])
data = {
@ -86,8 +86,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'].search([
('name', 'ilike', tag)])
('name', 'ilike', tag_upd)])
new_data = {'id': self.id, 'date_from': False,
'enable_filter': True,
@ -225,6 +234,8 @@ class BalanceSheetView(models.TransientModel):
rec['m_balance'] = "{:,.2f}".format(
rec['balance']) + " " + symbol
return {
'name': tag,
'type': 'ir.actions.client',

13
dynamic_accounts_report/wizard/general_ledger.py

@ -46,18 +46,19 @@ class GeneralView(models.TransientModel):
company = self.get_current_company_value()[0]
company_id = self.env['res.company'].search([('id', '=', int(company))])
# company_domain = [('company_id', '=', company_id.id)]
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'), ('company_id', '=', company_id.id)],
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'), ('company_id', '=', company_id.id)],
limit=1)
new_title = 'Cash Book'
new_title = title
r.write({
'titles': new_title,
})

Loading…
Cancel
Save