diff --git a/addons/account_analytic_default/account_analytic_default_view.xml b/addons/account_analytic_default/account_analytic_default_view.xml index 1dbfa87d853..e63c12bf04f 100644 --- a/addons/account_analytic_default/account_analytic_default_view.xml +++ b/addons/account_analytic_default/account_analytic_default_view.xml @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@ form
- + @@ -42,9 +42,9 @@ form tree,form - account.analytic.default - - + + @@ -236,10 +236,10 @@ account.analytic.default.tree.plans tree account.analytic.default - + - - + + diff --git a/addons/hr/hr_wizard.xml b/addons/hr/hr_wizard.xml index 74a047ffb5c..71dcb201381 100644 --- a/addons/hr/hr_wizard.xml +++ b/addons/hr/hr_wizard.xml @@ -6,9 +6,9 @@ - + diff --git a/addons/hr/report/attendance_errors.rml b/addons/hr/report/attendance_errors.rml index 30199ce2f14..a2d9ebe3625 100644 --- a/addons/hr/report/attendance_errors.rml +++ b/addons/hr/report/attendance_errors.rml @@ -52,11 +52,7 @@ - - - - - + @@ -106,8 +102,8 @@ - [[ 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..5f7ba9c0930 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,42 @@ 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 set_template(self, cr, uid, ids, context={}): + res = self.setActive(cr, uid, ids, value=False, context=context) + return res + + def reset_project(self, cr, uid, ids, context={}): + res = self.setActive(cr, uid, ids,value=True, context=context) + return res + + def duplicate_template(self, cr, uid, ids,context={}): + for proj in self.browse(cr, uid, ids): + parent_id=context.get('parent_id',False) + new_id=self.pool.get('project.project').copy(cr, uid, proj.id,default={'name':proj.name+'(copy)','state':'template','parent_id':parent_id}) + cr.execute('select id from project_task where project_id=%d', (proj.id,)) + res = cr.fetchall() + tasks_ids = [x[0] for x in res] + for tasks_id in tasks_ids: + self.pool.get('project.task').copy(cr, uid, tasks_id,default={'project_id':new_id,'active':False}, context=context) + cr.execute('select id from project_project where parent_id=%d', (proj.id,)) + res = cr.fetchall() + project_ids = [x[0] for x in res] + for child in project_ids: + self.duplicate_template(cr, uid, [child],context={'parent_id':new_id}) 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,)) + tasks_id = [x[0] for x in cr.fetchall()] + if tasks_id: + self.pool.get('project.task').write(cr, uid, tasks_id, {'active': value}, context) + cr.execute('select id from project_project where parent_id=%d', (proj.id,)) + project_ids = [x[0] for x in cr.fetchall()] + for child in project_ids: + self.setActive(cr, uid, [child], value, context) return True project() diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 5383e5e4873..fad26416d78 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -22,18 +22,20 @@ - - -