diff options
| author | Fabien Pinckaers <fp@openerp.com> | 2012-10-21 21:59:25 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@openerp.com> | 2012-10-21 21:59:25 +0200 |
| commit | 6c15bcce12e29fd28af4e443d9e257e1235534b5 (patch) | |
| tree | a8d5ece4b3e30f7de6a7038248e29e5526c92022 /addons | |
| parent | c414eab31b9fea05909a6eee4d1ff15192faa7b9 (diff) | |
| parent | c25c19a4f476ce3ae161a1fada9a12ed56297451 (diff) | |
[MERGE] HR
bzr revid: fp@openerp.com-20121021195925-sbsfni9i10r2o2bw
Diffstat (limited to 'addons')
10 files changed, 16 insertions, 9 deletions
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 70db95425b1..342663e700f 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -160,7 +160,7 @@ <field name="name">account.analytic.line.tree</field> <field name="model">account.analytic.line</field> <field name="arch" type="xml"> - <tree editable="top" string="Analytic Entries"> + <tree string="Analytic Entries"> <field name="date"/> <field name="ref" invisible="context.get('to_invoice', False)"/> <field name="name"/> diff --git a/addons/hr_attendance/report/attendance_by_month.py b/addons/hr_attendance/report/attendance_by_month.py index 17cf548345e..fe6d09a6084 100644 --- a/addons/hr_attendance/report/attendance_by_month.py +++ b/addons/hr_attendance/report/attendance_by_month.py @@ -86,6 +86,8 @@ class report_custom(report_rml): for att in attendences: dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S') if ldt and att['action'] == 'sign_out': + if dt.date() > ldt.date(): + dt = ldt wh += (float((dt - ldt).seconds)/60/60) else: ldt = dt diff --git a/addons/hr_attendance/report/timesheet.py b/addons/hr_attendance/report/timesheet.py index 900f982dc74..326ffce63e0 100644 --- a/addons/hr_attendance/report/timesheet.py +++ b/addons/hr_attendance/report/timesheet.py @@ -38,7 +38,7 @@ class report_custom(report_rml): def create_xml(self, cr, uid, ids, datas, context=None): obj_emp = pooler.get_pool(cr.dbname).get('hr.employee') - + ids = datas['active_ids'] start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d') end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d') first_monday = start_date - relativedelta(days=start_date.date().weekday()) diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py index 9ee69a937d1..454ba7764da 100644 --- a/addons/hr_attendance/wizard/hr_attendance_byweek.py +++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py @@ -37,6 +37,7 @@ class hr_attendance_byweek(osv.osv_memory): def print_report(self, cr, uid, ids, context=None): datas = { 'ids': [], + 'active_ids': context['active_ids'], 'model': 'hr.employee', 'form': self.read(cr, uid, ids)[0] } diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py index e92e88bdcbd..031a17baee0 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py @@ -147,7 +147,7 @@ class hr_si_project(osv.osv_memory): 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'hr.sign.%s.project' % in_out, - 'views': [(False,'tree'), (resource_id,'form')], + 'views': [(resource_id,'form')], 'type': 'ir.actions.act_window', 'target': 'new' } diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index ab76f2b0f64..30e4ff40885 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -176,7 +176,7 @@ account_analytic_line() class hr_analytic_timesheet(osv.osv): _inherit = "hr.analytic.timesheet" - def on_change_account_id(self, cr, uid, ids, account_id): + def on_change_account_id(self, cr, uid, ids, account_id, user_id=False): res = {} if not account_id: return res diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml index b752ade8da0..95fa39a6eda 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml @@ -50,7 +50,7 @@ <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/> <field name="arch" type="xml"> <field name="account_id" position="replace"> - <field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/> + <field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/> </field> </field> </record> @@ -72,7 +72,7 @@ <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/> <field name="arch" type="xml"> <field name="account_id" position="replace"> - <field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/> + <field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/> </field> </field> </record> diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 96cb15ddce1..e62134ee38a 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -388,7 +388,7 @@ class hr_timesheet_line(osv.osv): return True def multi_on_change_account_id(self, cr, uid, ids, account_ids, context=None): - return dict([(el, self.on_change_account_id(cr, uid, ids, el)) for el in account_ids]) + return dict([(el, self.on_change_account_id(cr, uid, ids, el, context.get('user_id', uid))) for el in account_ids]) hr_timesheet_line() diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index b247805d50d..fc35a17377f 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -97,7 +97,7 @@ <field colspan="4" context="{'user_id':user_id}" name="timesheet_ids" nolabel="1"> <tree editable="top" string="Timesheet Lines"> <field name="date"/> - <field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/> + <field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/> <field name="name"/> <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/> <field name="to_invoice" widget="selection"/> @@ -110,7 +110,7 @@ </tree> <form string="Timesheet Lines" version="7.0"> <field name="date"/> - <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/> + <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/> <field name="name"/> <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/> <field name="to_invoice"/> diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py index 497fe8da117..cfd87d784ad 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/timesheet_report.py @@ -46,6 +46,7 @@ class timesheet_report(osv.osv): 'department_id':fields.many2one('hr.department','Department',readonly=True), 'date_from': fields.date('Date from',readonly=True,), 'date_to': fields.date('Date to',readonly=True), + 'date_current': fields.date('Current date', required=True), 'state' : fields.selection([ ('new', 'New'), ('draft','Draft'), @@ -64,6 +65,9 @@ class timesheet_report(osv.osv): htss.name, htss.date_from, htss.date_to, + to_char(htss.date_from, 'YYYY-MM-DD') as day, + to_char(htss.date_from, 'YYYY') as year, + to_char(htss.date_from, 'MM') as month, count(*) as nbr, aal.unit_amount as quantity, aal.amount as cost, |
