-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] account_withholding: accounting dashboard
closes #342 Signed-off-by: Juan José Scarafía <jjs@adhoc.com.ar>
- Loading branch information
1 parent
d990940
commit b3a9d38
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |