diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index 285ff3b45ec..280b813380f 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -63,7 +63,7 @@ class account_analytic_line(osv.osv): # Compute the cost based on the price type define into company # property_valuation_price_type property - def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, + def on_change_unit_amount(self, cr, uid, id, prod_id, quantity, company_id, unit=False, journal_id=False, context=None): if context==None: context={} diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 1947f2c4d0f..7658ab111d9 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -19,6 +19,7 @@ + @@ -71,6 +72,7 @@ + @@ -164,12 +166,13 @@ - - - + + + + @@ -241,16 +244,16 @@ - + - - - + + + - + diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml index cc1d674ca0a..be7af1d4139 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml @@ -26,25 +26,17 @@ - - - - + + + + - - - - - - - diff --git a/addons/analytic/analytic_view.xml b/addons/analytic/analytic_view.xml index 4fa01a92204..1ff623eff5c 100644 --- a/addons/analytic/analytic_view.xml +++ b/addons/analytic/analytic_view.xml @@ -29,9 +29,9 @@ - diff --git a/addons/analytic_contract_expense_project/__openerp__.py b/addons/analytic_contract_expense_project/__openerp__.py index fb84b7016e4..514f0bfbbf5 100644 --- a/addons/analytic_contract_expense_project/__openerp__.py +++ b/addons/analytic_contract_expense_project/__openerp__.py @@ -21,7 +21,7 @@ { - 'name': 'Contract on Hr expense with Project', + 'name': 'Projects Management: hr_expense link', 'version': '1.1', 'category': 'Sales Management', 'description': """ diff --git a/addons/analytic_contract_hr_expense/__openerp__.py b/addons/analytic_contract_hr_expense/__openerp__.py index 47de651da87..981f7226d6a 100644 --- a/addons/analytic_contract_hr_expense/__openerp__.py +++ b/addons/analytic_contract_hr_expense/__openerp__.py @@ -21,7 +21,7 @@ { - 'name': 'Contracts on Hr expense', + 'name': 'Contracts Management: hr_expense link', 'version': '1.1', 'category': 'Sales Management', 'description': """ diff --git a/addons/analytic_contract_project/analytic_contract_project.py b/addons/analytic_contract_project/analytic_contract_project.py index 9ddc75ecf8d..6221617637e 100644 --- a/addons/analytic_contract_project/analytic_contract_project.py +++ b/addons/analytic_contract_project/analytic_contract_project.py @@ -77,7 +77,7 @@ class task(osv.osv): def create(self, cr, uid, vals, context=None): task_id = super(task, self).create(cr, uid, vals, context=context) - task_browse = self.browse(cr,uid,task_id,context) - self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task has been created."), context=context) + task_browse = self.browse(cr, uid, task_id, context=context) + self.pool.get('account.analytic.account').message_append_note(cr, uid, [task_browse.project_id.analytic_account_id.id], body=_("Task %s has been created.") % (task_browse.name), context=context) return task_id task() diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 87539de9a08..81b6325f4fa 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -69,7 +69,7 @@ class account_analytic_account(osv.osv): help="Keep empty if this contract is not limited to a total fixed price."), 'amount_invoiced': fields.function(_invoiced_calc, string='Invoiced Amount', help="Total invoiced"), - 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invocing Ratio', + 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Timesheet Invoicing Ratio', help="Fill this field if you plan to automatically generate invoices based " \ "on the costs in this analytic account: timesheets, expenses, ..." \ "You can configure an automatic invoice rate on analytic accounts."), @@ -95,39 +95,27 @@ class account_analytic_account(osv.osv): def set_close(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'close'}, context=context) - self.set_close_send_note(cr, uid, ids, context) + message = _("Contract has been closed.") + self.message_append_note(cr, uid, ids, body=message, context=context) return True def set_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'cancelled'}, context=context) - self.set_cancel_send_note(cr, uid, ids, context) + message = _("Contract has been cancelled.") + self.message_append_note(cr, uid, ids, body=message, context=context) return True def set_open(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'open'}, context=context) - self.set_open_send_note(cr, uid, ids, context) + message = _("Contract has been opened.") + self.message_append_note(cr, uid, ids, body=message, context=context) return True def set_pending(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'pending'}, context=context) - self.set_pending_send_note(cr, uid, ids, context) + message = _("Contract has been set as pending.") + self.message_append_note(cr, uid, ids, body=message, context=context) return True - - def set_open_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been opened.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_close_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been closed.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_cancel_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been cancelled.") - return self.message_append_note(cr, uid, ids, body=message, context=context) - - def set_pending_send_note(self, cr, uid, ids, context=None): - message = _("Contract has been pending.") - return self.message_append_note(cr, uid, ids, body=message, context=context) account_analytic_account() diff --git a/addons/project_timesheet/__openerp__.py b/addons/project_timesheet/__openerp__.py index 2dccbb2e38b..f1a82867a6f 100644 --- a/addons/project_timesheet/__openerp__.py +++ b/addons/project_timesheet/__openerp__.py @@ -36,7 +36,13 @@ the Timesheet line entries for particular date and particular user with the eff 'images': ['images/invoice_task_work.jpeg', 'images/my_timesheet.jpeg', 'images/working_hour.jpeg'], 'depends': ['project', 'hr_timesheet_sheet', 'hr_timesheet_invoice', 'account_analytic_analysis'], 'init_xml': ['project_timesheet_data.xml'], - 'update_xml': ["security/ir.model.access.csv","process/project_timesheet_process.xml", "report/task_report_view.xml", "project_timesheet_view.xml"], + 'update_xml': [ + "security/ir.model.access.csv", + "security/project_timesheet_security.xml", + "process/project_timesheet_process.xml", + "report/task_report_view.xml", + "project_timesheet_view.xml", + ], 'demo_xml': ["project_timesheet_demo.xml"], 'test': [ 'test/worktask_entry_to_timesheetline_entry.yml', diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index fce14596498..31b169d3c0f 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -105,7 +105,7 @@ class project_work(osv.osv): project_obj = self.pool.get('project.project') task_obj = self.pool.get('project.task') uom_obj = self.pool.get('product.uom') - + vals_line = {} context = kwargs.get('context', {}) if not context.get('no_analytic_entry',False): @@ -115,7 +115,7 @@ class project_work(osv.osv): vals_line['user_id'] = vals['user_id'] vals_line['product_id'] = result['product_id'] vals_line['date'] = vals['date'][:10] - + #calculate quantity based on employee's product's uom vals_line['unit_amount'] = vals['hours'] @@ -153,7 +153,7 @@ class project_work(osv.osv): project_obj = self.pool.get('project.project') uom_obj = self.pool.get('product.uom') result = {} - + if isinstance(ids, (long, int)): ids = [ids,] @@ -172,7 +172,7 @@ class project_work(osv.osv): for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): if result.get(fld, False): vals_line[fld] = result[fld] - + if 'date' in vals: vals_line['date'] = vals['date'][:10] if 'hours' in vals: @@ -182,7 +182,7 @@ class project_work(osv.osv): if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) - + # Compute based on pricetype amount_unit = timesheet_obj.on_change_unit_amount(cr, uid, line_id.id, prod_id=prod_id, company_id=False, @@ -192,7 +192,7 @@ class project_work(osv.osv): vals_line['amount'] = amount_unit['value']['amount'] self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context) - + return super(project_work,self).write(cr, uid, ids, vals, context) def unlink(self, cr, uid, ids, *args, **kwargs): diff --git a/addons/project_timesheet/security/project_timesheet_security.xml b/addons/project_timesheet/security/project_timesheet_security.xml new file mode 100644 index 00000000000..ea1f0a98b4c --- /dev/null +++ b/addons/project_timesheet/security/project_timesheet_security.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index e98e471cca3..0238f28d4da 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -142,6 +142,7 @@ +