HR_TIMESHEET_SHEET: add invoice rate to report by account

bzr revid: ced-dd39a06610b8080dab88b517bbdfdcf0e052eb88
This commit is contained in:
ced 2007-04-17 10:16:29 +00:00
parent 551a4b78f1
commit 8e5c782a06
2 changed files with 6 additions and 2 deletions

View File

@ -433,6 +433,7 @@ class hr_timesheet_sheet_sheet_account(osv.osv):
'name': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'sheet_id': fields.many2one('hr_timesheet_sheet.sheet', 'Sheet', readonly=True, relate=True),
'total': fields.float('Total Time', digits=(16,2), readonly=True),
'invoice_rate': fields.many2one('hr_timesheet_invoice.factor', 'Invoice rate', readonly=True),
}
def init(self, cr):
cr.execute("""create or replace view hr_timesheet_sheet_sheet_account as (
@ -440,11 +441,12 @@ class hr_timesheet_sheet_sheet_account(osv.osv):
min(hrt.id) as id,
l.account_id as name,
hrt.sheet_id as sheet_id,
sum(l.unit_amount) as total
sum(l.unit_amount) as total,
l.to_invoice as invoice_rate
from
hr_analytic_timesheet hrt
left join account_analytic_line l on (l.id = hrt.line_id)
group by l.account_id, hrt.sheet_id
group by l.account_id, hrt.sheet_id, l.to_invoice
)""")
hr_timesheet_sheet_sheet_account()

View File

@ -29,6 +29,7 @@
<field name="sheet_id"/>
<field name="name"/>
<field name="total"/>
<field name="invoice_rate"/>
</tree>
</field>
</record>
@ -107,6 +108,7 @@
<tree string="Analytic accounts">
<field name="name"/>
<field name="total" widget="float_time"/>
<field name="invoice_rate"/>
</tree>
</field>
</page>