Browse Source

[UPDT] Aug 31 : Dynamic report bug fix

pull/219/head
AjmalCybro 3 years ago
parent
commit
0785747263
  1. 2
      dynamic_accounts_report/__manifest__.py
  2. 7
      dynamic_accounts_report/doc/RELEASE_NOTES.md
  3. 2
      dynamic_accounts_report/report/general_ledger.py
  4. 2
      dynamic_accounts_report/report/partner_ledger.xml
  5. 5
      dynamic_accounts_report/static/src/js/partner_ledger.js
  6. 15
      dynamic_accounts_report/static/src/xml/partner_ledger_view.xml
  7. 2
      dynamic_accounts_report/wizard/general_ledger.py
  8. 9
      dynamic_accounts_report/wizard/partner_leadger.py

2
dynamic_accounts_report/__manifest__.py

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

7
dynamic_accounts_report/doc/RELEASE_NOTES.md

@ -25,4 +25,9 @@
#### 16.04.2022 #### 16.04.2022
#### Version 15.0.1.0.4 #### Version 15.0.1.0.4
#### UPDT AND BUGFIX #### UPDT AND BUGFIX
- Loading issue and orderby date - Loading issue and orderby date
#### 31.08.2022
#### Version 15.0.1.1.5
#### UPDT AND BUGFIX
- Report Bug Fix

2
dynamic_accounts_report/report/general_ledger.py

@ -8,7 +8,7 @@ class GeneralLedger(models.AbstractModel):
def _get_report_values(self, docids, data=None): def _get_report_values(self, docids, data=None):
if self.env.context.get('trial_pdf_report'): if self.env.context.get('trial_pdf_report'):
print(data.get('report_data')['report_lines'], "data")
if data.get('report_data'): if data.get('report_data'):
data.update({'account_data': data.get('report_data')['report_lines'], data.update({'account_data': data.get('report_data')['report_lines'],
'Filters': data.get('report_data')['filters'], 'Filters': data.get('report_data')['filters'],

2
dynamic_accounts_report/report/partner_ledger.xml

@ -41,6 +41,7 @@
</li> </li>
</t> </t>
</div> </div>
<div class="col-2"> <div class="col-2">
<strong>Partners:</strong> <strong>Partners:</strong>
<t t-foreach="Filters['partners']" t-as="ps"> <t t-foreach="Filters['partners']" t-as="ps">
@ -72,6 +73,7 @@
</li> </li>
</div> </div>
</div> </div>
<div style="text-align:centre;left:50%;" class="row"> <div style="text-align:centre;left:50%;" class="row">

5
dynamic_accounts_report/static/src/js/partner_ledger.js

@ -130,7 +130,6 @@ odoo.define('dynamic_accounts_report.partner_ledger', function (require) {
}); });
} }
var child=[]; var child=[];
self.$('.table_view_tb').html(QWeb.render('PLTable', { self.$('.table_view_tb').html(QWeb.render('PLTable', {
report_lines : datas['report_lines'], report_lines : datas['report_lines'],
filter : datas['filters'], filter : datas['filters'],
@ -436,8 +435,8 @@ odoo.define('dynamic_accounts_report.partner_ledger', function (require) {
if ($(".reconciled").length){ if ($(".reconciled").length){
var reconciled_res = document.getElementById("reconciled_res") var reconciled_res = document.getElementById("reconciled_res")
filter_data_selected.reconciled = $(".reconciled")[0].value filter_data_selected.reconciled = $(".reconciled")[1].value
reconciled_res.value = $(".reconciled")[0].value reconciled_res.value = $(".reconciled")[1].value
reconciled_res.innerHTML=reconciled_res.value; reconciled_res.innerHTML=reconciled_res.value;
if ($(".reconciled").value==""){ if ($(".reconciled").value==""){
reconciled_res.innerHTML="unreconciled"; reconciled_res.innerHTML="unreconciled";

15
dynamic_accounts_report/static/src/xml/partner_ledger_view.xml

@ -242,7 +242,6 @@
</div> </div>
<div class="search-Target-move" style=""> <div class="search-Target-move" style="">
<a type="button" class="dropdown-toggle" data-toggle="dropdown"> <a type="button" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-filter"></span> <span class="fa fa-filter"></span>
@ -255,6 +254,20 @@
</select> </select>
<span id="post_res"></span> <span id="post_res"></span>
</div> </div>
<div class="search-Reconciled" style="">
<a type="button" class="dropdown-toggle" data-toggle="dropdown">
<span class="fa fa-filter"></span>
Reconciled status:
</a>
<select id="reconciled" class="dropdown-menu reconciled" name="states[]">
<div role="separator" class="dropdown-divider"></div>
<option value="unreconciled">Unreconciled</option>
<option value="all">All</option>
</select>
<span id="reconciled_res"></span>
</div>
<div style=""> <div style="">
<button type="button" id="apply_filter" class="btn btn-primary" <button type="button" id="apply_filter" class="btn btn-primary"
style="top:0px;height:30px;color:white;background-color: #00A0AD;border-color: #00A0AD;"> style="top:0px;height:30px;color:white;background-color: #00A0AD;border-color: #00A0AD;">

2
dynamic_accounts_report/wizard/general_ledger.py

@ -91,6 +91,7 @@ class GeneralView(models.TransientModel):
filters = self.get_filter(option) filters = self.get_filter(option)
records = self._get_report_values(data) records = self._get_report_values(data)
currency = self._get_currency() currency = self._get_currency()
print(records, "records....")
return { return {
'name': new_title, 'name': new_title,
'type': 'ir.actions.client', 'type': 'ir.actions.client',
@ -222,6 +223,7 @@ class GeneralView(models.TransientModel):
debit_total = sum(x['debit'] for x in account_res) debit_total = sum(x['debit'] for x in account_res)
credit_total = sum(x['credit'] for x in account_res) credit_total = sum(x['credit'] for x in account_res)
debit_balance = round(debit_total,2) - round(credit_total,2) debit_balance = round(debit_total,2) - round(credit_total,2)
print(account_res, ".................")
return { return {
'doc_ids': self.ids, 'doc_ids': self.ids,
'debit_total': debit_total, 'debit_total': debit_total,

9
dynamic_accounts_report/wizard/partner_leadger.py

@ -32,8 +32,8 @@ class PartnerView(models.TransientModel):
partner_category_ids = fields.Many2many('res.partner.category', partner_category_ids = fields.Many2many('res.partner.category',
string='Partner tags') string='Partner tags')
reconciled = fields.Selection([ reconciled = fields.Selection([
('unreconciled', 'Unreconciled Only')], ('unreconciled', 'Unreconciled Only'), ('all', 'All')],
string='Reconcile Type', default='unreconciled') string='Reconcile Type', default='all')
account_type_ids = fields.Many2many('account.account.type',string='Account Type', account_type_ids = fields.Many2many('account.account.type',string='Account Type',
domain=[('type', 'in', ('receivable', 'payable'))]) domain=[('type', 'in', ('receivable', 'payable'))])
@ -127,6 +127,7 @@ class PartnerView(models.TransientModel):
filters['category_list'] = data.get('category_list') filters['category_list'] = data.get('category_list')
filters['account_type_list'] = data.get('account_type_list') filters['account_type_list'] = data.get('account_type_list')
filters['target_move'] = data.get('target_move').capitalize() filters['target_move'] = data.get('target_move').capitalize()
print(filters, "filters")
return filters return filters
def get_filter_data(self, option): def get_filter_data(self, option):
@ -163,7 +164,7 @@ class PartnerView(models.TransientModel):
accounts.append((j.id, j.name)) accounts.append((j.id, j.name))
print(r.reconciled, "rec")
filter_dict = { filter_dict = {
'journal_ids': r.journal_ids.ids, 'journal_ids': r.journal_ids.ids,
'account_ids': r.account_ids.ids, 'account_ids': r.account_ids.ids,
@ -293,7 +294,7 @@ class PartnerView(models.TransientModel):
if data.get('partners'): if data.get('partners'):
WHERE += ' AND p.id IN %s' % str( WHERE += ' AND p.id IN %s' % str(
tuple(data.get('partners').ids) + tuple([0])) tuple(data.get('partners').ids) + tuple([0]))
print(data, "data")
if data.get('reconciled') == 'unreconciled': if data.get('reconciled') == 'unreconciled':
WHERE += ' AND l.full_reconcile_id is null AND' \ WHERE += ' AND l.full_reconcile_id is null AND' \
' l.balance != 0 AND a.reconcile is true' ' l.balance != 0 AND a.reconcile is true'

Loading…
Cancel
Save