- [[ repeatIn(lst(employee.id,data['form']['init_date'], data['form']['end_date'], data['form']['max_delay']), 'att') ]]
-
+ [[ repeatIn(lst(employee.id,data['form']['init_date'], data['form']['end_date'], data['form']['max_delay']), 'att') ]]
+
|
[[ att['action'] ]]
@@ -129,7 +125,7 @@
|
-
+
Total period:
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index 239b3cbeea8..f42dfb11761 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -2,7 +2,7 @@
-
+
@@ -10,39 +10,110 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
@@ -51,118 +122,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- [[ repeatIn(objects,'o') ]]
+ [[ repeatIn(objects,'o') ]]
+ HR Expenses [[ o.name or '' ]]
- HR Expenses [[ o.name or '' ]]
+ Employee: [[ o.employee_id.name ]]
+ Date: [[ time.strftime('%d/%m/%Y', time.strptime(o.date, '%Y-%m-%d')) ]]
+ Reference: [[ o.ref ]]
- Employee: [[ o.employee_id.name ]]
- Date: [[time.strftime('%d/%m/%Y', time.strptime(o.date, '%Y-%m-%d'))]]
- Reference: [[o.ref]]
-
-
-
-
+
|
- Date
+ Date
|
- Name
+ Name
|
- Reference
+ Ref.
|
- Unit price
+ Unit price
|
- Quantities
+ Qty
|
- Total
- |
-
-
- |
- [[ repeatIn(o.line_ids,'line') ]]
- [[ time.strftime('%d/%m/%Y', time.strptime(line.date_value, '%Y-%m-%d')) or '' ]]
- |
-
- [[ line.name or '']]
- [[ line.description or '']]
- |
-
- [[ line.ref or '']]
- |
-
- [[ '%.2f' % line.unit_amount or '']]
- |
-
- [[ '%.2f' % line.unit_quantity or '']]
- |
-
- [[ '%.2f' % line.total_amount or '' ]] [[company.currency_id.name ]]
+ Total
|
-
-
-
-
-
-
-
+
-
+ [[ repeatIn(o.line_ids,'line') ]]
+
+
+ |
+ [[ time.strftime('%d/%m/%Y', time.strptime(line.date_value, '%Y-%m-%d')) or '' ]]
+ |
+
+ [[ line.name or '' ]][[ line.description or '' ]]
+ |
+
+ [[ line.ref or '' ]]
+
+
+ |
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+ [[ '%.2f' % line.unit_amount or '' ]]
+ |
+
+ [[ '%.2f' % line.unit_quantity or '' ]]
+ |
+
+ [[ '%.2f' % line.total_amount or '' ]]
+ |
+
+ [[ company.currency_id.name ]]
+ |
+
+
+ |
+
+
+
+
+ |
+
|
- Total:
+ Total:
|
- [[ '%.2f' % o.amount ]] [[ company.currency_id.name ]]
+ [[ '%.2f' % o.amount ]]
+ |
+
+ [[ company.currency_id.name ]]
|
-
+
- [[ o.note or '' ]] [[ setTag('para','xpre') ]]
-
+ [[ o.note or '' ]][[ setTag('para','xpre') ]]
+
- Certified honest and conform,
- (Date and signature)
-
+ Certified honest and conform,
+ (Date and signature)
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This document must be dated and signed for reimbursment
+ This document must be dated and signed for reimbursment
-
diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py
index e450efc6890..c4b7158b05c 100644
--- a/addons/hr_holidays/report/holidays_summary_report.py
+++ b/addons/hr_holidays/report/holidays_summary_report.py
@@ -66,7 +66,7 @@ def emp_create_xml(self,cr,uid,dept,holiday_type,row_id,empid,name,som,eom):
return xml
class report_custom(report_rml):
- def create_xml(self, cr, uid, ids,data, context):
+ def create_xml(self, cr, uid, ids, data, context):
depts=[]
emp_id={}
done={}
@@ -86,7 +86,6 @@ class report_custom(report_rml):
som = strToDate(first_date)
eom = som+datetime.timedelta(59)
-
day_diff=eom-som
if data['form']['holiday_type']!='both':
diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
index f3be0f31da3..0fc27c8c1a1 100644
--- a/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
+++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.rml
@@ -1,236 +1,368 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-|
-[[ company.name ]]
- |
-
-Invoice rate by user
- |
-
-Period from [[ data['form']['date_from'] ]]
-to [[ data['form']['date_to'] ]]
-Currency: [[ company.currency_id.name ]]
- |
-
-
-
-
-
-
-
-|
-Employee
- |
-
-
-
-
- |
-
-Units
- |
-
-Theorical
- |
-
-Income
- |
-
-Cost
- |
-
-Profit
- |
-
-Eff.
- |
-
-
-
-
-
-
-[[ repeatIn(user_ids(lines(data['form'])), 'e') ]]
-[[ e.name ]]
-
-
-|
-[[ repeatIn(journal_ids(data['form'], e.id), 'j') ]]
-[[ j.name ]]
- |
-
-
-
-|
-
-
-
- |
-
-[[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0)]]
- |
-
-[[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]]
- |
-
-[[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]]
- |
-
-[[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]]
- |
-
-[[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0)]]
- |
-
-[[ '%d' % (-reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] %
-
- |
-
-
-|
-[[ repeatIn(line(data['form'], [j.id], [e.id]), 'l') ]]
-[[ l['name'] ]]
- |
-
-[[ l['unit_amount'] ]]
- |
-
-[[ l['amount_th'] ]]
- |
-
-[[ l['amount'] ]]
- |
-
-[[ l['cost'] ]]
- |
-
-[[ l['profit'] ]]
- |
-
-[[ l['eff'] ]] %
- |
-
-
- |
-
-
-
-
-
-|
-Totals
- |
-
-
-
-|
-
-
-
- |
-
-[[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
- |
-
-
-
-
- |
-
-[[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
- |
-
-[[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
- |
-
-[[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
- |
-
-[[ '%d' % (-reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* 100, )]] %
- |
-
-
- |
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+ Invoice rate by user
+ |
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+ |
+ Period from startdate
+ |
+
+ Period to enddate
+ |
+
+ Currency
+ |
+
+
+
+
+ |
+ [[ data['form']['date_from'] ]]
+ |
+
+ [[ data['form']['date_to'] ]]
+ |
+
+ [[ company.currency_id.name ]]
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+ Employee
+ |
+
+
+
+
+ |
+
+ Units
+ |
+
+ Theorical
+ |
+
+ Income
+ |
+
+ Cost
+ |
+
+ Profit
+ |
+
+ Eff.
+ |
+
+
+
+
+
+
+ [[ repeatIn(user_ids(lines(data['form'])), 'e') ]]
+
+
+ |
+ [[ e.name ]]
+ |
+
+
+
+ [[ repeatIn(journal_ids(data['form'], e.id), 'j') ]]
+ [[ j.name ]]
+
+
+ |
+
+
+
+ |
+
+ [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], [j.id], [e.id]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['amount_th'], line(data['form'], [j.id], [e.id]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['profit'], line(data['form'], [j.id], [e.id]), 0) ]]
+ |
+
+ [[ '%d' % (reduce(lambda x, y: x+y['amount'], line(data['form'], [j.id], [e.id]), 0) / reduce(lambda x, y: x+y['cost'], line(data['form'], [j.id], [e.id]), 0) * 100.0,)]] %
+ |
+
+
+ |
+ [[ repeatIn(line(data['form'], [j.id], [e.id]), 'l') ]]
+ [[ l['name'] ]]
+ |
+
+ [[ l['unit_amount'] ]]
+ |
+
+ [[ l['amount_th'] ]]
+ |
+
+ [[ l['amount'] ]]
+ |
+
+ [[ l['cost'] ]]
+ |
+
+ [[ l['profit'] ]]
+ |
+
+ [[ l['eff'] ]] %
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ |
+ Totals
+ |
+
+
+
+ |
+
+
+
+ |
+
+ [[ reduce(lambda x, y: x+y['unit_amount'], line(data['form'], data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
+ |
+
+
+
+
+ |
+
+ [[ reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
+ |
+
+ [[ reduce(lambda x, y: x+y['profit'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0) ]]
+ |
+
+ [[ round(reduce(lambda x, y: x+y['amount'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)/reduce(lambda x, y: x+y['cost'], line(data['form'],data['form']['journal_ids'][0][2], data['form']['employee_ids'][0][2]), 0)* -100, 2)]] %
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
-
diff --git a/addons/project/project.py b/addons/project/project.py
index a18036843bd..7ddca9ec22b 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -132,7 +132,7 @@ class project(osv.osv):
'warn_footer': fields.text('Mail footer'),
'notes': fields.text('Notes'),
'timesheet_id': fields.many2one('hr.timesheet.group', 'Working Time'),
- 'state': fields.selection([('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', required=True),
+ 'state': fields.selection([('template', 'Template'), ('open', 'Open'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', required=True),
}
_defaults = {
@@ -149,21 +149,37 @@ class project(osv.osv):
]
# toggle activity of projects, their sub projects and their tasks
- def toggleActive(self, cr, uid, ids, context={}):
- for proj in self.browse(cr, uid, ids, context):
- self.setActive(cr, uid, proj.id, not proj.active, context)
+ def settemplate(self, cr, uid, ids, context={}):
+ res = self.setActive(cr, uid, ids, value=False, context=context)
+ return res
+
+ def resetproject(self, cr, uid, ids, context={}):
+ res = self.setActive(cr, uid, ids,value=True, context=context)
+ return res
+
+ def duplicatetemplate(self, cr, uid, ids, context={}):
+ proj = self.browse(cr, uid, ids[0], context)
+ self.pool.get('project.project').copy(cr, uid, ids[0],default={'state':'template'}, context=context)
+ cr.execute('select id from project_task where project_id=%d', (proj.id,))
+ res = cr.fetchall()
+ tasks_ids = [x[0] for x in res]
+ if tasks_ids:
+ for i in tasks_ids:
+ self.pool.get('project.task').copy(cr, uid, i,default={'active':False}, context=context)
+ project_ids = [x[0] for x in res]
return True
# set active value for a project, its sub projects and its tasks
- def setActive(self, cr, uid, id, value, context={}):
- proj = self.browse(cr, uid, id, context)
- self.write(cr, uid, [id], {'active': value}, context)
- cr.execute('select id from project_task where project_id=%d', (proj.id,))
- tasks_id = [x[0] for x in cr.fetchall()]
- self.pool.get('project.task').write(cr, uid, tasks_id, {'active': value}, context)
- project_ids = [x[0] for x in cr.fetchall()]
- for child in project_ids:
- self.setActive(cr, uid, child, value, context)
+ def setActive(self, cr, uid, ids, value=True, context={}):
+
+ for proj in self.browse(cr, uid, ids, context):
+ self.write(cr, uid, [proj.id], {'state': value and 'open' or 'template'}, context)
+ cr.execute('select id from project_task where project_id=%d', (proj.id,))
+ res = cr.fetchall()
+ tasks_id = [x[0] for x in res]
+ if tasks_id:
+ self.pool.get('project.task').write(cr, uid, tasks_id, {'active': value}, context)
+ project_ids = [x[0] for x in res]
return True
project()
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 5383e5e4873..95cc72d9bb4 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -22,18 +22,20 @@
-
-
-
-
-
+
+
+
+
+
+
+
@@ -115,8 +117,7 @@
[('parent_id','=',False),('state','=','open')]
-
-
+
Open projects
@@ -127,6 +128,15 @@
+
+ Template projects
+ project.project
+ form
+ [('state','=','template')]
+
+
+
+
project.task.work.form
@@ -467,6 +477,8 @@
view_mode="tree,form,calendar,graph"
view_type="form"/>
+
+
res.company.task.config
res.company
| |