Skip to content

Commit

Permalink
[FIX] account_withholding: accounting dashboard
Browse files Browse the repository at this point in the history
closes #342

Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
  • Loading branch information
jjscarafia committed Jan 3, 2023
1 parent d990940 commit b3a9d38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions account_withholding/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
from . import account_chart_template
from . import account_journal
from . import account_payment_method
from . import account_journal_dashboard
15 changes: 15 additions & 0 deletions account_withholding/models/account_journal_dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import models


class AccountJournal(models.Model):
_inherit = 'account.journal'

def get_journal_dashboard_datas(self):
# en diarios de retenciones no hacemos obligatorio default_account_id
# pero luego la query de super da error, si no tiene este dato suponemos que es de
# retenciones y no devolvemos nada (ademas de que la info no tendría mucho sentido)
# chequeamos default_account_id y no los pay methods codes porque es más eficiente
if self.type in ('bank', 'cash') and not self.default_account_id:
return {}
else:
return super().get_journal_dashboard_datas()

0 comments on commit b3a9d38

Please sign in to comment.