[IMP] sale_timesheet: profitability report

In the Project Overview, the Profitability report takes into account
Timesheet costs, but doesn't include information on Revenue.
Because of that, the user is missing crucial information to determine
the profitability of a given project.

This commit aims at fixing this issue by sending the user to the
'Project Costs and Revenues' report of the concerned project when
clicking the 'Profitability' button within the Project Overview page.

Task-1963932

closes odoo/odoo#32554

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
This commit is contained in:
Geoffroy Larue
2019-04-15 09:32:11 +00:00
parent 637f19e621
commit 7f0d904d3a
2 changed files with 2 additions and 1 deletions
@@ -35,6 +35,7 @@ class Project(models.Model):
'projects': self,
'currency': currency,
'timesheet_domain': [('project_id', 'in', self.ids)],
'profitability_domain': [('project_id', 'in', self.ids)],
'stat_buttons': self._plan_get_stat_button(),
}
@@ -66,7 +66,7 @@
</td>
<td>Timesheets</td>
<th rowspan="6">
<a type="action" data-model="account.analytic.line" t-att-data-domain="json.dumps(timesheet_domain)" data-context='{"pivot_row_groupby": ["timesheet_invoice_id"], "pivot_column_groupby": ["date:month"],"pivot_measures": ["amount"]}' data-views='[[0, "pivot"], [0, "list"]]' tabindex="-1">Profitability</a>
<a type="action" data-model="project.profitability.report" t-att-data-domain="json.dumps(profitability_domain)" data-context="{'group_by_no_leaf':1, 'group_by':[], 'sale_show_order_product_name': 1}" data-views='[[0, "pivot"], [0, "graph"]]' tabindex="-1">Profitability</a>
</th>
<td class="o_timesheet_plan_dashboard_cell">
<t t-esc="dashboard['profit']['invoiced']" t-options='{"widget": "monetary", "display_currency": currency}'/>