Skip to content
Permalink
Browse files

[IMP] account: add the period of the tax periodicity on the dashboard

Task 2076244
Commit 4a1bbbf added that but it had to be reverted because it didn't
take into account the periodicity of the tax return of the company and
because it added the period for all mail.activity
  • Loading branch information...
william-andre committed Oct 8, 2019
1 parent badb95f commit 01f7b841765d04420f77bd40c810e80575b8048a
Showing with 9 additions and 2 deletions.
  1. +9 −2 addons/account/models/account_journal_dashboard.py
@@ -50,15 +50,22 @@ def _get_json_activity_data(self):
'''
self.env.cr.execute(sql_query, (journal.id,))
for activity in self.env.cr.dictfetchall():
activities.append({
act = {
'id': activity.get('id'),
'res_id': activity.get('res_id'),
'res_model': activity.get('res_model'),
'status': activity.get('status'),
'name': (activity.get('summary') or activity.get('act_type_name')),
'activity_category': activity.get('activity_category'),
'date': odoo_format_date(self.env, activity.get('date_deadline'))
})
}
print(act)
if activity.get('activity_category') == 'tax_report' and activity.get('res_model') == 'account.move':
if self.env['account.move'].browse(activity.get('res_id')).company_id.account_tax_periodicity == 'monthly':
act['name'] += ' (' + format_date(activity.get('date'), 'MMM', locale=get_lang(self.env).code) + ')'
else:
act['name'] += ' (' + format_date(activity.get('date'), 'QQQ', locale=get_lang(self.env).code) + ')'
activities.append(act)
journal.json_activity_data = json.dumps({'activities': activities})

kanban_dashboard = fields.Text(compute='_kanban_dashboard')

0 comments on commit 01f7b84

Please sign in to comment.
You can’t perform that action at this time.