diff --git a/addons/crm/wizard/crm_merge_opportunities_view.xml b/addons/crm/wizard/crm_merge_opportunities_view.xml
index cf1a7ee09a4..153267f0ad1 100644
--- a/addons/crm/wizard/crm_merge_opportunities_view.xml
+++ b/addons/crm/wizard/crm_merge_opportunities_view.xml
@@ -35,9 +35,10 @@
-
\ No newline at end of file
+
diff --git a/addons/hr/board_hr_view.xml b/addons/hr/board_hr_view.xml
index c740114789a..2bcc7738397 100644
--- a/addons/hr/board_hr_view.xml
+++ b/addons/hr/board_hr_view.xml
@@ -2,10 +2,6 @@
-
@@ -32,6 +28,11 @@
menu
-
+
+
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index c05836c393a..240511a03a0 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -82,16 +82,23 @@ class hr_job(osv.osv):
def _no_of_employee(self, cr, uid, ids, name, args, context=None):
res = {}
- for emp in self.browse(cr, uid, ids):
- res[emp.id] = len(emp.employee_ids or [])
+ for job in self.browse(cr, uid, ids, context):
+ res[job.id] = len(job.employee_ids or [])
+ return res
+
+ def _no_of_recruitement(self, cr, uid, ids, name, args, context=None):
+ res = {}
+ for job in self.browse(cr, uid, ids, context):
+ res[job.id] = job.expected_employees - job.no_of_employee
return res
_name = "hr.job"
_description = "Job Description"
_columns = {
'name': fields.char('Job Name', size=128, required=True, select=True),
- 'expected_employees': fields.integer('Expected Employees', help='Required number of Employees'),
- 'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employees', type='integer', help='Number of Employees selected'),
+ 'expected_employees': fields.integer('Expected Employees', help='Required number of Employees in total for that job.'),
+ 'no_of_employee': fields.function(_no_of_employee, method=True, string="No of Employee", help='Number of employee with that job.'),
+ 'no_of_recruitment': fields.function(_no_of_recruitement, method=True, string='Expected in Recruitment', readonly=True),
'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'),
'description': fields.text('Job Description'),
'requirements': fields.text('Requirements'),
@@ -102,9 +109,17 @@ class hr_job(osv.osv):
_defaults = {
'expected_employees': 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c),
- 'state': 'open'
+ 'state': 'open',
}
+ def on_change_expected_employee(self, cr, uid, ids, expected_employee, no_of_employee, context=None):
+ if context is None:
+ context = {}
+ result={}
+ if expected_employee:
+ result['no_of_recruitment'] = expected_employee - no_of_employee
+ return {'value': result}
+
def job_old(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'old'})
return True
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index 2b1cd596024..ce501c6951a 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -324,8 +324,9 @@
-
+
+
@@ -360,6 +361,7 @@
+
diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py
index 3714050cbdb..8a52d0e2577 100644
--- a/addons/hr_attendance/__openerp__.py
+++ b/addons/hr_attendance/__openerp__.py
@@ -32,7 +32,6 @@
'author': 'OpenERP SA',
'depends': ['hr'],
'update_xml': [
- 'security/hr_security.xml',
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_report.xml',
diff --git a/addons/hr_attendance/security/hr_security.xml b/addons/hr_attendance/security/hr_security.xml
deleted file mode 100644
index 39f923a895b..00000000000
--- a/addons/hr_attendance/security/hr_security.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/hr_contract/__openerp__.py b/addons/hr_contract/__openerp__.py
index 2851a9aa86b..aea686e4279 100755
--- a/addons/hr_contract/__openerp__.py
+++ b/addons/hr_contract/__openerp__.py
@@ -36,7 +36,6 @@
'depends': ['hr'],
'init_xml': ['hr_contract_data.xml'],
'update_xml': [
- 'security/hr_contract_security.xml',
'security/ir.model.access.csv',
'hr_contract_view.xml'
],
diff --git a/addons/hr_contract/security/hr_contract_security.xml b/addons/hr_contract/security/hr_contract_security.xml
deleted file mode 100644
index 39f923a895b..00000000000
--- a/addons/hr_contract/security/hr_contract_security.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 960849bdfd4..97f00d8b861 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -267,7 +267,18 @@ class hr_evaluation(osv.osv):
context = {}
self.write(cr, uid, ids,{'state':'cancel'}, context=context)
return True
-
+
+ def write(self, cr, uid, ids, vals, context=None):
+ if context is None:
+ context = {}
+ if 'date' in vals:
+ new_vals = {'date_deadline': vals.get('date')}
+ obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview')
+ for evalutation in self.browse(cr, uid, ids, context=context):
+ for survey_req in evalutation.survey_request_ids:
+ obj_hr_eval_iterview.write(cr, uid, [survey_req.id], new_vals, context=context)
+ return super(hr_evaluation, self).write(cr, uid, ids, vals, context=context)
+
hr_evaluation()
class survey_request(osv.osv):
@@ -320,7 +331,7 @@ class hr_evaluation_interview(osv.osv):
for id in self.browse(cr, uid, ids, context=context):
flag = False
wating_id = 0
- tot_done_req = 0
+ tot_done_req = 1
if not id.evaluation_id.id:
raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Evaluation."))
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
index 576c782bfd8..3464c4beaee 100644
--- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py
+++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py
@@ -29,14 +29,14 @@ class hr_evaluation_reminder(osv.osv_memory):
}
def send_mail(self, cr, uid, ids, context=None):
- hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation')
+ hr_evaluation_interview_obj = self.pool.get('hr.evaluation.interview')
if context is None:
context = {}
evaluation_data = self.read(cr, uid, ids, context=context)[0]
- for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids:
- if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email :
- msg = " Hello %s, \n\n Kindly post your response for %s survey. \n\n Thanks," %(waiting_id.user_to_review_id.name, waiting_id.survey_id.title)
- tools.email_send(tools.config['email_from'], [waiting_id.user_to_review_id.work_email],\
+ current_interview = hr_evaluation_interview_obj.browse(cr, uid, evaluation_data.get('evaluation_id'))
+ if current_interview.state == "waiting_answer" and current_interview.user_to_review_id.work_email :
+ msg = " Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks," %(current_interview.user_to_review_id.name, current_interview.survey_id.title)
+ tools.email_send(tools.config['email_from'], [current_interview.user_to_review_id.work_email],\
'Reminder to fill up Survey', msg)
return {'type': 'ir.actions.act_window_close'}
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 70b8625d7b6..0d94204f426 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -95,7 +95,7 @@
-
+
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index b5380c4e5a9..0d78af87975 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -137,7 +137,7 @@
-
+
diff --git a/addons/hr_holidays/report/available_holidays_view.xml b/addons/hr_holidays/report/available_holidays_view.xml
index ac607b6c78a..374e6300cd0 100644
--- a/addons/hr_holidays/report/available_holidays_view.xml
+++ b/addons/hr_holidays/report/available_holidays_view.xml
@@ -88,7 +88,7 @@
- Available Holidays
+ Leaves Analysis
available.holidays.report
form
tree,graph
@@ -110,7 +110,7 @@
-
+
diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py
index 5d2dc27c0de..f7b813f9cc5 100644
--- a/addons/hr_holidays/report/hr_holidays_report.py
+++ b/addons/hr_holidays/report/hr_holidays_report.py
@@ -22,67 +22,6 @@
import tools
from osv import fields,osv
-class hr_holidays_report(osv.osv):
- _name = "hr.holidays.report"
- _description = "Leaves Statistics By Employee and category"
- _auto = False
- _rec_name = 'date'
- _columns = {
- 'date': fields.date('Date', readonly=True),
- 'delay_approve': fields.float('Delay to Approve', digits=(16,2),readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
- 'day': fields.char('Day', size=15, readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
- ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
- ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
- 'date_from' : fields.datetime('Start Date', readonly=True),
- 'date_to' : fields.datetime('End Date', readonly=True),
- 'number_of_days_temp': fields.float('Number of Days', readonly=True),
- 'employee_id' : fields.many2one('hr.employee', "Employee's Name", readonly=True),
- 'category_id' : fields.many2one('hr.employee.category', "Category's Name", readonly=True),
- 'user_id':fields.many2one('res.users', 'User', readonly=True),
- 'holiday_status_id' : fields.many2one("hr.holidays.status", "Leave Type",readonly=True),
- 'department_id':fields.many2one('hr.department','Department',readonly=True),
- 'state': fields.selection([('draft', 'Draft'),
- ('confirm', 'Waiting Validation'),
- ('refuse', 'Refused'),
- ('validate', 'Validated'),
- ('cancel', 'Cancelled')]
- ,'State', readonly=True),
- }
- _order = 'date desc'
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'hr_holidays_report')
- cr.execute("""
- create or replace view hr_holidays_report as (
- select
- min(s.id) as id,
- date_trunc('day',s.create_date) as date,
- date_trunc('day',s.date_from) as date_from,
- date_trunc('day',s.date_to) as date_to,
- sum(s.number_of_days_temp) as number_of_days_temp,
- s.employee_id,
- s.category_id,
- s.user_id as user_id,
- to_char(s.date_from, 'YYYY') as year,
- to_char(s.date_from, 'MM') as month,
- to_char(s.date_from, 'YYYY-MM-DD') as day,
- s.holiday_status_id,
- s.department_id,
- s.state,
- avg(extract('epoch' from age(s.create_date,CURRENT_DATE)))/(3600*24) as delay_approve
- from
- hr_holidays s
- WHERE type='remove'
- GROUP BY
- s.create_date,s.state,s.date_from,s.date_to,
- s.employee_id,s.user_id,s.holiday_status_id,
- s.department_id, s.category_id
- )
- """)
-
-hr_holidays_report()
-
class hr_holidays_remaining_leaves_user(osv.osv):
_name = "hr.holidays.remaining.leaves.user"
_description = "Total holidays by type"
diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml
index e59cf852366..51ff25fea75 100644
--- a/addons/hr_holidays/report/hr_holidays_report_view.xml
+++ b/addons/hr_holidays/report/hr_holidays_report_view.xml
@@ -2,111 +2,6 @@
-
- hr.holidays.report.tree
- hr.holidays.report
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- hr.holidays.report.graph
- hr.holidays.report
- graph
-
-
-
-
-
-
-
-
-
-
- hr.holidays.report.search
- hr.holidays.report
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Leaves Analysis
- hr.holidays.report
- form
- tree,graph
- {'search_default_Employee':1,'search_default_department':1,"search_default_Validated":1, 'group_by':[], 'group_by_no_leaf':1}
-
-
-
-
-
hr.holidays.remaining.leaves.user.tree
hr.holidays.remaining.leaves.user
diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv
index 20da4832fe2..f350b73ed64 100644
--- a/addons/hr_holidays/security/ir.model.access.csv
+++ b/addons/hr_holidays/security/ir.model.access.csv
@@ -2,6 +2,5 @@
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,1,1,1
"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,1
"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,1,1,1
-"access_hr_holidays_report_manager","hr.holidays.report.manager","model_hr_holidays_report","base.group_hr_manager",1,1,1,1
"access_resource_calendar_leaves_manager","resource_calendar_leaves_manager","resource.model_resource_calendar_leaves","base.group_hr_manager",1,1,1,1
"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,1
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 3dbcd946e87..56217455475 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -429,17 +429,9 @@ class hr_applicant(crm.crm_case, osv.osv):
message = _('Applicant ') + " '" + name + "' "+ _("is Hired.")
self.log(cr, uid, id, message)
- stage_id = self.pool.get('hr.recruitment.stage').search(cr, uid, [('name','=','Contract Signed')])
- self.write(cr, uid, ids,{'stage_id':stage_id[0]})
-
applicant = self.browse(cr, uid, ids)[0]
if applicant.job_id :
emp_id = employee_obj.create(cr,uid,{'name':applicant.name,'job_id':applicant.job_id.id})
- job_data = job_obj.browse(cr,uid, applicant.job_id.id)
- expected_emp = job_data['expected_employees'] - 1
- if expected_emp == 0:
- job_obj.write(cr,uid, [applicant.job_id.id],{'state':'old'})
- job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
return res
def case_reset(self, cr, uid, ids, *args):
@@ -450,18 +442,9 @@ class hr_applicant(crm.crm_case, osv.osv):
@param ids: List of case Ids
@param *args: Tuple Value for additional Params
"""
- applicant = self.browse(cr, uid, ids)[0]
- if applicant.job_id :
- job_obj = self.pool.get('hr.job')
- emp_obj = self.pool.get('hr.employee')
- job_data = job_obj.browse(cr,uid, applicant.job_id.id)
- expected_emp = job_data['expected_employees'] + 1
- emp_id = emp_obj.search(cr,uid, [('job_id','=',applicant.job_id.id),('name','=',applicant.name)])
- emp_obj.unlink(cr, uid, emp_id)
- job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
+
res = super(hr_applicant, self).case_reset(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': False, 'date_closed':False})
-
return res
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 033fd68052c..cf2097b2454 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -297,7 +297,7 @@
form
-
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index 6b436f4ef99..1d03581ca22 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -468,7 +468,7 @@
-
+
diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
index cda4574845a..9a22de4d828 100644
--- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
+++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
@@ -28,8 +28,6 @@
I create invoice on analytic Line using "Invoice analytic Line" wizard.
-
!record {model: hr.timesheet.invoice.create, id: hr_timesheet_invoice_create_0}:
- accounts:
- - account.analytic_sednacom
date: 1
name: 1
price: 1
@@ -46,10 +44,12 @@
I check that Invoice is created for this timesheet.
-
!python {model: account.analytic.line}: |
+ account_id = self.pool.get('account.analytic.line')
+ accounts = account_id.browse(cr, uid, [ref("account_analytic_line_developyamlforhrmodule0")])[0]
exp = self.browse(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')])[0]
analytic_account_obj = self.pool.get('account.analytic.account')
data = self.pool.get('hr.timesheet.invoice.create').read(cr, uid, [ref("hr_timesheet_invoice_create_0")], [], context)[0]
- account_ids = data['accounts']
+ account_ids = accounts['account_id']
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
partner = account.partner_id.id
@@ -81,4 +81,4 @@
-
I can also make some theoretical revenue reports.
-
- I can also see timesheet profit using Timesheet profit report.
\ No newline at end of file
+ I can also see timesheet profit using Timesheet profit report.
diff --git a/addons/hr_timesheet_sheet/__openerp__.py b/addons/hr_timesheet_sheet/__openerp__.py
index d00ee91a304..383521b399d 100644
--- a/addons/hr_timesheet_sheet/__openerp__.py
+++ b/addons/hr_timesheet_sheet/__openerp__.py
@@ -55,6 +55,7 @@ The validation can be configured in the company:
'process/hr_timesheet_sheet_process.xml',
'board_hr_timesheet_view.xml',
'report/hr_timesheet_report_view.xml',
+ 'report/timesheet_report_view.xml',
'wizard/hr_timesheet_current_view.xml',
'hr_timesheet_sheet_data.xml'
],
diff --git a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
index a50042c3dfb..13193e66d99 100644
--- a/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
+++ b/addons/hr_timesheet_sheet/board_hr_timesheet_view.xml
@@ -3,7 +3,7 @@
+ sequence="0"/>
-
+
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py
new file mode 100644
index 00000000000..a8c0440a053
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report.py
@@ -0,0 +1,122 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import tools
+from osv import fields,osv
+
+class timesheet_report(osv.osv):
+ _name = "timesheet.report"
+ _description = "Timesheet"
+ _auto = False
+ _columns = {
+ 'year': fields.char('Year',size=64,required=False, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'name': fields.char('Description', size=64,readonly=True),
+ 'product_id' : fields.many2one('product.product', 'Product'),
+ 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User',readonly=True),
+ 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
+ 'nbr': fields.integer('#Nbr',readonly=True),
+ 'total_diff': fields.float('#Total Diff',readonly=True),
+ 'total_timesheet': fields.float('#Total Timesheet',readonly=True),
+ 'total_attendance': fields.float('#Total Attendance',readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company',readonly=True),
+ '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'),
+ ('confirm','Confirmed'),
+ ('done','Done')], 'State', readonly=True),
+ 'quantity': fields.float('#Quantity',readonly=True),
+ 'cost': fields.float('#Cost',readonly=True),
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'timesheet_report')
+ cr.execute("""
+ create or replace view timesheet_report as (
+ select
+ min(aal.id) as id,
+ htss.date_current,
+ htss.name,
+ htss.date_from,
+ htss.date_to,
+ to_char(htss.date_current,'YYYY') as year,
+ to_char(htss.date_current,'MM') as month,
+ to_char(htss.date_current, 'YYYY-MM-DD') as day,
+ count(*) as nbr,
+ aal.unit_amount as quantity,
+ aal.amount as cost,
+ aal.account_id,
+ aal.product_id,
+ (SELECT sum(day.total_difference)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_diff,
+ (SELECT sum(day.total_timesheet)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_timesheet,
+ (SELECT sum(day.total_attendance)
+ FROM hr_timesheet_sheet_sheet AS sheet
+ LEFT JOIN hr_timesheet_sheet_sheet_day AS day
+ ON (sheet.id = day.sheet_id
+ AND day.name = sheet.date_current) where sheet.id=htss.id) as total_attendance,
+ aal.to_invoice,
+ aal.general_account_id,
+ htss.user_id,
+ htss.company_id,
+ htss.department_id,
+ htss.state
+ from account_analytic_line as aal
+ left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
+ left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
+ group by
+ to_char(htss.date_current,'YYYY'),
+ to_char(htss.date_current,'MM'),
+ to_char(htss.date_current, 'YYYY-MM-DD'),
+ aal.account_id,
+ htss.date_from,
+ htss.date_to,
+ aal.unit_amount,
+ aal.amount,
+ htss.date_current,
+ aal.to_invoice,
+ aal.product_id,
+ aal.general_account_id,
+ htss.name,
+ htss.company_id,
+ htss.state,
+ htss.id,
+ htss.department_id,
+ htss.user_id
+ )
+ """)
+timesheet_report()
diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
new file mode 100644
index 00000000000..08abc6db63b
--- /dev/null
+++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml
@@ -0,0 +1,126 @@
+
+
+
+
+ timesheet.report.graph
+ timesheet.report
+ graph
+
+
+
+
+
+
+
+
+
+ timesheet.report.tree
+ timesheet.report
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ timesheet.report.search
+ timesheet.report
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Timesheet Sheet Analysis
+ timesheet.report
+ form
+ tree,graph
+ {'search_default_month':1,'search_default_User_id':1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/security/ir.model.access.csv b/addons/hr_timesheet_sheet/security/ir.model.access.csv
index 9d0159bbc1a..f55ee0fb5e0 100644
--- a/addons/hr_timesheet_sheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet_sheet/security/ir.model.access.csv
@@ -6,3 +6,4 @@
"access_hr_timesheet_report","hr.timesheet.report","model_hr_timesheet_report","base.group_hr_manager",1,1,1,1
"access_hr_analytic_timesheet_system_user","hr.analytic.timesheet.system.user","model_hr_analytic_timesheet","base.group_user",1,0,0,0
"access_hr_timesheet_sheet_sheet_day","hr.timesheet.sheet.sheet.day.user","model_hr_timesheet_sheet_sheet_day","base.group_user",1,0,0,0
+"access_timesheet_report_user","timesheet.report.user","model_timesheet_report","base.group_hr_manager",1,1,1,1
diff --git a/addons/marketing/marketing_wizard.py b/addons/marketing/marketing_wizard.py
index 4b95bbb86da..a97d0ca16bc 100644
--- a/addons/marketing/marketing_wizard.py
+++ b/addons/marketing/marketing_wizard.py
@@ -32,6 +32,10 @@ class marketing_installer(osv.osv_memory):
'crm_profiling':fields.boolean('Profiling Tools',
help="Helps you to perform segmentation of partners and design segmentation questionnaires")
}
+ _defaults = {
+ 'marketing_campaign': lambda *a: 1,
+ }
+
marketing_installer()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
index 58b4dc447cd..f0536ae0ac8 100644
--- a/addons/point_of_sale/wizard/pos_payment.xml
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -1,48 +1,48 @@
-
+
-
+
Add payment :
pos.make.payment
form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -54,5 +54,5 @@
new
-
-
+
+
diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py
index 99e697ea826..abeadfc9931 100644
--- a/addons/point_of_sale/wizard/pos_return.py
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -143,6 +143,23 @@ class pos_return(osv.osv_memory):
@return: Return the add product form again for adding more product
"""
+ current_rec = self.read(cr, uid, data[0], context=context)
+ order_obj =self.pool.get('pos.order')
+ line_obj = self.pool.get('pos.order.line')
+ pos_current = order_obj.browse(cr, uid, context.get('active_id'))
+ pos_line_ids = pos_current.lines
+ if pos_line_ids:
+ for pos_line in pos_line_ids:
+ line_field = "return"+str(pos_line.id)
+ pos_list = current_rec.keys()
+ newline_vals = {}
+ if line_field in pos_list :
+ less_qty = current_rec.get(line_field)
+ pos_cur_line = line_obj.browse(cr, uid, pos_line.id, context=context)
+ qty = pos_cur_line.qty
+ qty = qty - less_qty
+ newline_vals.update({'qty':qty})
+ line_obj.write(cr, uid, pos_line.id, newline_vals, context=context)
return {
'name': _('Add Product'),
'view_type': 'form',
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 3d483658eb0..ce54b58a378 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -407,7 +407,7 @@
-
+
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index eb781690c1b..5d533056405 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -89,7 +89,7 @@
domain="[('state','=','done')]"/>
-
@@ -121,7 +121,7 @@
-
+
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 9e79f367ca4..d9ca4b04e08 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -236,7 +236,7 @@
-
diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml
index dd09592916d..ea864cd152b 100644
--- a/addons/project_issue/report/project_issue_report_view.xml
+++ b/addons/project_issue/report/project_issue_report_view.xml
@@ -121,7 +121,7 @@
domain="[]"
context="{'group_by':'section_id'}" />
-
+
-
+
@@ -264,7 +264,7 @@
-
+
@@ -273,7 +273,7 @@
-
+
diff --git a/addons/project_messages/project_messages_view.xml b/addons/project_messages/project_messages_view.xml
index 7042ce9d9b2..bffd1af0503 100644
--- a/addons/project_messages/project_messages_view.xml
+++ b/addons/project_messages/project_messages_view.xml
@@ -82,7 +82,7 @@
-
+
diff --git a/addons/project_scrum/project_scrum_view.xml b/addons/project_scrum/project_scrum_view.xml
index cd4eb8e61b4..0c91348c910 100644
--- a/addons/project_scrum/project_scrum_view.xml
+++ b/addons/project_scrum/project_scrum_view.xml
@@ -166,7 +166,7 @@
-
+
@@ -332,7 +332,7 @@
-
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index a0c6b66d29a..b288055faf3 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -37,6 +37,7 @@ from osv.orm import browse_record, browse_null
# Model definition
#
class purchase_order(osv.osv):
+
def _calc_amount(self, cr, uid, ids, prop, unknow_none, unknow_dict):
res = {}
for order in self.browse(cr, uid, ids):
@@ -44,7 +45,7 @@ class purchase_order(osv.osv):
for oline in order.order_line:
res[order.id] += oline.price_unit * oline.product_qty
return res
-
+
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
res = {}
cur_obj=self.pool.get('res.currency')
diff --git a/addons/purchase/wizard/purchase_order_group_view.xml b/addons/purchase/wizard/purchase_order_group_view.xml
index fe04af1a32b..cb67f489a99 100644
--- a/addons/purchase/wizard/purchase_order_group_view.xml
+++ b/addons/purchase/wizard/purchase_order_group_view.xml
@@ -30,7 +30,8 @@ Lines will only be merged if:
res_model="purchase.order.group"
src_model="purchase.order"
view_mode="form"
- target="new"
+ target="new"
+ multi="True"
key2="client_action_multi"
groups="base.group_extended"
id="action_view_purchase_order_group"/>
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index bf2786f17ed..c4cc59f7b9a 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -102,7 +102,7 @@
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index e8ccb657bc2..4db4641ad4c 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -54,7 +54,7 @@ def _incoterm_get(self, cr, uid, context=None):
class sale_order(osv.osv):
_name = "sale.order"
_description = "Sale Order"
-
+
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
diff --git a/addons/sale/wizard/sale_make_invoice.xml b/addons/sale/wizard/sale_make_invoice.xml
index e8e698e56b9..267167237bc 100644
--- a/addons/sale/wizard/sale_make_invoice.xml
+++ b/addons/sale/wizard/sale_make_invoice.xml
@@ -26,6 +26,7 @@
form
new
+ True
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index f46f0c2ab08..f1122640424 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -2371,7 +2371,7 @@ class stock_inventory(osv.osv):
'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
}
-
+
def _inventory_line_hook(self, cr, uid, inventory_line, move_vals):
""" Creates a stock move from an inventory line
@param inventory_line:
diff --git a/addons/stock/wizard/stock_fill_inventory_view.xml b/addons/stock/wizard/stock_fill_inventory_view.xml
index 3db42eb7be5..e8dd6d323d1 100644
--- a/addons/stock/wizard/stock_fill_inventory_view.xml
+++ b/addons/stock/wizard/stock_fill_inventory_view.xml
@@ -1,33 +1,34 @@
-
+
Import Inventory
stock.fill.inventory
form
-
+
-
+ id="action_view_stock_fill_inventory"/>
diff --git a/addons/stock/wizard/stock_inventory_merge_view.xml b/addons/stock/wizard/stock_inventory_merge_view.xml
index 62cac877179..7a4735bdf41 100644
--- a/addons/stock/wizard/stock_inventory_merge_view.xml
+++ b/addons/stock/wizard/stock_inventory_merge_view.xml
@@ -22,6 +22,7 @@
res_model="stock.inventory.merge"
src_model="stock.inventory"
view_mode="form"
+ multi="True"
target="new"
key2="client_action_multi"
id="action_view_stock_merge_inventories"/>
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 57a78e9ac5d..5343ef3c229 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -68,6 +68,7 @@ class survey(osv.osv):
'users': fields.many2many('res.users', 'survey_users_rel', 'sid', 'uid', 'Users'),
'send_response': fields.boolean('E-mail Notification on Answer'),
'type': fields.many2one('survey.type', 'Type'),
+ 'invited_user_ids': fields.many2many('res.users', 'survey_invited_user_rel', 'sid', 'uid', 'Invited User'),
}
_defaults = {
'state': lambda * a: "draft",
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 44bcb4475b5..713f3dbf7a4 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -206,6 +206,9 @@
+
+
+
diff --git a/addons/survey/wizard/survey_selection.py b/addons/survey/wizard/survey_selection.py
index 69cc8e10796..0f7ca8628f0 100644
--- a/addons/survey/wizard/survey_selection.py
+++ b/addons/survey/wizard/survey_selection.py
@@ -62,9 +62,20 @@ class survey_name_wiz(osv.osv_memory):
for sur in surv_obj.browse(cr, uid, [context.get('survey_id',False)]):
result.append((sur.id, sur.title))
return result
+ survey_user_group_id = self.pool.get('res.groups').search(cr, uid, [('name', '=', 'Survey / User')])
group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Tools / Manager','Tools / User','Survey / User'))])
user_obj = self.pool.get('res.users')
user_rec = user_obj.read(cr, uid, uid)
+ if survey_user_group_id:
+ if survey_user_group_id == user_rec['groups_id']:
+ for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
+ if sur.state == 'open':
+ u_list = []
+ for use in sur.invited_user_ids:
+ u_list.append(use.id)
+ if uid in u_list:
+ result.append((sur.id, sur.title))
+ return result
for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
if sur.state == 'open':
res = False
diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py
index b9740fba6ba..92ba965d880 100644
--- a/addons/survey/wizard/survey_send_invitation.py
+++ b/addons/survey/wizard/survey_send_invitation.py
@@ -113,7 +113,13 @@ class survey_send_invitation(osv.osv_memory):
error = ""
res_user = ""
user_exists = False
+ new_user = []
attachments = []
+ current_sur = survey_ref.browse(cr, uid, context.get('active_id'), context=context)
+ exist_user = current_sur.invited_user_ids
+ if exist_user:
+ for use in exist_user:
+ new_user.append(use.id)
for id in survey_ref.browse(cr, uid, survey_ids):
report = self.create_report(cr, uid, [id.id], 'report.survey.form', id.title)
file = open(tools.config['addons_path'] + '/survey/report/' + id.title +".pdf")
@@ -134,6 +140,8 @@ class survey_send_invitation(osv.osv_memory):
continue
user = user_ref.search(cr, uid, [('login', "=", addr.email)])
if user:
+ if user[0] not in new_user:
+ new_user.append(user[0])
user = user_ref.browse(cr, uid, user[0])
user_ref.write(cr, uid, user.id, {'survey_id':[[6, 0, survey_ids]]})
mail = record['mail']%{'login':addr.email, 'passwd':user.password, \
@@ -172,11 +180,17 @@ class survey_send_invitation(osv.osv_memory):
'survey_id': [[6, 0, survey_ids]]
}
user = user_ref.create(cr, uid, res_data)
+ if user not in new_user:
+ new_user.append(user)
created+= "- %s (Login: %s, Password: %s)\n" % (addr.name or 'Unknown',\
addr.email, passwd)
else:
error+= "- %s (Login: %s, Password: %s)\n" % (addr.name or 'Unknown',\
addr.email, passwd)
+
+ new_vals = {}
+ new_vals.update({'invited_user_ids':[[6,0,new_user]]})
+ survey_ref.write(cr, uid, context.get('active_id'),new_vals)
note= ""
if created:
note += 'Created users:\n%s\n\n' % (created)