<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='effective_hours']" position="after">
- <field name="phase_id"/>
+ <field name="phase_id" context="{'default_project_id' : project_id}"/>
</xpath>
</field>
</record>
factor_id = data_obj.browse(cr, uid, data_id).res_id
res['value'].update({'to_invoice': factor_id})
return res
+
+ def getAnalyticJournal(self, cr, uid, context=None):
+ md = self.pool.get('ir.model.data')
+ try:
+ result = md.get_object_reference(cr, uid, 'hr_timesheet', 'analytic_journal')
+ return result[1]
+ except ValueError:
+ pass
+ return False
def open_timesheets(self, cr, uid, ids, context=None):
#Open the View for the Timesheet of the project
context = {}
if ids:
project = self.browse(cr, uid, ids[0], context=context)
- context = dict(context, search_default_account_id=project.analytic_account_id.id)
+ context = dict(context, search_default_account_id=project.analytic_account_id.id,default_account_id=project.analytic_account_id.id,default_journal_id=self.getAnalyticJournal(cr, uid, context))
return {
'name': _('Bill Tasks Works'),
'context': context,
<field name="inherit_id" ref="project.view_project_kanban"/>
<field name="arch" type="xml">
<field name="task" position="after">
- <field name="timesheets"/>
+ <field name="timesheets" context="{'search_default_account_id': project_id, 'default_account_id': project_id}"/>
<field name="total_timesheet"/>
<field name="currency_id"/>
</field>
<xpath expr="//tr[@id='deadline']" position="before">
<tr >
- <th align="left">To invoice</th>
+ <th align="left">Amount to invoice</th>
<td align="left">
<field name="amt_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/>
</td>
</tr>
<tr>
- <th align="left">To hours</th>
+ <th align="left">Hours to Invoice</th>
<td align="left">
<field name="hrs_to_invoice"/> h
</td>