line_ids = account_analytic_line.search(cr, uid, [('account_id', '=', project.analytic_account_id.id), ('to_invoice','=',1), ('invoice_id','=',False)])
lines = account_analytic_line.browse(cr, uid, line_ids, context)
res[project.id] = {
- 'amt_to_invoice': sum(line.amount for line in lines),
- 'hrs_to_invoice': sum(line.unit_amount for line in lines),
+ 'amount_to_invoice': sum(line.amount for line in lines),
+ 'time_to_invoice': sum(line.unit_amount for line in lines),
}
return res
_columns = {
'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"),
- 'amt_to_invoice': fields.function(_to_invoice, string="Amount to Invoice", multi="sums"),
- 'hrs_to_invoice': fields.function(_to_invoice, string="Time to Invoice", multi="sums"),
+ 'amount_to_invoice': fields.function(_to_invoice, string="Amount to Invoice", multi="sums"),
+ 'time_to_invoice': fields.function(_to_invoice, string="Time to Invoice", multi="sums"),
'timesheet_count': fields.function(_timesheet_count, type='integer', string="Issue"),
}
_defaults = {
<field name="arch" type="xml">
<field name="use_tasks" position='after'>
<field name="use_timesheets"/>
- <field name="amt_to_invoice" invisible="True"/>
- <field name="hrs_to_invoice" invisible="True"/>
+ <field name="amount_to_invoice" invisible="True"/>
+ <field name="time_to_invoice" invisible="True"/>
</field>
<field name="warn_customer" position="after">
<group colspan="4" col="4">
<tr>
<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]"/>
+ <field name="amount_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/>
</td>
</tr>
<tr>
<th align="left">Time to Invoice</th>
<td align="left">
- <field name="hrs_to_invoice"/> <field name="company_uom_id"/>
+ <field name="time_to_invoice"/> <field name="company_uom_id"/>
</td>
</tr>
</t>