Skip to content
Permalink
Browse files

fixup [MOV] sale_project_timesheet: extract reinvoicing timesheet fro…

…m pro
  • Loading branch information...
jem-odoo committed Mar 20, 2019
1 parent 85839aa commit 0d2458d9c6941a4c9dc846316029f82a96c0a9b3
@@ -91,7 +91,7 @@ def action_view_timesheet(self):

@api.multi
def action_view_timesheet_plan(self):
action = self.env.ref('sale_timesheet.project_timesheet_action_client_timesheet_plan').read()[0]
action = self.env.ref('sale_project_timesheet.project_timesheet_action_client_timesheet_plan').read()[0]
action['params'] = {
'project_ids': self.ids,
}
@@ -43,6 +43,12 @@ def _compute_project_ids(self):
projects |= order.project_id
order.project_ids = projects

@api.onchange('project_id')
def _onchange_project_id(self):
""" Set the SO analytic account to the selected project's analytic account """
if self.project_id.analytic_account_id:
self.analytic_account_id = self.project_id.analytic_account_id

@api.multi
def _action_confirm(self):
""" On SO confirmation, some lines should generate a task or a project. """
@@ -3,7 +3,7 @@

<template id="assets_backend" name="sale timesheet assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/scss" href="/sale_timesheet/static/src/scss/sale_timesheet.scss"/>
<link rel="stylesheet" type="text/scss" href="/sale_project_timesheet/static/src/scss/sale_timesheet.scss"/>
</xpath>
</template>

@@ -205,19 +205,19 @@
<div t-if="repartition_employee_max" class="progress" t-attf-style="width: {{employee['total'] / repartition_employee_max * 100}}%">

<t t-set="total" t-value="employee['total'] or 1.0" />
<t t-call="sale_timesheet.progressbar">
<t t-call="sale_project_timesheet.progressbar">
<t t-set="label">Billable fixed</t>
<t t-set="key">billable_fixed</t>
</t>
<t t-call="sale_timesheet.progressbar">
<t t-call="sale_project_timesheet.progressbar">
<t t-set="label">Billable time</t>
<t t-set="key">billable_time</t>
</t>
<t t-call="sale_timesheet.progressbar">
<t t-call="sale_project_timesheet.progressbar">
<t t-set="label">No task found</t>
<t t-set="key">non_billable_project</t>
</t>
<t t-call="sale_timesheet.progressbar">
<t t-call="sale_project_timesheet.progressbar">
<t t-set="label">Non billable</t>
<t t-set="key">non_billable</t>
</t>
@@ -49,7 +49,7 @@
<field name="is_default" eval="True"/>
<field name="context">{
'col_group_by': ['date:month', 'timesheet_invoice_type'],
'group_by': ['project_id', 'employee_id'],
'group_by': ['account_id', 'employee_id'],
'measures': ['amount_currency', 'unit_amount', '__count']
}</field>
<field name="action_id" ref="timesheet_action_billing_report"/>

0 comments on commit 0d2458d

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