- In Odoo, contracts and projects are implemented using
- analytic account. So, you can track costs and revenues to analyse
- your margins easily.
-
- Costs will be created automatically when you register supplier
- invoices, expenses or timesheets.
-
- Revenues will be created automatically when you create customer
- invoices. Customer invoices can be created based on sale orders
- (fixed price invoices), on timesheets (based on the work done) or
- on expenses (e.g. reinvoicing of travel costs).
-
-
-
-
Timesheet Accountsir.actions.act_windowaccount.analytic.accountformtree,form
- [('invoice_on_timesheets','=', True)]
- {'default_invoice_on_timesheets':1}
-
- hr.timesheet.employee.extd_form
- hr.employee
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/hr_timesheet/report/hr_timesheet_report.py b/addons/hr_timesheet/report/hr_timesheet_report.py
index 213ed776c3c..0644cc16d61 100644
--- a/addons/hr_timesheet/report/hr_timesheet_report.py
+++ b/addons/hr_timesheet/report/hr_timesheet_report.py
@@ -11,8 +11,6 @@ class hr_timesheet_report(models.Model):
date = fields.Date('Date', readonly=True)
name = fields.Char('Description', readonly=True)
product_id = fields.Many2one('product.product', 'Product', readonly=True)
- journal_id = fields.Many2one('account.analytic.journal', 'Journal', readonly=True)
- general_account_id = fields.Many2one('account.account', 'General Account', readonly=True)
user_id = fields.Many2one('res.users', 'User', readonly=True)
account_id = fields.Many2one('account.analytic.account', 'Analytic Account', readonly=True)
company_id = fields.Many2one('res.company', 'Company', readonly=True)
@@ -26,9 +24,7 @@ class hr_timesheet_report(models.Model):
sum(aal.amount) as cost,
sum(aal.unit_amount) as quantity,
aal.account_id as account_id,
- aal.journal_id as journal_id,
aal.product_id as product_id,
- aal.general_account_id as general_account_id,
aal.user_id as user_id,
aal.company_id as company_id,
aal.currency_id as currency_id
@@ -46,8 +42,6 @@ class hr_timesheet_report(models.Model):
GROUP BY aal.date,
aal.account_id,
aal.product_id,
- aal.general_account_id,
- aal.journal_id,
aal.user_id,
aal.company_id,
aal.currency_id
diff --git a/addons/hr_timesheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet/report/hr_timesheet_report_view.xml
index 30584e848e4..3769e89255c 100644
--- a/addons/hr_timesheet/report/hr_timesheet_report_view.xml
+++ b/addons/hr_timesheet/report/hr_timesheet_report_view.xml
@@ -35,9 +35,7 @@
-
-
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index f51d12df530..692ecbe0a7f 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -1,10 +1,8 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_account_analytic_line,account.account.analytic.line,account.model_account_analytic_line,base.group_hr_user,1,1,1,1
access_hr_account_analytic_line_employee,account.account.analytic.line employee,account.model_account_analytic_line,base.group_user,1,1,1,1
-access_account_analytic_journal,account.account.analytic.journal,analytic.model_account_analytic_journal,base.group_hr_user,1,1,1,1
access_product_product_user,product.product user,product.model_product_product,base.group_hr_user,1,1,1,1
access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,base.group_hr_user,1,1,1,1
access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,base.group_hr_user,1,1,1,1
access_account_analytic_line_user,account.analytic.line.user,model_account_analytic_line,base.group_user,1,1,1,0
-access_account_analytic_journal_user,account.account.analytic.journal.user,analytic.model_account_analytic_journal,base.group_user,1,0,0,0
access_hr_timesheet_report,hr.timesheet.report,model_hr_timesheet_report,base.group_hr_manager,1,1,0,0
diff --git a/addons/hr_timesheet_sheet/__openerp__.py b/addons/hr_timesheet_sheet/__openerp__.py
index d09c1db1812..678a44960e9 100644
--- a/addons/hr_timesheet_sheet/__openerp__.py
+++ b/addons/hr_timesheet_sheet/__openerp__.py
@@ -26,7 +26,7 @@ The validation can be configured in the company:
* Maximal difference between timesheet and attendances
""",
'website': 'https://www.odoo.com/page/employees',
- 'depends': ['hr_timesheet', 'hr_timesheet_invoice'],
+ 'depends': ['hr_timesheet'],
'data': [
'security/ir.model.access.csv',
'security/hr_timesheet_sheet_security.xml',
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 30c09356495..d98f29f251e 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -52,8 +52,6 @@ class hr_timesheet_sheet(osv.osv):
if 'employee_id' in vals:
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).user_id:
raise UserError(_('In order to create a timesheet for this employee, you must link him/her to a user.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).journal_id:
- raise UserError(_('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
if vals.get('attendances_ids'):
# If attendances, we sort them by date asc before writing them, to satisfy the alternance constraint
vals['attendances_ids'] = self.sort_attendances(cr, uid, vals['attendances_ids'], context=context)
@@ -68,8 +66,6 @@ class hr_timesheet_sheet(osv.osv):
raise UserError(_('You cannot have 2 timesheets that overlap!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).product_id:
raise UserError(_('In order to create a timesheet for this employee, you must link the employee to a product.'))
- if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id'], context=context).journal_id:
- raise UserError(_('In order to create a timesheet for this employee, you must assign an analytic journal to the employee, like \'Timesheet Journal\'.'))
if vals.get('attendances_ids'):
# If attendances, we sort them by date asc before writing them, to satisfy the alternance constraint
# In addition to the date order, deleting attendances are done before inserting attendances
@@ -587,11 +583,10 @@ class hr_timesheet_sheet_sheet_account(osv.osv):
'name': fields.many2one('account.analytic.account', 'Project / Analytic Account', readonly=True),
'sheet_id': fields.many2one('hr_timesheet_sheet.sheet', 'Sheet', readonly=True),
'total': fields.float('Total Time', digits=(16,2), readonly=True),
- 'invoice_rate': fields.many2one('hr_timesheet_invoice.factor', 'Invoice rate', readonly=True),
}
_depends = {
- 'account.analytic.line': ['account_id', 'date', 'to_invoice', 'unit_amount', 'user_id'],
+ 'account.analytic.line': ['account_id', 'date', 'unit_amount', 'user_id'],
'hr_timesheet_sheet.sheet': ['date_from', 'date_to', 'user_id'],
}
@@ -601,15 +596,14 @@ class hr_timesheet_sheet_sheet_account(osv.osv):
min(l.id) as id,
l.account_id as name,
s.id as sheet_id,
- sum(l.unit_amount) as total,
- l.to_invoice as invoice_rate
+ sum(l.unit_amount) as total
from
account_analytic_line l
LEFT JOIN hr_timesheet_sheet_sheet s
ON (s.date_to >= l.date
AND s.date_from <= l.date
AND s.user_id = l.user_id)
- group by l.account_id, s.id, l.to_invoice
+ group by l.account_id, s.id
)""")
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 7f7d8b729bd..9bf04bc2560 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -11,7 +11,6 @@
-
@@ -22,7 +21,6 @@
-
@@ -35,7 +33,6 @@
-
@@ -130,27 +127,17 @@
-
+
-
-
-
-
-
-
-
+