diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 6d466204ed8..101629482eb 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -21,16 +21,15 @@ import logging +from openerp import tools from openerp.modules.module import get_module_resource from openerp.osv import fields, osv from openerp.tools.translate import _ -from openerp import tools -from openerp.tools.translate import _ _logger = logging.getLogger(__name__) -class hr_employee_category(osv.osv): +class hr_employee_category(osv.Model): def name_get(self, cr, uid, ids, context=None): if not ids: @@ -73,9 +72,9 @@ class hr_employee_category(osv.osv): ] -class hr_job(osv.osv): +class hr_job(osv.Model): - def _no_of_employee(self, cr, uid, ids, name, args, context=None): + def _get_nbr_employees(self, cr, uid, ids, name, args, context=None): res = {} for job in self.browse(cr, uid, ids, context=context): nb_employees = len(job.employee_ids or []) @@ -93,59 +92,81 @@ class hr_job(osv.osv): return res _name = "hr.job" - _description = "Job Description" - _inherit = ['mail.thread'] + _description = "Job Position" + _inherit = ['mail.thread', 'ir.needaction_mixin'] _columns = { 'name': fields.char('Job Name', size=128, required=True, select=True), - 'expected_employees': fields.function(_no_of_employee, string='Total Forecasted Employees', + 'expected_employees': fields.function(_get_nbr_employees, string='Total Forecasted Employees', help='Expected number of employees for this job position after new recruitment.', store = { 'hr.job': (lambda self,cr,uid,ids,c=None: ids, ['no_of_recruitment'], 10), 'hr.employee': (_get_job_position, ['job_id'], 10), }, type='integer', - multi='no_of_employee'), - 'no_of_employee': fields.function(_no_of_employee, string="Current Number of Employees", + multi='_get_nbr_employees'), + 'no_of_employee': fields.function(_get_nbr_employees, string="Current Number of Employees", help='Number of employees currently occupying this job position.', store = { 'hr.employee': (_get_job_position, ['job_id'], 10), }, type='integer', - multi='no_of_employee'), - 'no_of_recruitment': fields.integer('Expected in Recruitment', help='Number of new employees you expect to recruit.'), + multi='_get_nbr_employees'), + 'no_of_recruitment': fields.integer('Expected New Employees', help='Number of new employees you expect to recruit.'), + 'no_of_hired_employee': fields.integer('Hired Employees', help='Number of hired employees for this job position during recruitment phase.'), 'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees', groups='base.group_user'), 'description': fields.text('Job Description'), 'requirements': fields.text('Requirements'), 'department_id': fields.many2one('hr.department', 'Department'), 'company_id': fields.many2one('res.company', 'Company'), - 'state': fields.selection([('open', 'No Recruitment'), ('recruit', 'Recruitement in Progress')], 'Status', readonly=True, required=True, - help="By default 'In position', set it to 'In Recruitment' if recruitment process is going on for this job position."), + 'state': fields.selection([('open', 'Recruitment Closed'), ('recruit', 'Recruitment in Progress')], + string='Status', readonly=True, required=True, + track_visibility='always', + help="By default 'Closed', set it to 'In Recruitment' if recruitment process is going on for this job position."), 'write_date': fields.datetime('Update Date', readonly=True), } + _defaults = { - 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c), - 'no_of_recruitment': 0, + 'company_id': lambda self, cr, uid, ctx=None: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=ctx), 'state': 'open', } _sql_constraints = [ ('name_company_uniq', 'unique(name, company_id, department_id)', 'The name of the job position must be unique per department in company!'), + ('hired_employee_check', "CHECK ( no_of_hired_employee <= no_of_recruitment )", "Number of hired employee must be less than expected number of employee in recruitment."), ] - - def on_change_expected_employee(self, cr, uid, ids, no_of_recruitment, no_of_employee, context=None): - if context is None: - context = {} - return {'value': {'expected_employees': no_of_recruitment + no_of_employee}} - - def job_recruitement(self, cr, uid, ids, *args): - for job in self.browse(cr, uid, ids): + def set_recruit(self, cr, uid, ids, context=None): + for job in self.browse(cr, uid, ids, context=context): no_of_recruitment = job.no_of_recruitment == 0 and 1 or job.no_of_recruitment - self.write(cr, uid, [job.id], {'state': 'recruit', 'no_of_recruitment': no_of_recruitment}) + self.write(cr, uid, [job.id], {'state': 'recruit', 'no_of_recruitment': no_of_recruitment}, context=context) return True - def job_open(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state': 'open', 'no_of_recruitment': 0}) + def set_open(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, { + 'state': 'open', + 'no_of_recruitment': 0, + 'no_of_hired_employee': 0 + }, context=context) return True + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + default.update({ + 'employee_ids': [], + 'no_of_recruitment': 0, + 'no_of_hired_employee': 0, + }) + if 'name' in default: + job = self.browse(cr, uid, id, context=context) + default['name'] = _("%s (copy)") % (job.name) + return super(hr_job, self).copy(cr, uid, id, default=default, context=context) + + # ---------------------------------------- + # Compatibility methods + # ---------------------------------------- + _no_of_employee = _get_nbr_employees # v7 compatibility + job_open = set_open # v7 compatibility + job_recruitment = set_recruit # v7 compatibility + class hr_employee(osv.osv): _name = "hr.employee" diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index eea2eb2ce41..5b0a58ec883 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -45,7 +45,7 @@ - + @@ -333,8 +333,8 @@
-
@@ -342,20 +342,20 @@

Define an invoicing target in the sales team settings to see the period's achievement and forecast at a glance. diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py index f8c0eadbfa9..a789657dad3 100644 --- a/addons/website/models/ir_ui_view.py +++ b/addons/website/models/ir_ui_view.py @@ -133,8 +133,9 @@ class view(osv.osv): if not context: context = {} - qcontext = context.copy() + qcontext = dict(editable=False) qcontext.update( + context.copy(), website=request.website, url_for=website.url_for, slug=website.slug, diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 80e223eed00..317d9193d94 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -399,7 +399,7 @@ div.carousel[data-snippet-id="slider"] .carousel-indicators .active { } .oe_green { - background-color: #51d466; + background-color: #169c78; color: white; } .oe_green .text-muted { @@ -407,7 +407,7 @@ div.carousel[data-snippet-id="slider"] .carousel-indicators .active { } .oe_blue_light { - background-color: #4791d2; + background-color: #41b6ab; color: white; } .oe_blue_light .text-muted { @@ -420,7 +420,7 @@ div.carousel[data-snippet-id="slider"] .carousel-indicators .active { } .oe_orange { - background-color: #e67e22; + background-color: #f05442; color: white; } .oe_orange .text-muted { @@ -436,7 +436,7 @@ div.carousel[data-snippet-id="slider"] .carousel-indicators .active { } .oe_red { - background-color: #f75353; + background-color: #9c1b31; color: white; } .oe_red .text-muted { diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index cea00027315..2390464bfa7 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -328,13 +328,13 @@ div.carousel[data-snippet-id="slider"] color: white .oe_green - background-color: #51d466 + background-color: #169C78 color: white .text-muted color: #ddd .oe_blue_light - background-color: #4791d2 + background-color: #41b6ab color: white .text-muted color: #ddd @@ -344,7 +344,7 @@ div.carousel[data-snippet-id="slider"] color: white .oe_orange - background-color: #e67e22 + background-color: #f05442 color: white .text-muted color: #ddd @@ -356,7 +356,7 @@ div.carousel[data-snippet-id="slider"] color: #ddd .oe_red - background-color: #f75353 + background-color: #9C1b31 color: white .text-muted color: #ddd diff --git a/addons/website/static/src/img/banner/aqua.jpg b/addons/website/static/src/img/banner/aqua.jpg index 47ce77005d4..23f4bb820db 100644 Binary files a/addons/website/static/src/img/banner/aqua.jpg and b/addons/website/static/src/img/banner/aqua.jpg differ diff --git a/addons/website/static/src/img/banner/baby_blue.jpg b/addons/website/static/src/img/banner/baby_blue.jpg index 38a3d85bc28..d13c6683c1d 100644 Binary files a/addons/website/static/src/img/banner/baby_blue.jpg and b/addons/website/static/src/img/banner/baby_blue.jpg differ diff --git a/addons/website/static/src/img/banner/black.jpg b/addons/website/static/src/img/banner/black.jpg index 7aaee7a0fb4..800d529d032 100644 Binary files a/addons/website/static/src/img/banner/black.jpg and b/addons/website/static/src/img/banner/black.jpg differ diff --git a/addons/website/static/src/img/banner/business_guy.jpg b/addons/website/static/src/img/banner/business_guy.jpg index 691729beb7e..04551e6ae01 100644 Binary files a/addons/website/static/src/img/banner/business_guy.jpg and b/addons/website/static/src/img/banner/business_guy.jpg differ diff --git a/addons/website/static/src/img/banner/color_splash.jpg b/addons/website/static/src/img/banner/color_splash.jpg index 7033d3cb41f..a16cf2367ca 100644 Binary files a/addons/website/static/src/img/banner/color_splash.jpg and b/addons/website/static/src/img/banner/color_splash.jpg differ diff --git a/addons/website/static/src/img/banner/flower.jpg b/addons/website/static/src/img/banner/flower.jpg index 7208e4c99d9..ed33976aa38 100644 Binary files a/addons/website/static/src/img/banner/flower.jpg and b/addons/website/static/src/img/banner/flower.jpg differ diff --git a/addons/website/static/src/img/banner/flower_field.jpg b/addons/website/static/src/img/banner/flower_field.jpg index eec572fbb89..23bf90844b7 100644 Binary files a/addons/website/static/src/img/banner/flower_field.jpg and b/addons/website/static/src/img/banner/flower_field.jpg differ diff --git a/addons/website/static/src/img/banner/greenfields.jpg b/addons/website/static/src/img/banner/greenfields.jpg index 58c7bc49738..205406d24d4 100644 Binary files a/addons/website/static/src/img/banner/greenfields.jpg and b/addons/website/static/src/img/banner/greenfields.jpg differ diff --git a/addons/website/static/src/img/banner/landscape.jpg b/addons/website/static/src/img/banner/landscape.jpg index 35dfa6206c4..08a7f233cdd 100644 Binary files a/addons/website/static/src/img/banner/landscape.jpg and b/addons/website/static/src/img/banner/landscape.jpg differ diff --git a/addons/website/static/src/img/banner/landscape.png b/addons/website/static/src/img/banner/landscape.png deleted file mode 100644 index 27b1b92e048..00000000000 Binary files a/addons/website/static/src/img/banner/landscape.png and /dev/null differ diff --git a/addons/website/static/src/img/banner/mango.jpg b/addons/website/static/src/img/banner/mango.jpg index 9f88e2fb987..7582d4f548e 100644 Binary files a/addons/website/static/src/img/banner/mango.jpg and b/addons/website/static/src/img/banner/mango.jpg differ diff --git a/addons/website/static/src/img/banner/mountains.jpg b/addons/website/static/src/img/banner/mountains.jpg index 47e53c82c8c..7ea1ea48000 100644 Binary files a/addons/website/static/src/img/banner/mountains.jpg and b/addons/website/static/src/img/banner/mountains.jpg differ diff --git a/addons/website/static/src/img/banner/orange_red.jpg b/addons/website/static/src/img/banner/orange_red.jpg index 18838410c9f..3f7b2ebeaa9 100644 Binary files a/addons/website/static/src/img/banner/orange_red.jpg and b/addons/website/static/src/img/banner/orange_red.jpg differ diff --git a/addons/website/static/src/img/banner/velour.jpg b/addons/website/static/src/img/banner/velour.jpg index f3b0cf1d528..8a6b034b815 100644 Binary files a/addons/website/static/src/img/banner/velour.jpg and b/addons/website/static/src/img/banner/velour.jpg differ diff --git a/addons/website/static/src/img/banner/wood.jpg b/addons/website/static/src/img/banner/wood.jpg index 738ff955918..4554794ff19 100644 Binary files a/addons/website/static/src/img/banner/wood.jpg and b/addons/website/static/src/img/banner/wood.jpg differ diff --git a/addons/website/static/src/img/banner/yellow_green.jpg b/addons/website/static/src/img/banner/yellow_green.jpg index efd4dad9278..4d98768e8b0 100644 Binary files a/addons/website/static/src/img/banner/yellow_green.jpg and b/addons/website/static/src/img/banner/yellow_green.jpg differ diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 1e8246366a9..7e867dca685 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -638,7 +638,7 @@ image_dialog(editor, new CKEDITOR.dom.element(previous)); $image_button.hide(); previous = null; - }); + }, 'btn-sm'); // previous is the state of the button-trigger: it's the // currently-ish hovered element which can trigger a button showing. diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 017b47b641a..7d307bd26d7 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -71,8 +71,8 @@ { snippet: 'three-columns', placement: 'bottom', - title: _t("Drag & Drop a Block"), - content: _t("Drag the '3 Columns' block and drop it below the banner."), + title: _t("Drag & Drop This Block"), + content: _t("Drag the 'Three Columns' block and drop it below the banner."), popover: { fixed: true }, }, { @@ -98,17 +98,18 @@ popover: { fixed: true }, }, { - element: 'button[data-dismiss=modal]', + element: '.modal:has(#mobile-viewport) button[data-dismiss=modal]', placement: 'right', title: _t("Close Mobile Preview"), content: _t("Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog."), }, { - title: "Congratulation", - element: 'a[id=content-menu-button]', + waitNot: '.modal', + element: '#content-menu-button', placement: 'bottom', - content: _t("This tour is finished. You can continue discovering features with the 'Content' menu."), - popover: { fixed: true, next: _t("Close Tutorial") }, + title: _t("Add new pages and menus"), + content: _t("The 'Content' menu allows you to add pages or add the top menu."), + popover: { next: _t("Close Tutorial") }, }, ]; return this._super(); diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 408a4c01539..8b1284f0a07 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -77,7 +77,11 @@ website.Tour = openerp.Class.extend({ website.Tour.busy = true; - this.localStorage.setItem("tour-"+this.id+"-test-automatic", automatic); + if (automatic) { + this.localStorage.setItem("tour-"+this.id+"-test-automatic", true); + } else { + this.localStorage.removeItem("tour-"+this.id+"-test-automatic"); + } this.automatic = automatic; if (this.path) { diff --git a/addons/website/static/src/xml/website.tour.xml b/addons/website/static/src/xml/website.tour.xml index 1365ba08307..dcecef021bb 100644 --- a/addons/website/static/src/xml/website.tour.xml +++ b/addons/website/static/src/xml/website.tour.xml @@ -22,6 +22,6 @@
- + diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index f1e83dbbb6c..16cbaf9d066 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -907,7 +907,7 @@
  • Darken
  • Green
  • Red
  • -
  • Light Blue
  • +
  • Turquoise
  • Dark Blue
  • Orange
  • Purple
  • diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index d1df8468b24..79145ef3cda 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -224,7 +224,7 @@ padding-top: 51px; - +

    Product Name

    - +