From 8cda7998ed8dc4e2a07fefbf9a634b004ed13777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Tue, 11 Apr 2017 15:53:36 +0200 Subject: [PATCH 1/7] [IMP] resource: add 35 and 38h/week working hours calendars This commit proposes to add 35 and 38 hours/week resource calendars. Those are considered as standard for a lot of countries. This helps users starting with odoo time tracking. --- addons/resource/data/resource_data.xml | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/addons/resource/data/resource_data.xml b/addons/resource/data/resource_data.xml index 08281205c56..81ccf1c1496 100644 --- a/addons/resource/data/resource_data.xml +++ b/addons/resource/data/resource_data.xml @@ -13,4 +13,44 @@ model="res.company" name="_init_data_resource_calendar" eval="[]"/> + + + + Standard 35 Hours/Week + + + + + + Standard 38 Hours/Week + + + + From aab2dc14313ea7e653cfcbef66dad55bd79ade83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Mon, 16 Jan 2017 17:29:47 +0100 Subject: [PATCH 2/7] [IMP] hr_timesheet: add name on res.config views to hook other views --- addons/hr_timesheet/hr_timesheet_config_settings_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml index 5024f6f0aef..98f88b484b3 100644 --- a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml +++ b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml @@ -47,7 +47,7 @@

Billing

-
+
From b6beff86b7e01cff1c63caea7a36bdfa67c50b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Wed, 18 Jan 2017 15:00:32 +0100 Subject: [PATCH 3/7] [IMP] project: remove doc count on project kanban view and optimize task count This commit removes document count on project kanban view. Indeed it does not add much valuable information and bloats the kanban cards. In order to keep the kanban card order, it was required to adapt all inherited views. The order is 'task', 'issue', 'rating', 'timesheet' and 'forecast'. It also uses a read_group to better compute task count, by the way. --- addons/hr_timesheet/project_timesheet_view.xml | 2 +- addons/project/models/project.py | 4 +++- addons/project/views/project_views.xml | 7 ------- addons/project_issue/views/project_project_views.xml | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/hr_timesheet/project_timesheet_view.xml b/addons/hr_timesheet/project_timesheet_view.xml index b0f6c3ecdc0..b7f1b87bab4 100644 --- a/addons/hr_timesheet/project_timesheet_view.xml +++ b/addons/hr_timesheet/project_timesheet_view.xml @@ -153,7 +153,7 @@ Timesheets
- + -
diff --git a/addons/project_issue/views/project_project_views.xml b/addons/project_issue/views/project_project_views.xml index b5169400bb3..4ea10a378c4 100644 --- a/addons/project_issue/views/project_project_views.xml +++ b/addons/project_issue/views/project_project_views.xml @@ -32,7 +32,7 @@ Issues
- +
From a806f96fa26728f85e169516af6808e9156bcff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Mon, 23 Jan 2017 10:02:07 +0100 Subject: [PATCH 4/7] [IMP] hr_timesheet: ease time tracking use of timesheets Purpose of timesheet module is to track user time. This commit applies various improvements and tweaking to better reflect this purpose. This commit provides some UI improvements * improve views : user_id field is not displayed on 'My Timesheet' action, since it will always be the same user; * simplify menus : 'My timesheet' only for current user's timesheets and 'All timesheet' for everyone's. The latter one allows creating timesheets for someone else, if you have the required access rights; * add calendar views for timesheets * some filters are added to ease time-based filtering of timesheets This commit also reorganizes user groups. Groups are now * new 'timesheet user' group (different from base.group_employee). Users can record their own timesheet. New access rights were added to perform the same operations as before. * 'timesheet manager' (hr_timesheet.group_manager). Users can record timesheets for other users, access to settings and reporting tools. --- .../hr_timesheet_config_settings_views.xml | 2 +- addons/hr_timesheet/hr_timesheet_view.xml | 181 +++++++++++++++--- .../report/hr_timesheet_report_view.xml | 11 +- .../security/hr_timesheet_security.xml | 61 +++++- .../hr_timesheet/security/ir.model.access.csv | 12 +- 5 files changed, 220 insertions(+), 47 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml index 98f88b484b3..0553cbfddca 100644 --- a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml +++ b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml @@ -1,7 +1,7 @@ + groups="group_timesheet_manager" sequence="100"/> hr.timesheet.config.settings.view.form diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index ba1b9c54e4e..95f3d8617d0 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -1,23 +1,47 @@ - - + + + + account.analytic.line.tree.hr_timesheet account.analytic.line - + - - + + + + account.analytic.line.view.tree.with.user + account.analytic.line + + primary + 10 + + + + + + + account.analytic.line.pivot account.analytic.line @@ -29,18 +53,58 @@ + - account.analytic.line.form.inherit.hr_timesheet + account.analytic.line.form account.analytic.line - - primary + 1 + - - - - +
+ + + + + + + + + + + + + + + + +
+ + + account.analytic.line.tree.with.user + account.analytic.line + + primary + 10 + + + + + + + + + account.analytic.line.calendar + account.analytic.line + + + + + + + + account.analytic.line.search account.analytic.line @@ -51,23 +115,39 @@ - + + + + - - - - - + + + + + - Activities + My Timesheets account.analytic.line - [('project_id', '!=', False)] - {"search_default_today":1} + tree,form + [('project_id', '!=', False), ('user_id', '=', uid)] + {"search_default_week":1}

@@ -80,22 +160,65 @@ - + tree - 1 - + + - + form - 2 - + + - + + + calendar + + + + + + + + All Timesheets + account.analytic.line + + [('project_id', '!=', False)] + {'search_default_week':1, 'search_default_groupby_user':1} + + + + + tree + + + + + + + form + + + + + + + calendar + + + + + diff --git a/addons/hr_timesheet/report/hr_timesheet_report_view.xml b/addons/hr_timesheet/report/hr_timesheet_report_view.xml index 1764a44cc8c..66e20b6bfcd 100644 --- a/addons/hr_timesheet/report/hr_timesheet_report_view.xml +++ b/addons/hr_timesheet/report/hr_timesheet_report_view.xml @@ -38,10 +38,15 @@ + - - diff --git a/addons/hr_timesheet/security/hr_timesheet_security.xml b/addons/hr_timesheet/security/hr_timesheet_security.xml index 1a95247cf0b..23d20ea4fd4 100644 --- a/addons/hr_timesheet/security/hr_timesheet_security.xml +++ b/addons/hr_timesheet/security/hr_timesheet_security.xml @@ -1,13 +1,56 @@ - - Officer - - - - - - - + + + + User + + + + + + + Manager + + + + + + + + + + + + + + + account.analytic.line.timesheet.user + + [('user_id', '=', user.id), ('project_id', '!=', False)] + + + + + + + + + + + + + account.analytic.line.timesheet.manager + + [('project_id', '!=', False)] + + + + + + + + + \ No newline at end of file diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv index 61f85fb401e..e9f8ce09b30 100644 --- a/addons/hr_timesheet/security/ir.model.access.csv +++ b/addons/hr_timesheet/security/ir.model.access.csv @@ -1,6 +1,8 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_hr_account_analytic_line,analytic.account.analytic.line,analytic.model_account_analytic_line,hr_timesheet.group_hr_timesheet_user,1,1,1,1 -access_hr_account_analytic_line_employee,analytic.account.analytic.line employee,analytic.model_account_analytic_line,base.group_user,1,1,1,1 -access_product_product_user,product.product user,product.model_product_product,hr_timesheet.group_hr_timesheet_user,1,1,1,1 -access_product_template_hr_timesheet,product.template.hr.timesheet,product.model_product_template,hr_timesheet.group_hr_timesheet_user,1,1,1,1 -access_product_uom_hr_timesheet,product.uom.hr.timesheet,product.model_product_uom,hr_timesheet.group_hr_timesheet_user,1,1,1,1 +access_account_analytic_line_user,analytic.account.analytic.line.timesheet.user,analytic.model_account_analytic_line,hr_timesheet.group_hr_timesheet_user,1,1,1,1 +access_account_analytic_user,analytic.account.analytic.timesheet.user,analytic.model_account_analytic_account,hr_timesheet.group_hr_timesheet_user,1,1,0,0 +access_product_product_user,product.product.timesheet.user,product.model_product_product,hr_timesheet.group_hr_timesheet_user,1,1,1,0 +access_product_template_timesheet_user,product.template.timesheet.user,product.model_product_template,hr_timesheet.group_hr_timesheet_user,1,1,1,0 +access_product_uom_hr_timesheet,product.uom.timesheet.user,product.model_product_uom,hr_timesheet.group_hr_timesheet_user,1,0,0,0 +access_project_project,project.project.timesheet.user,model_project_project,hr_timesheet.group_hr_timesheet_user,1,0,0,0 +access_project_task,project.task.timesheet.user,model_project_task,hr_timesheet.group_hr_timesheet_user,1,1,0,0 \ No newline at end of file From 5f997fc2ef8e3111ec6b0622dee8286e6de3b21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Wed, 15 Mar 2017 16:31:00 +0100 Subject: [PATCH 5/7] [IMP] hr_timesheet, sale_timesheet: log timesheet on employee This commits mainly switches the semantic of timesheeting from users to employees. Main points of this commit are : * add an employee_id field on timesheet; * replace user_id field by employee_id on timesheet views; * provide a stat button on employee form view to access its timesheets; * use timesheet cost as a real monetary field and handle currency conversion; The purpose is to allow timesheet manager to record timesheet for employees that are not users. All employees do not necessarily have an user account in the system. Now you can record timesheet for your employee. Hooray ! In sale_timesheet timesheet_cost is now a monetary field. Currency convertion is also better taken into account when computing UPDATE ME Timesheet details * add an invisible timesheet group on employee form view allowing to hook on it. Indeed sale_timesheet and timesheet_grid modules override this view to add information but have no other common module that hr_timesheet. Using an invisible group set as visible in those modules eases inheritance. Sale timesheet details * timesheet_cost is now a monetary field * better display of timesheet_cost on employee form view, notably telling it is per hour * remove account_id field on employee as its only use was buggy and was mixing account.account and analytic.account records. --- addons/hr_timesheet/__manifest__.py | 1 + addons/hr_timesheet/hr_timesheet.py | 24 ++++++++++--- addons/hr_timesheet/hr_timesheet_view.xml | 16 +++++---- .../hr_timesheet/project_timesheet_view.xml | 3 +- addons/hr_timesheet/views/hr_views.xml | 36 +++++++++++++++++++ addons/sale_timesheet/models/account.py | 28 ++++++++++----- addons/sale_timesheet/models/hr.py | 4 +-- .../tests/test_sale_timesheet.py | 29 ++++++++++----- addons/sale_timesheet/views/hr_views.xml | 16 +++++---- 9 files changed, 120 insertions(+), 37 deletions(-) create mode 100644 addons/hr_timesheet/views/hr_views.xml diff --git a/addons/hr_timesheet/__manifest__.py b/addons/hr_timesheet/__manifest__.py index efedc7384f0..177797d13a0 100644 --- a/addons/hr_timesheet/__manifest__.py +++ b/addons/hr_timesheet/__manifest__.py @@ -31,6 +31,7 @@ up a management by affair. 'report/report_timesheet_templates.xml', 'hr_timesheet_installer.xml', 'hr_dashboard.xml', + 'views/hr_views.xml', ], 'demo': [ 'demo/hr_timesheet_demo.xml', diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index c8b7241e5c5..3c3cdecff9e 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -7,24 +7,38 @@ from odoo import api, fields, models class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' + def _default_employee_id(self): + return self.env.user.employee_ids[0] + task_id = fields.Many2one('project.task', 'Task') project_id = fields.Many2one('project.project', 'Project', domain=[('allow_timesheets', '=', True)]) - department_id = fields.Many2one('hr.department', "Department", related='user_id.employee_ids.department_id', store=True, readonly=True) + + employee_id = fields.Many2one('hr.employee', "Employee", default=_default_employee_id) + department_id = fields.Many2one('hr.department', "Department", related='employee_id.department_id', store=True, readonly=True) @api.onchange('project_id') def onchange_project_id(self): self.task_id = False + @api.onchange('employee_id') + def _onchange_employee_id(self): + self.user_id = self.employee_id.user_id + @api.model def create(self, vals): - if vals.get('project_id'): - project = self.env['project.project'].browse(vals.get('project_id')) - vals['account_id'] = project.analytic_account_id.id + vals = self._update_timesheet_values(vals) return super(AccountAnalyticLine, self).create(vals) @api.multi def write(self, vals): + vals = self._update_timesheet_values(vals) + return super(AccountAnalyticLine, self).write(vals) + + def _update_timesheet_values(self, vals): if vals.get('project_id'): project = self.env['project.project'].browse(vals.get('project_id')) vals['account_id'] = project.analytic_account_id.id - return super(AccountAnalyticLine, self).write(vals) + if vals.get('employee_id'): + employee = self.env['hr.employee'].browse(vals['employee_id']) + vals['user_id'] = employee.user_id.id + return vals diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index 95f3d8617d0..d2bac3c2ac0 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -37,7 +37,8 @@ 10 - + + @@ -47,7 +48,7 @@ account.analytic.line - + @@ -89,7 +90,8 @@ 10 - + + @@ -98,7 +100,7 @@ account.analytic.line.calendar account.analytic.line - + @@ -111,7 +113,7 @@ - + @@ -130,7 +132,7 @@ ('date', '<=', (context_today() + relativedelta(months=1, day=1, days=-1)).strftime('%Y-%m-%d')), ]"/> - + @@ -191,7 +193,7 @@ account.analytic.line [('project_id', '!=', False)] - {'search_default_week':1, 'search_default_groupby_user':1} + {'search_default_week':1, 'search_default_groupby_employee':1} diff --git a/addons/hr_timesheet/project_timesheet_view.xml b/addons/hr_timesheet/project_timesheet_view.xml index b7f1b87bab4..f799cc5b76e 100644 --- a/addons/hr_timesheet/project_timesheet_view.xml +++ b/addons/hr_timesheet/project_timesheet_view.xml @@ -102,7 +102,8 @@ - + + diff --git a/addons/hr_timesheet/views/hr_views.xml b/addons/hr_timesheet/views/hr_views.xml new file mode 100644 index 00000000000..6d500f22fa4 --- /dev/null +++ b/addons/hr_timesheet/views/hr_views.xml @@ -0,0 +1,36 @@ + + + + + Timesheets + account.analytic.line + + [('project_id', '!=', False)] + { + 'search_default_month':1, + 'search_default_employee_id': [active_id], + 'default_employee_id': active_id + } + + + + hr.employee.form.timesheet + hr.employee + + + + + + + + + + + + + + diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index 812b9b09b1b..7f319ead699 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -37,16 +37,28 @@ class AccountAnalyticLine(models.Model): if values.get('amount'): return {} unit_amount = values.get('unit_amount', 0.0) or self.unit_amount - user_id = values.get('user_id') or self.user_id.id or self._default_user() - user = self.env['res.users'].browse([user_id]) - emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1) - cost = emp and emp.timesheet_cost or 0.0 - uom = (emp or user).company_id.project_time_mode_id - # Nominal employee cost = 1 * company project UoM (project_time_mode_id) + + # find the employee + employee_id = values.get('employee_id') or self.employee_id.id or self._default_employee_id().id + employee = self.env['hr.employee'].browse(employee_id) if employee_id else self.env['hr.employee'] + if not employee: + user_id = values.get('user_id') or self.user_id.id or self._default_user() + employee = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1) + + # find the analytic account + account_id = values.get('account_id') or self.account_id.id + analytic_account = self.env['account.analytic.account'].browse(account_id) if account_id else self.env['account.analytic.account'] + + # convert employee cost into timesheet (analytic account) currency + uom = employee.company_id.project_time_mode_id + cost = employee.timesheet_cost or 0.0 + amount = -unit_amount * cost + amount_converted = employee.currency_id.compute(amount, analytic_account.currency_id) + return { - 'amount': -unit_amount * cost, + 'amount': amount_converted, 'product_uom_id': uom.id, - 'account_id': values.get('account_id') or self.account_id.id or emp.account_id.id, + 'account_id': account_id, } return {} diff --git a/addons/sale_timesheet/models/hr.py b/addons/sale_timesheet/models/hr.py index 5964b77ab04..a9f94f57bb9 100644 --- a/addons/sale_timesheet/models/hr.py +++ b/addons/sale_timesheet/models/hr.py @@ -8,5 +8,5 @@ class HrEmployee(models.Model): _inherit = 'hr.employee' # FIXME: this field should be in module hr_timesheet, not sale_timesheet - timesheet_cost = fields.Float('Timesheet Cost', default=0.0) - account_id = fields.Many2one('account.account', string='Account') + timesheet_cost = fields.Monetary('Timesheet Cost', currency_field='currency_id', default=0.0) + currency_id = fields.Many2one('res.currency', related='company_id.currency_id', readonly=True) diff --git a/addons/sale_timesheet/tests/test_sale_timesheet.py b/addons/sale_timesheet/tests/test_sale_timesheet.py index 309650aee2f..d75991411cb 100644 --- a/addons/sale_timesheet/tests/test_sale_timesheet.py +++ b/addons/sale_timesheet/tests/test_sale_timesheet.py @@ -6,6 +6,19 @@ from odoo.addons.sale.tests.test_sale_common import TestSale class TestSaleTimesheet(TestSale): + + def setUp(self): + super(TestSaleTimesheet, self).setUp() + # link hr employee to res.users of sale tests + self.employee_user = self.env['hr.employee'].create({ + 'name': 'Employee User', + 'user_id': self.user.id, + }) + self.employee_manager = self.env['hr.employee'].create({ + 'name': 'Employee Manager', + 'user_id': self.manager.id, + }) + def test_timesheet_order(self): """ Test timesheet invoicing with 'invoice on order' timetracked products """ # intial so @@ -26,7 +39,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 10.5, - 'user_id': self.manager.id, + 'employee_id': self.employee_user.id, }) self.assertEqual(so.order_line.qty_delivered, 10.5, 'Sale Timesheet: timesheet does not increase delivered quantity on so line') self.assertEqual(so.invoice_status, 'invoiced', 'Sale Timesheet: "invoice on order" timesheets should not modify the invoice_status of the so') @@ -35,7 +48,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 39.5, - 'user_id': self.user.id, + 'employee_id': self.employee_user.id, }) self.assertEqual(so.order_line.qty_delivered, 50, 'Sale Timesheet: timesheet does not increase delivered quantity on so line') self.assertEqual(so.invoice_status, 'invoiced', 'Sale Timesheet: "invoice on order" timesheets should not modify the invoice_status of the so') @@ -44,7 +57,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 10, - 'user_id': self.user.id, + 'employee_id': self.employee_user.id, }) self.assertEqual(so.order_line.qty_delivered, 60, 'Sale Timesheet: timesheet does not increase delivered quantity on so line') self.assertEqual(so.invoice_status, 'upselling', 'Sale Timesheet: "invoice on order" timesheets should not modify the invoice_status of the so') @@ -69,7 +82,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 10.5, - 'user_id': self.manager.id, + 'employee_id': self.employee_manager.id, }) self.assertEqual(so.invoice_status, 'to invoice', 'Sale Timesheet: "invoice on delivery" timesheets should set the so in "to invoice" status when logged') inv_id = so.action_invoice_create() @@ -80,7 +93,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 39.5, - 'user_id': self.user.id, + 'employee_id': self.employee_user.id, }) self.assertEqual(so.invoice_status, 'to invoice', 'Sale Timesheet: "invoice on delivery" timesheets should not modify the invoice_status of the so') so.action_invoice_create() @@ -90,7 +103,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 10, - 'user_id': self.user.id, + 'employee_id': self.employee_user.id, }) self.assertEqual(so.invoice_status, 'to invoice', 'Sale Timesheet: supplementary timesheets do not change the status of the SO') @@ -113,7 +126,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 16, - 'user_id': self.manager.id, + 'employee_id': self.employee_manager.id, }) self.assertEqual(so.order_line.qty_delivered, 2, 'Sale: uom conversion of timesheets is wrong') @@ -121,7 +134,7 @@ class TestSaleTimesheet(TestSale): 'name': 'Test Line', 'project_id': so.project_project_id.id, 'unit_amount': 24, - 'user_id': self.user.id, + 'employee_id': self.employee_user.id, }) so.action_invoice_create() self.assertEqual(so.invoice_status, 'invoiced', 'Sale Timesheet: "invoice on delivery" timesheets should not modify the invoice_status of the so') diff --git a/addons/sale_timesheet/views/hr_views.xml b/addons/sale_timesheet/views/hr_views.xml index 7b17e2dc67e..ce032cc01e0 100644 --- a/addons/sale_timesheet/views/hr_views.xml +++ b/addons/sale_timesheet/views/hr_views.xml @@ -3,13 +3,17 @@ hr.timesheet.employee.extd_form hr.employee - + - - - - - + +

+ per hour + +
+ + + 0
From 5d6090f7188df29de57a622dce5dfaa62ba82cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 26 Apr 2017 17:32:29 +0200 Subject: [PATCH 6/7] [MOV] hr_timesheet: move department view inheritance in its view file --- addons/hr_timesheet/__manifest__.py | 1 - addons/hr_timesheet/hr_dashboard.xml | 25 ------------------------- addons/hr_timesheet/views/hr_views.xml | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 addons/hr_timesheet/hr_dashboard.xml diff --git a/addons/hr_timesheet/__manifest__.py b/addons/hr_timesheet/__manifest__.py index 177797d13a0..8ada09a25b7 100644 --- a/addons/hr_timesheet/__manifest__.py +++ b/addons/hr_timesheet/__manifest__.py @@ -30,7 +30,6 @@ up a management by affair. 'report/hr_timesheet_report_view.xml', 'report/report_timesheet_templates.xml', 'hr_timesheet_installer.xml', - 'hr_dashboard.xml', 'views/hr_views.xml', ], 'demo': [ diff --git a/addons/hr_timesheet/hr_dashboard.xml b/addons/hr_timesheet/hr_dashboard.xml deleted file mode 100644 index 9ddacf2524d..00000000000 --- a/addons/hr_timesheet/hr_dashboard.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - hr.department.kanban.inherit - hr.department - - - - - - -
- - - - - - diff --git a/addons/hr_timesheet/views/hr_views.xml b/addons/hr_timesheet/views/hr_views.xml index 6d500f22fa4..82403ffd01e 100644 --- a/addons/hr_timesheet/views/hr_views.xml +++ b/addons/hr_timesheet/views/hr_views.xml @@ -33,4 +33,26 @@ + + hr.department.kanban.inherit + hr.department + + + + + + + + + + + + From 1113b951cbf94110ed13edc62f12de05c21fca36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Thu, 27 Apr 2017 10:11:16 +0200 Subject: [PATCH 7/7] [IMP] hr_timesheet, sale: improve timesheet-related settings Sale module now installs sale_timesheet module and not its auto-install enterprise bridge. It seems more intuitive to installe real applications and let bridges automatically install themselves. Some wording is also improved to ease user experience through the various timesheet related blocks of settings. --- .../hr_timesheet_config_settings_views.xml | 7 ++++++- addons/sale/models/sale_config_settings.py | 4 ++-- addons/sale/views/sale_config_settings_views.xml | 10 +++++----- addons/sale_timesheet/__manifest__.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml index 0553cbfddca..00601ba946c 100644 --- a/addons/hr_timesheet/hr_timesheet_config_settings_views.xml +++ b/addons/hr_timesheet/hr_timesheet_config_settings_views.xml @@ -47,7 +47,7 @@

Billing

-
+
@@ -57,6 +57,11 @@
Sell services and invoice time spent
+
+
+ Save this page and come back here to set up the feature. +
+
diff --git a/addons/sale/models/sale_config_settings.py b/addons/sale/models/sale_config_settings.py index 797bc4fc6af..13f997764ec 100644 --- a/addons/sale/models/sale_config_settings.py +++ b/addons/sale/models/sale_config_settings.py @@ -23,7 +23,7 @@ class SaleConfiguration(models.TransientModel): implied_group='product.group_uom') group_discount_per_so_line = fields.Boolean("Discounts", implied_group='sale.group_discount_per_so_line') group_stock_packaging = fields.Boolean("Packaging", implied_group='product.group_stock_packaging', - help="""Ability to select a package type in sales orders and + help="""Ability to select a package type in sales orders and to force a quantity that is a multiple of the number of units per package.""") module_sale_margin = fields.Boolean("Margins") group_sale_layout = fields.Boolean("Sections on Sales Orders", implied_group='sale.group_sale_layout') @@ -78,7 +78,7 @@ class SaleConfiguration(models.TransientModel): module_delivery_ups = fields.Boolean("UPS") module_delivery_usps = fields.Boolean("USPS") - module_timesheet_grid_sale = fields.Boolean("Timesheets") + module_sale_timesheet = fields.Boolean("Timesheets") module_sale_ebay = fields.Boolean("eBay") module_print_docsaway = fields.Boolean("Docsaway") module_web_clearbit = fields.Boolean("Customer Autocomplete") diff --git a/addons/sale/views/sale_config_settings_views.xml b/addons/sale/views/sale_config_settings_views.xml index 923a8928c40..4b4316df662 100644 --- a/addons/sale/views/sale_config_settings_views.xml +++ b/addons/sale/views/sale_config_settings_views.xml @@ -285,17 +285,17 @@

Timesheets

-
+
- +
-