From c0a2f48869a14b6f90f47770f34b4481b53ad7bd Mon Sep 17 00:00:00 2001 From: Vidhin Mehta Date: Fri, 1 Feb 2013 17:42:15 +0530 Subject: [PATCH 01/98] [IMP]disable attachments on list view. bzr revid: vme@tinyerp.com-20130201121215-6x55ww50kwjast1a --- addons/document/static/src/js/document.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/document/static/src/js/document.js b/addons/document/static/src/js/document.js index 23f1375e8c8..6ba25b58292 100644 --- a/addons/document/static/src/js/document.js +++ b/addons/document/static/src/js/document.js @@ -3,6 +3,7 @@ openerp.document = function (instance) { instance.web.Sidebar.include({ init : function(){ this._super.apply(this, arguments); + if (this.getParent().fields_view.type === "tree") return; this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), }); this.items['files'] = []; }, From fca9be00b0c204924d525293d8b082ef903b17ba Mon Sep 17 00:00:00 2001 From: Vidhin Mehta Date: Fri, 1 Feb 2013 17:47:13 +0530 Subject: [PATCH 02/98] [REM]override on_record_moved removed.not useable bzr revid: vme@tinyerp.com-20130201121713-ux3pegin1ywd5gj9 --- addons/project/static/src/js/project.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js index ce8be146e54..a4e899a8714 100644 --- a/addons/project/static/src/js/project.js +++ b/addons/project/static/src/js/project.js @@ -32,12 +32,6 @@ openerp.project = function(openerp) { if (self.dataset.model === 'project.project') { self.project_display_members_names(); } - }, - on_record_moved: function(record, old_group, old_index, new_group, new_index){ - var self = this; - this._super.apply(this, arguments); - if(new_group.state.folded) - new_group.do_action_toggle_fold(); } }); From 9778533d7ee241541deca9614cd5e8660f75607c Mon Sep 17 00:00:00 2001 From: Dhruti Shastri Date: Wed, 6 Feb 2013 11:48:32 +0530 Subject: [PATCH 03/98] [res_country] : Create country without code or remove country code raise error bzr revid: dhs@tinyerp.com-20130206061832-r9s9m9oco6uwdg4j --- openerp/addons/base/res/res_country.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/res/res_country.py b/openerp/addons/base/res/res_country.py index 6ed4e76fa78..29d6c8ab3b7 100644 --- a/openerp/addons/base/res/res_country.py +++ b/openerp/addons/base/res/res_country.py @@ -71,13 +71,13 @@ addresses belonging to this country.\n\nYou can use the python-style string pate name_search = location_name_search def create(self, cursor, user, vals, context=None): - if vals.get('code'): + if vals.get('code',False): vals['code'] = vals['code'].upper() return super(Country, self).create(cursor, user, vals, context=context) def write(self, cursor, user, ids, vals, context=None): - if 'code' in vals: + if vals.get('code',False): vals['code'] = vals['code'].upper() return super(Country, self).write(cursor, user, ids, vals, context=context) From 430b6c07a7f714949d833e7fd0e9b68cc4b2bc86 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 29 Apr 2013 15:48:49 +0530 Subject: [PATCH 04/98] [IMP]HR: Improve Application form some field label Improve meeting logs for Application Form Set My Requests instead of My Leaves bzr revid: dbr@tinyerp.com-20130429101849-1iz7d52jvgxwsbfu --- addons/hr_holidays/hr_holidays_view.xml | 2 +- addons/hr_recruitment/hr_recruitment.py | 26 +++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 5828790c152..cc3813b7240 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index e41d80fb348..3ec36886edb 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -186,7 +186,7 @@ class hr_applicant(base_stage, osv.Model): return res _columns = { - 'name': fields.char('Subject', size=128, required=True), + 'name': fields.char('Application Name', size=128, required=True), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."), 'description': fields.text('Description'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), @@ -219,7 +219,7 @@ class hr_applicant(base_stage, osv.Model): 'salary_expected_extra': fields.char('Expected Salary Extra', size=100, help="Salary Expected by Applicant, extra advantages"), 'salary_proposed': fields.float('Proposed Salary', help="Salary Proposed by the Organisation"), 'salary_expected': fields.float('Expected Salary', help="Salary Expected by Applicant"), - 'availability': fields.integer('Availability'), + 'availability': fields.integer('Availability', help="The number of days in which the applicant will be available to start working"), 'partner_name': fields.char("Applicant's Name", size=64), 'partner_phone': fields.char('Phone', size=32), 'partner_mobile': fields.char('Mobile', size=32), @@ -306,6 +306,14 @@ class hr_applicant(base_stage, osv.Model): return stage_ids[0] return False + def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): + if not duration: + duration = _('unknown') + else: + duration = str(duration) + message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting_date, meeting_subject, duration) + return self.message_post(cr, uid, ids, body=message,context=context) + def action_makeMeeting(self, cr, uid, ids, context=None): """ This opens Meeting's calendar view to schedule meeting on current applicant @return: Dictionary value for created Meeting view @@ -314,6 +322,7 @@ class hr_applicant(base_stage, osv.Model): category = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_recruitment', 'categ_meet_interview', context) res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { + 'default_applicant_id':applicant.id, 'default_partner_ids': applicant.partner_id and [applicant.partner_id.id] or False, 'default_user_id': uid, 'default_name': applicant.name, @@ -562,4 +571,17 @@ class applicant_category(osv.osv): 'name': fields.char('Name', size=64, required=True, translate=True), } +class crm_meeting(osv.Model): + _inherit = 'crm.meeting' + _columns = { + 'applicant_id': fields.many2one ('hr.applicant', 'Recruitment') + } + + def create(self, cr, uid, vals, context=None): + res = super(crm_meeting, self).create(cr, uid, vals, context=context) + obj = self.browse(cr, uid, res, context=context) + if obj.applicant_id: + self.pool.get('hr.applicant').log_meeting(cr, uid, [obj.applicant_id.id] , obj.name, obj.date,obj.duration, context=context) + return res + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 76491b781a9614aec7a4ade332ae9cbff8c0e84b Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 1 May 2013 18:55:25 +0530 Subject: [PATCH 05/98] [IMP]: Improve typo bzr revid: dbr@tinyerp.com-20130501132525-04ebuxo5usmsi0av --- addons/hr_recruitment/hr_recruitment.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 3ec36886edb..1d19fc6b204 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -578,10 +578,10 @@ class crm_meeting(osv.Model): } def create(self, cr, uid, vals, context=None): - res = super(crm_meeting, self).create(cr, uid, vals, context=context) - obj = self.browse(cr, uid, res, context=context) - if obj.applicant_id: - self.pool.get('hr.applicant').log_meeting(cr, uid, [obj.applicant_id.id] , obj.name, obj.date,obj.duration, context=context) - return res + meeting_id = super(crm_meeting, self).create(cr, uid, vals, context=context) + obj_meeting = self.browse(cr, uid, meeting_id, context=context) + if obj_meeting.applicant_id: + self.pool.get('hr.applicant').log_meeting(cr, uid, [obj_meeting.applicant_id.id] , obj_meeting.name, obj_meeting.date,obj_meeting.duration, context=context) + return meeting_id # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From f7bb48d3b173abb6f9a57ff86870ff4e36e46fe1 Mon Sep 17 00:00:00 2001 From: Vidhin Mehta Date: Fri, 17 May 2013 15:02:22 +0530 Subject: [PATCH 06/98] [IMP] show button bottom of card. bzr revid: vme@tinyerp.com-20130517093222-r62lgqhgx3xnryd9 --- addons/mail/static/src/css/mail_group.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index 4f2b8a16dd0..5ba817aa1a5 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -91,7 +91,9 @@ } .openerp .oe_group_button { - padding-top: 7px; + position: absolute; + padding-bottom: 50px; + bottom: 0; } .openerp .oe_group_button .oe_group_join { From 1cdc9245e7fccff0e9bf5d83363a210c71445e3e Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 27 May 2013 17:47:04 +0530 Subject: [PATCH 07/98] [IMP]Hr: Improve tooltip and labels bzr revid: dbr@tinyerp.com-20130527121704-k7fyapvs0ogfdamx --- addons/hr_holidays/hr_holidays_view.xml | 2 +- addons/hr_recruitment/hr_recruitment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index cc3813b7240..6ff0b2efc9a 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index f4069ed70ab..4fd0c15202a 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -186,7 +186,7 @@ class hr_applicant(base_stage, osv.Model): return res _columns = { - 'name': fields.char('Application Name', size=128, required=True), + 'name': fields.char('Subject / Application Name', size=128, required=True), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."), 'description': fields.text('Description'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), From c7c84a8695b629aa4158721ac551375a94f833c9 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Tue, 28 May 2013 11:13:39 +0530 Subject: [PATCH 08/98] [IMP]hr_recruitment: Improve code with active id and remove the extra field bzr revid: prajapatijitendra7969@gmail.com-20130528054339-1dqdc6ytwu5nyi75 --- addons/hr_recruitment/hr_recruitment.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 4fd0c15202a..364a4a851df 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -322,7 +322,6 @@ class hr_applicant(base_stage, osv.Model): category = self.pool.get('ir.model.data').get_object(cr, uid, 'hr_recruitment', 'categ_meet_interview', context) res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { - 'default_applicant_id':applicant.id, 'default_partner_ids': applicant.partner_id and [applicant.partner_id.id] or False, 'default_user_id': uid, 'default_name': applicant.name, @@ -576,15 +575,11 @@ class applicant_category(osv.osv): class crm_meeting(osv.Model): _inherit = 'crm.meeting' - _columns = { - 'applicant_id': fields.many2one ('hr.applicant', 'Recruitment') - } def create(self, cr, uid, vals, context=None): meeting_id = super(crm_meeting, self).create(cr, uid, vals, context=context) obj_meeting = self.browse(cr, uid, meeting_id, context=context) - if obj_meeting.applicant_id: - self.pool.get('hr.applicant').log_meeting(cr, uid, [obj_meeting.applicant_id.id] , obj_meeting.name, obj_meeting.date,obj_meeting.duration, context=context) + self.pool.get('hr.applicant').log_meeting(cr, uid, context.get('active_ids',[]), obj_meeting.name, obj_meeting.date, obj_meeting.duration, context=context) return meeting_id # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From cf322c62acd67bef490d2d65cfde90085e648f00 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Tue, 28 May 2013 12:00:31 +0530 Subject: [PATCH 09/98] [IMP]hr_holidays:Remove the extra space bzr revid: prajapatijitendra7969@gmail.com-20130528063031-ad6gp45az42q9018 --- addons/hr_holidays/hr_holidays_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 6ff0b2efc9a..43c659847fc 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -14,7 +14,7 @@ - + From 86abcbf3bbc3ac597221c6af5a3d69933da090e5 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 29 May 2013 13:08:28 +0530 Subject: [PATCH 10/98] [IMP]hr_recruitment: remove label from tree so .py code effect bzr revid: dbr@tinyerp.com-20130529073828-a77uw29ijqpkw2ib --- addons/hr_recruitment/hr_recruitment_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 716c1cba8d5..c3757508b38 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -42,7 +42,7 @@ - + From 516d7fbb4330f9d937eaf458c82411b6e855b8bc Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 3 Jun 2013 18:09:20 +0530 Subject: [PATCH 11/98] [IMP]hr_recruit : Improve create method and Improve lfilter help as per suggest bzr revid: dbr@tinyerp.com-20130603123920-6spa009pzvrhzxos --- addons/hr_holidays/hr_holidays_view.xml | 2 +- addons/hr_recruitment/hr_recruitment.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 43c659847fc..1d6d2227e84 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -14,7 +14,7 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 364a4a851df..8fc104bf34f 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -577,9 +577,8 @@ class crm_meeting(osv.Model): _inherit = 'crm.meeting' def create(self, cr, uid, vals, context=None): - meeting_id = super(crm_meeting, self).create(cr, uid, vals, context=context) - obj_meeting = self.browse(cr, uid, meeting_id, context=context) - self.pool.get('hr.applicant').log_meeting(cr, uid, context.get('active_ids',[]), obj_meeting.name, obj_meeting.date, obj_meeting.duration, context=context) - return meeting_id + if 'active_ids' in context and 'active_model' in context and context['active_model'] == 'hr.applicant': + self.pool.get('hr.applicant').log_meeting(cr, uid, context['active_ids'], vals['name'], vals['date'], vals['duration'], context=context) + return super(crm_meeting, self).create(cr, uid, vals, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 33594d9d6755068c2a2bc3855967345e65412174 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 7 Jun 2013 13:21:24 +0530 Subject: [PATCH 12/98] [IMP]hr_recruite: If in any case no duration tn imp msg as MP suggest bzr revid: dbr@tinyerp.com-20130607075124-x70f2dl5vb6e3s8u --- addons/hr_recruitment/hr_recruitment.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index f1c2f3939c2..affacf10d61 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -308,10 +308,9 @@ class hr_applicant(base_stage, osv.Model): def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): if not duration: - duration = _('unknown') + message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting_date, meeting_subject) else: - duration = str(duration) - message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting_date, meeting_subject, duration) + message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting_date, meeting_subject, str(duration)) return self.message_post(cr, uid, ids, body=message,context=context) def action_makeMeeting(self, cr, uid, ids, context=None): From 2e3ec5e2e92b76703eecb76d31c085157aba5b98 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 3 Jul 2013 18:42:23 +0530 Subject: [PATCH 13/98] [FIX]Fixed the issue of last element of grouped row removed, due to which grouped total information also got lost. bzr revid: msh@openerp.com-20130703131223-bwu6hl8v5y5sjt5w --- addons/web/static/src/js/view_list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 74c2fc47aee..a9f110eac28 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1280,7 +1280,8 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we } }, close: function () { - this.$row.children().last().empty(); + this.$row.children().last().find('button').remove(); + this.$row.children().last().find('span').remove(); this.records.reset(); }, /** From 89d03a854ada9de9cc14c896805f0daa08cfbdfe Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 22 Aug 2013 18:05:34 +0530 Subject: [PATCH 14/98] [IMP]base_calander: Add create method for crm.meeting Update the Doc remove crm.meeting inheritance from .py file bzr revid: dbr@tinyerp.com-20130822123534-zx3uxdjojoj55bqn --- addons/base_calendar/crm_meeting.py | 9 +++++++++ addons/hr_recruitment/doc/changelog.rst | 2 ++ addons/hr_recruitment/hr_recruitment.py | 10 +--------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 66823e0b8f4..38d3683fabd 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -64,6 +64,15 @@ class crm_meeting(osv.Model): 'state': 'open', } + def create(self, cr, uid, vals, context=None): + if context is None: + context = {} + res = super(crm_meeting, self).create(cr, uid, vals, context=context) + obj = self.browse(cr, uid, res, context=context) + if 'active_model' in context and context['active_model'] == 'hr.applicant': + self.pool.get('hr.applicant').log_meeting_in_parent(cr, uid, context['active_ids'], vals['name'], vals['date'], vals['duration'], context=context) + return res + def message_get_subscription_data(self, cr, uid, ids, context=None): res = {} for virtual_id in ids: diff --git a/addons/hr_recruitment/doc/changelog.rst b/addons/hr_recruitment/doc/changelog.rst index 404b94ee6d1..7fb714c8ea0 100644 --- a/addons/hr_recruitment/doc/changelog.rst +++ b/addons/hr_recruitment/doc/changelog.rst @@ -14,3 +14,5 @@ Changelog - ``hr.recruitment.stage``: removed ``state`` field. - Removed ``hired.employee`` wizard. + +- Add new method ``log_meeting_in_parent``. diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index cf091925c92..e168749ef35 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -281,7 +281,7 @@ class hr_applicant(osv.Model): return stage_ids[0] return False - def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): + def log_meeting_in_parent(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): if not duration: message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting_date, meeting_subject) else: @@ -518,12 +518,4 @@ class applicant_category(osv.osv): 'name': fields.char('Name', size=64, required=True, translate=True), } -class crm_meeting(osv.Model): - _inherit = 'crm.meeting' - - def create(self, cr, uid, vals, context=None): - if 'active_ids' in context and 'active_model' in context and context['active_model'] == 'hr.applicant': - self.pool.get('hr.applicant').log_meeting(cr, uid, context['active_ids'], vals['name'], vals['date'], vals['duration'], context=context) - return super(crm_meeting, self).create(cr, uid, vals, context=context) - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From cb15c354dd73e638c1eaf0287d6aabec7f53daea Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Aug 2013 15:06:17 +0530 Subject: [PATCH 15/98] [IMP]:Update label bzr revid: dbr@tinyerp.com-20130823093617-3aa3h798n6ydt0m1 --- addons/hr_recruitment/hr_recruitment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 443ec911e0d..00646c2dc46 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -171,7 +171,7 @@ class hr_applicant(osv.Model): return res _columns = { - 'name': fields.char('Subject / Application Name', size=128, required=True), + 'name': fields.char('Subject', size=128, required=True), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."), 'description': fields.text('Description'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), From d7f420c586893ca792b11f4bdad15a9de38382d5 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 29 Aug 2013 18:47:19 +0530 Subject: [PATCH 16/98] [IMP]set log_meeting_in_parent method in base_calender bzr revid: dbr@tinyerp.com-20130829131719-2nho1zsqv1ccsj6w --- addons/base_calendar/crm_meeting.py | 23 ++++++++++++++++++----- addons/hr_recruitment/hr_recruitment.py | 8 +------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 38d3683fabd..d54df072f0e 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -67,11 +67,24 @@ class crm_meeting(osv.Model): def create(self, cr, uid, vals, context=None): if context is None: context = {} - res = super(crm_meeting, self).create(cr, uid, vals, context=context) - obj = self.browse(cr, uid, res, context=context) - if 'active_model' in context and context['active_model'] == 'hr.applicant': - self.pool.get('hr.applicant').log_meeting_in_parent(cr, uid, context['active_ids'], vals['name'], vals['date'], vals['duration'], context=context) - return res + meeting_id = super(crm_meeting, self).create(cr, uid, vals, context=context) + if context.get('log_meeting_in_parent'): + self.log_meeting_in_parent(cr, uid, [meeting_id], context=context) + return meeting_id + + def log_meeting_in_parent(self, cr, uid, ids, context=None): + if context is None: + context = {} + parent_model = context.get('active_model',False) + parent_ids = context.get('active_ids', False) + for meeting in self.browse(cr, uid, ids, context=context): + message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) + if meeting.duration: + message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting.date, meeting.name, str(meeting.duration)) + if parent_model and parent_ids: + self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) + return True + def message_get_subscription_data(self, cr, uid, ids, context=None): res = {} diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 00646c2dc46..df55a1942f3 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -281,13 +281,6 @@ class hr_applicant(osv.Model): return stage_ids[0] return False - def log_meeting_in_parent(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): - if not duration: - message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting_date, meeting_subject) - else: - message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting_date, meeting_subject, str(duration)) - return self.message_post(cr, uid, ids, body=message,context=context) - def action_makeMeeting(self, cr, uid, ids, context=None): """ This opens Meeting's calendar view to schedule meeting on current applicant @return: Dictionary value for created Meeting view @@ -300,6 +293,7 @@ class hr_applicant(osv.Model): 'default_user_id': uid, 'default_name': applicant.name, 'default_categ_ids': category and [category.id] or False, + 'log_meeting_in_parent': True, } return res From 1de73ce6dea8b1be5936cb4059d46e76d1c94736 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 30 Aug 2013 13:54:04 +0530 Subject: [PATCH 17/98] [IMP]base_calendar: Improve code bzr revid: dbr@tinyerp.com-20130830082404-wgk67mq1sltcg2xi --- addons/base_calendar/crm_meeting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index d54df072f0e..ba4b21a65d6 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -77,11 +77,11 @@ class crm_meeting(osv.Model): context = {} parent_model = context.get('active_model',False) parent_ids = context.get('active_ids', False) - for meeting in self.browse(cr, uid, ids, context=context): - message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) - if meeting.duration: - message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting.date, meeting.name, str(meeting.duration)) - if parent_model and parent_ids: + if parent_model and parent_ids: + for meeting in self.browse(cr, uid, ids, context=context): + message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) + if meeting.duration: + message = message+_("
Duration: %s hour(s)") % (str(meeting.duration)) self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) return True From 7ecff57509ec7d1e17760341f82c6c0011f097ac Mon Sep 17 00:00:00 2001 From: "Pinakin Nayi (OpenERP)" Date: Fri, 6 Sep 2013 16:12:51 +0530 Subject: [PATCH 18/98] [FIX]res_user : replace field to show latest connection in tree view bzr revid: pna@tinyerp.com-20130906104251-lf0584j6q5hm2sfm --- openerp/addons/base/res/res_users_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_users_view.xml b/openerp/addons/base/res/res_users_view.xml index 7e83b43179f..5708dbca21e 100644 --- a/openerp/addons/base/res/res_users_view.xml +++ b/openerp/addons/base/res/res_users_view.xml @@ -194,7 +194,7 @@ - +
From efc8bb37a92fe2079eca0d163e7236b1fb33519f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 10 Sep 2013 18:42:05 +0530 Subject: [PATCH 19/98] [IMP]Improve code for crm also bzr revid: dbr@tinyerp.com-20130910131205-39cwpiik2ncs6wcn --- addons/base_calendar/crm_meeting.py | 4 +++- addons/crm/crm_lead.py | 8 -------- addons/crm/crm_meeting.py | 8 -------- addons/hr_recruitment/hr_recruitment.py | 1 - 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index ba4b21a65d6..11e1794f862 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -68,7 +68,9 @@ class crm_meeting(osv.Model): if context is None: context = {} meeting_id = super(crm_meeting, self).create(cr, uid, vals, context=context) - if context.get('log_meeting_in_parent'): + parent_model = context.get('active_model',False) + parent_ids = context.get('active_ids', False) + if parent_model and parent_ids: self.log_meeting_in_parent(cr, uid, [meeting_id], context=context) return meeting_id diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index c4e2cbdc91d..260e634af9b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -1008,14 +1008,6 @@ class crm_lead(format_address, osv.osv): message = _("%s a call for %s.%s") % (prefix, phonecall.date, suffix) return self.message_post(cr, uid, ids, body=message, context=context) - def log_meeting(self, cr, uid, ids, meeting_subject, meeting_date, duration, context=None): - if not duration: - duration = _('unknown') - else: - duration = str(duration) - message = _("Meeting scheduled at '%s'
Subject: %s
Duration: %s hour(s)") % (meeting_date, meeting_subject, duration) - return self.message_post(cr, uid, ids, body=message, context=context) - def onchange_state(self, cr, uid, ids, state_id, context=None): if state_id: country_id=self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index c31907bebe2..c65576f16c6 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -34,14 +34,6 @@ class crm_meeting(osv.Model): 'opportunity_id': fields.many2one ('crm.lead', 'Opportunity', domain="[('type', '=', 'opportunity')]"), } - def create(self, cr, uid, vals, context=None): - res = super(crm_meeting, self).create(cr, uid, vals, context=context) - obj = self.browse(cr, uid, res, context=context) - if obj.opportunity_id: - self.pool.get('crm.lead').log_meeting(cr, uid, [obj.opportunity_id.id], obj.name, obj.date, obj.duration, context=context) - return res - - class calendar_attendee(osv.osv): """ Calendar Attendee """ diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 1cb75c37953..344e10260de 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -295,7 +295,6 @@ class hr_applicant(osv.Model): 'default_user_id': uid, 'default_name': applicant.name, 'default_categ_ids': category and [category.id] or False, - 'log_meeting_in_parent': True, } return res From 1339e242263fd94cf6b3a5658b647a7656a5f1c4 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 10 Sep 2013 18:47:04 +0530 Subject: [PATCH 20/98] [IMP] Label name improve bzr revid: dbr@tinyerp.com-20130910131704-mawfghrz42jow31r --- addons/hr_recruitment/hr_recruitment.py | 2 +- addons/hr_recruitment/hr_recruitment_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 344e10260de..ff922a1cee3 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -171,7 +171,7 @@ class hr_applicant(osv.Model): return res _columns = { - 'name': fields.char('Subject', size=128, required=True), + 'name': fields.char('Subject / Application Name', size=128, required=True), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."), 'description': fields.text('Description'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 3bf09d21a17..98f1170ecb7 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -44,7 +44,7 @@ - + From d0923892c2eb2c2995a3c67191a933273e989935 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 10 Sep 2013 18:55:23 +0530 Subject: [PATCH 21/98] [IMP]Improve code bzr revid: dbr@tinyerp.com-20130910132523-5xbkmrn1gss7p2tv --- addons/base_calendar/crm_meeting.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 11e1794f862..93bbe66389b 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -77,14 +77,13 @@ class crm_meeting(osv.Model): def log_meeting_in_parent(self, cr, uid, ids, context=None): if context is None: context = {} - parent_model = context.get('active_model',False) - parent_ids = context.get('active_ids', False) - if parent_model and parent_ids: - for meeting in self.browse(cr, uid, ids, context=context): - message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) - if meeting.duration: - message = message+_("
Duration: %s hour(s)") % (str(meeting.duration)) - self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) + parent_model = context.get('active_model') + parent_ids = context.get('active_ids') + for meeting in self.browse(cr, uid, ids, context=context): + message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) + if meeting.duration: + message = message+_("
Duration: %s hour(s)") % (str(meeting.duration)) + self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) return True From 6f44a53ca847a76dcb74510225365e84cdff1114 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 11 Sep 2013 14:38:55 +0530 Subject: [PATCH 22/98] [IMP] Add condition bzr revid: dbr@tinyerp.com-20130911090855-98upgcnn57bbx63y --- addons/base_calendar/crm_meeting.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 93bbe66389b..b5757f34c3f 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -79,11 +79,12 @@ class crm_meeting(osv.Model): context = {} parent_model = context.get('active_model') parent_ids = context.get('active_ids') - for meeting in self.browse(cr, uid, ids, context=context): - message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) - if meeting.duration: - message = message+_("
Duration: %s hour(s)") % (str(meeting.duration)) - self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) + if parent_model in self.pool and hasattr(self.pool[parent_model], 'message_post'): + for meeting in self.browse(cr, uid, ids, context=context): + message = _("Meeting scheduled at '%s'
Subject: %s") % (meeting.date, meeting.name) + if meeting.duration: + message = message+_("
Duration: %s hour(s)") % (str(meeting.duration)) + self.pool.get(parent_model).message_post(cr, uid, parent_ids, body=message,context=context) return True From f07e01f491c38a278c844b25775bd477fd704d32 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 25 Oct 2013 17:38:29 +0200 Subject: [PATCH 23/98] [ADD]mail: The announcement bar (blue bar) to inform customers bzr revid: dle@openerp.com-20131025153829-xu6mee27a4hajnk3 --- addons/mail/__openerp__.py | 2 ++ addons/mail/static/src/js/announcement.js | 21 +++++++++++++++++++++ addons/mail/static/src/js/mail.js | 1 + addons/mail/static/src/xml/announcement.xml | 13 +++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 addons/mail/static/src/js/announcement.js create mode 100644 addons/mail/static/src/xml/announcement.xml diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 63cd0888986..2939f9a8bb4 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -87,10 +87,12 @@ Main Features 'static/src/js/mail.js', 'static/src/js/mail_followers.js', 'static/src/js/many2many_tags_email.js', + 'static/src/js/announcement.js', ], 'qweb': [ 'static/src/xml/mail.xml', 'static/src/xml/mail_followers.xml', + 'static/src/xml/announcement.xml', ], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js new file mode 100644 index 00000000000..7d16a4a1621 --- /dev/null +++ b/addons/mail/static/src/js/announcement.js @@ -0,0 +1,21 @@ +openerp_announcement = function(instance) { + var _t = instance.web._t; + instance.web.WebClient.include({ + show_application: function() { + var self = this; + this._super(); + var config_parameter = new instance.web.Model('ir.config_parameter'); + return config_parameter.call('get_param', ['database.uuid', false]).then(function(result) { + var head = $('head'); + head.append($('') + .attr({ + rel : 'stylesheet', + type: 'text/css', + href: 'http://127.0.0.1.xip.io:8369/openerp_enterprise/'+result+'.css', + media: 'all', + }) + ); + }); + }, + }); +}; \ No newline at end of file diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 63581560810..96b2184ece9 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -6,6 +6,7 @@ openerp.mail = function (session) { openerp_mail_followers(session, mail); // import mail_followers.js openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js + openerp_announcement(session); /** * ------------------------------------------------------------ diff --git a/addons/mail/static/src/xml/announcement.xml b/addons/mail/static/src/xml/announcement.xml new file mode 100644 index 00000000000..cda0569d7ee --- /dev/null +++ b/addons/mail/static/src/xml/announcement.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file From eba79e46a53f0977b08af108c1fb2f0ad5421ee9 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 2 Dec 2013 12:45:16 +0100 Subject: [PATCH 24/98] [FIX] mail: correct announcement bar bzr revid: chs@openerp.com-20131202114516-u0u44l3xbkk1zcbx --- addons/mail/__openerp__.py | 1 + addons/mail/static/src/css/announcement.css | 3 + addons/mail/static/src/js/announcement.js | 65 +++++++++++++++------ addons/mail/static/src/xml/announcement.xml | 22 +++---- 4 files changed, 62 insertions(+), 29 deletions(-) create mode 100644 addons/mail/static/src/css/announcement.css diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 2939f9a8bb4..47a77e0d9cb 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -81,6 +81,7 @@ Main Features 'css': [ 'static/src/css/mail.css', 'static/src/css/mail_group.css', + 'static/src/css/announcement.css', ], 'js': [ 'static/lib/jquery.expander/jquery.expander.js', diff --git a/addons/mail/static/src/css/announcement.css b/addons/mail/static/src/css/announcement.css new file mode 100644 index 00000000000..5d2a0ecba44 --- /dev/null +++ b/addons/mail/static/src/css/announcement.css @@ -0,0 +1,3 @@ +.openerp .annoucement_bar { + display: none; +} diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js index 7d16a4a1621..e05d959dede 100644 --- a/addons/mail/static/src/js/announcement.js +++ b/addons/mail/static/src/js/announcement.js @@ -1,21 +1,50 @@ openerp_announcement = function(instance) { - var _t = instance.web._t; - instance.web.WebClient.include({ - show_application: function() { - var self = this; - this._super(); - var config_parameter = new instance.web.Model('ir.config_parameter'); - return config_parameter.call('get_param', ['database.uuid', false]).then(function(result) { - var head = $('head'); - head.append($('') - .attr({ - rel : 'stylesheet', - type: 'text/css', - href: 'http://127.0.0.1.xip.io:8369/openerp_enterprise/'+result+'.css', - media: 'all', - }) - ); - }); + instance.web.WebClient.include({ + show_application: function() { + return $.when(this._super.apply(this, arguments)).then(this.proxy('show_annoucement_bar')); }, + _ab_location: function(dbuuid) { + return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid); + }, + show_annoucement_bar: function() { + if (this.session.get_cookie('ab') === 'c') { + return; + } + var self = this; + var config_parameter = new instance.web.Model('ir.config_parameter'); + var $bar = this.$el.find('.announcement_bar'); + return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) { + if (!dbuuid) { + return; + } + var $css = $('').attr({ + rel : 'stylesheet', + type: 'text/css', + media: 'all', + href: self._ab_location(dbuuid) + }); + $css.on('load', function() { + var close = function() { + var data = window.getComputedStyle($bar.find('.data')[0], ':before').content || "'{}'"; + var delim = data[0]; + data = data.slice(1, data.length - 1).replace(new RegExp('\\\\'+delim, 'g'), delim); + try { + data = JSON.parse(data); + } catch(_e) { + data = {}; + } + var ttl = data.close_ttl || 24*60*60; + self.session.set_cookie('ab', 'c', ttl); + + $bar.slideUp('slow'); + }; + $bar.on('dblclick', close); + $bar.find('.close').on('click', close); + self.trigger('ab_loaded', $bar); + }); + + $('head').append($css); + }); + } }); -}; \ No newline at end of file +}; diff --git a/addons/mail/static/src/xml/announcement.xml b/addons/mail/static/src/xml/announcement.xml index cda0569d7ee..1eabb5ebc6b 100644 --- a/addons/mail/static/src/xml/announcement.xml +++ b/addons/mail/static/src/xml/announcement.xml @@ -1,13 +1,13 @@ - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + From b3391cd7fef94c4e82b4330db37213c08740d055 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Tue, 3 Dec 2013 18:08:56 +0530 Subject: [PATCH 25/98] [FIX]Web: Fixed the issue of immediate update of many2one field when many2one object name has been changed from follow button popup, reloaded the record from database forcefull to update dataaset, do not call form-blur when follow button is clicked, also do not evict record when record is still not created. bzr revid: msh@openerp.com-20131203123856-gce4li1igo9k1mak --- addons/web/static/src/js/data.js | 9 +++++++++ addons/web/static/src/js/view_form.js | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index d497cf25343..e1290deac02 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -920,6 +920,15 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ * @param {Object} id record to remove from the BDS's cache */ evict_record: function (id) { + // Don't evict records which haven't yet been saved: there is no more + // recent data on the server (and there potentially isn't any data), + // and this breaks the assumptions of other methods (that the data + // for new and altered records is both in the cache and in the to_write + // or to_create collection) + if (_(this.to_create.concat(this.to_write)).find(function (record) { + return record.id === id; })) { + return; + } for(var i=0, len=this.cache.length; i Date: Tue, 3 Dec 2013 16:17:53 +0100 Subject: [PATCH 26/98] [FIX] font: add columns for family, path and mode bzr revid: mat@openerp.com-20131203151753-ycz8pyp1eg382qps --- openerp/addons/base/res/res_company.py | 7 +-- openerp/addons/base/res/res_company_view.xml | 2 +- openerp/addons/base/res/res_font.py | 53 +++++++++----------- openerp/report/render/rml2pdf/customfonts.py | 6 +-- 4 files changed, 32 insertions(+), 36 deletions(-) diff --git a/openerp/addons/base/res/res_company.py b/openerp/addons/base/res/res_company.py index 6e74dbf1547..0f6d4bed133 100644 --- a/openerp/addons/base/res/res_company.py +++ b/openerp/addons/base/res/res_company.py @@ -298,8 +298,9 @@ class res_company(osv.osv): if res: return res[0] - font_obj.init_no_scan(cr, uid) - return font_obj.search(cr, uid, [('name', '=', 'Helvetica')], limit=1)[0] + font_obj.init_scan(cr, uid) + res = font_obj.search(cr, uid, [('name', '=', 'Helvetica')], limit=1) + return res and res[0] or False _header = """
@@ -396,7 +397,7 @@ class res_company(osv.osv): return {'value': {'rml_header': self._header_a4}} def act_discover_fonts(self, cr, uid, ids, context=None): - return self.pool.get("res.font").discover_fonts(cr, uid, ids, context) + return self.pool.get("res.font").init_scan(cr, uid, context) _defaults = { 'currency_id': _get_euro, diff --git a/openerp/addons/base/res/res_company_view.xml b/openerp/addons/base/res/res_company_view.xml index 3fccba944f9..aeced970f0e 100644 --- a/openerp/addons/base/res/res_company_view.xml +++ b/openerp/addons/base/res/res_company_view.xml @@ -85,7 +85,7 @@
""" @@ -348,13 +348,13 @@ class res_company(osv.osv): - + - + [[ company.logo or removeParentNode('image') ]] diff --git a/openerp/report/render/rml2pdf/customfonts.py b/openerp/report/render/rml2pdf/customfonts.py index a7138b269ee..82d14e0803b 100644 --- a/openerp/report/render/rml2pdf/customfonts.py +++ b/openerp/report/render/rml2pdf/customfonts.py @@ -94,7 +94,7 @@ def SetCustomFonts(rmldoc): """ for family, font, filename, mode in CustomTTFonts: if os.path.isabs(filename) and os.path.exists(filename): - rmldoc.setTTFontMapping(font, family, filename, mode) + rmldoc.setTTFontMapping(family, font, filename, mode) return True # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 2e197cbb98a14bb96302136cee9ecab75a68159f Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 9 Dec 2013 15:11:11 +0100 Subject: [PATCH 43/98] [IMP] Batch for the computation of function's stored values is now customizable bzr revid: cto@openerp.com-20131209141111-tbg9x1h8l6neu0ml --- openerp/osv/orm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 9e6ee64d87f..5c9c7802863 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -79,6 +79,9 @@ from openerp.tools import SKIPPED_ELEMENT_TYPES regex_order = re.compile('^(([a-z0-9_]+|"[a-z0-9_]+")( *desc| *asc)?( *, *|))+$', re.I) regex_object_name = re.compile(r'^[a-z0-9_.]+$') +# TODO for trunk, raise the value to 1000 +AUTOINIT_RECALCULATE_STORED_FIELDS = 40 + def transfer_field_to_modifiers(field, modifiers): default_values = {} state_exceptions = {} @@ -2794,8 +2797,8 @@ class BaseModel(object): cr.execute('select id from '+self._table) ids_lst = map(lambda x: x[0], cr.fetchall()) while ids_lst: - iids = ids_lst[:40] - ids_lst = ids_lst[40:] + iids = ids_lst[:AUTOINIT_RECALCULATE_STORED_FIELDS] + ids_lst = ids_lst[AUTOINIT_RECALCULATE_STORED_FIELDS:] res = f.get(cr, self, iids, k, SUPERUSER_ID, {}) for key, val in res.items(): if f._multi: From aac5c9d6eb8eb240f9eab654bcc44ff0bc51f469 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 9 Dec 2013 16:14:54 +0100 Subject: [PATCH 44/98] [IMP] font: better handeling of multiworker environement bzr revid: mat@openerp.com-20131209151454-5rylu5alldd3ixmh --- openerp/addons/base/base_data.xml | 20 ++++++ openerp/addons/base/res/res_company.py | 7 +- openerp/addons/base/res/res_font.py | 72 +++++++++----------- openerp/report/render/rml2pdf/customfonts.py | 7 -- openerp/report/render/rml2pdf/trml2pdf.py | 7 +- 5 files changed, 60 insertions(+), 53 deletions(-) diff --git a/openerp/addons/base/base_data.xml b/openerp/addons/base/base_data.xml index 6a47325db39..093a72c6406 100644 --- a/openerp/addons/base/base_data.xml +++ b/openerp/addons/base/base_data.xml @@ -91,5 +91,25 @@ Administrator
+ + + Helvetica + Helvetica + /dev/null + all + + + Times + Times + /dev/null + all + + + Courier + Courier + /dev/null + all + + diff --git a/openerp/addons/base/res/res_company.py b/openerp/addons/base/res/res_company.py index 0678223f3d2..b46492d28d7 100644 --- a/openerp/addons/base/res/res_company.py +++ b/openerp/addons/base/res/res_company.py @@ -297,12 +297,7 @@ class res_company(osv.osv): def _get_font(self, cr, uid, ids): font_obj = self.pool.get('res.font') res = font_obj.search(cr, uid, [('family', '=', 'Helvetica'), ('mode', '=', 'all')], limit=1) - if res: - return res[0] - # not even the basic pdf fonts, initiate the db - font_obj._base_populate_font(cr, uid) - res = font_obj.search(cr, uid, [('family', '=', 'Helvetica'), ('mode', '=', 'all')], limit=1) - return res and res[0] or False + return res and res[0] or False _header = """
diff --git a/openerp/addons/base/res/res_font.py b/openerp/addons/base/res/res_font.py index a8ea2fe8cf8..cf437b5eae8 100644 --- a/openerp/addons/base/res/res_font.py +++ b/openerp/addons/base/res/res_font.py @@ -40,7 +40,7 @@ _logger = logging.getLogger(__name__) class res_font(osv.Model): _name = "res.font" _description = 'Fonts available' - _order = 'name,family,id' + _order = 'family,name,id' _rec_name = 'family' _columns = { @@ -54,65 +54,61 @@ class res_font(osv.Model): ('name_font_uniq', 'unique(family, name)', 'You can not register two fonts with the same name'), ] - def _base_populate_font(self, cr, uid, context=None): - if not self.search(cr, uid, [('path', '=', '/dev/null')], context=context): - # populate db with basic pdf fonts - for family, name, path, mode in customfonts.BasePDFFonts: - self.create(cr, uid, { - 'family': family, 'name': name, - 'path': path, 'mode': mode, - }, context=context) - return True - def font_scan(self, cr, uid, lazy=False, context=None): + """Action of loading fonts + In lazy mode will scan the filesystem only if there is no founts in the database and sync if no font in CustomTTFonts + In not lazy mode will force scan filesystem and sync + """ if lazy: # lazy loading, scan only if no fonts in db found_fonts_ids = self.search(cr, uid, [('path', '!=', '/dev/null')], context=context) if not found_fonts_ids: # no scan yet or no font found on the system, scan the filesystem - self._discover_fonts(cr, uid, context=context) - self._register_fonts(cr, uid, context=context) - else: - if len(customfonts.CustomTTFonts) == 0: - # CustomTTFonts list is empty - for font in self.browse(cr, uid, found_fonts_ids, context=context): - customfonts.CustomTTFonts.append((font.family, font.name, font.path, font.mode)) + self._scan_disk(cr, uid, context=context) + elif len(customfonts.CustomTTFonts) == 0: + # CustomTTFonts list is empty + self._sync(cr, uid, context=context) else: - self._discover_fonts(cr, uid, context=context) - self._register_fonts(cr, uid, context=context) + self._scan_disk(cr, uid, context=context) return True - def _discover_fonts(self, cr, uid, context=None): - """Scan fonts on the file system, add them to the list of known fonts - and create font object for the new ones""" - customfonts.CustomTTFonts = [] - - found_fonts = {} + def _scan_disk(self, cr, uid, context=None): + """Scan the file system and register the result in database""" + found_fonts = [] for font_path in customfonts.list_all_sysfonts(): try: font = ttfonts.TTFontFile(font_path) _logger.debug("Found font %s at %s", font.name, font_path) - if not found_fonts.get(font.familyName): - found_fonts[font.familyName] = {'name': font.familyName} - - mode = font.styleName.lower().replace(" ", "") - - customfonts.CustomTTFonts.append((font.familyName, font.name, font_path, mode)) + found_fonts.append((font.familyName, font.name, font_path, font.styleName)) except ttfonts.TTFError: _logger.warning("Could not register Font %s", font_path) - def _register_fonts(self, cr, uid, context=None): - # add new custom fonts - for family, name, path, mode in customfonts.CustomTTFonts: + for family, name, path, mode in found_fonts: if not self.search(cr, uid, [('family', '=', family), ('name', '=', name)], context=context): self.create(cr, uid, { 'family': family, 'name': name, 'path': path, 'mode': mode, }, context=context) - # remove fonts not present on disk - existing_font_names = [name for (family, name, path, mode) in customfonts.CustomTTFonts] + # remove fonts not present on the disk anymore + existing_font_names = [name for (family, name, path, mode) in found_fonts] inexistant_fonts = self.search(cr, uid, [('name', 'not in', existing_font_names), ('path', '!=', '/dev/null')], context=context) if inexistant_fonts: - return self.unlink(cr, uid, inexistant_fonts, context=context) + self.unlink(cr, uid, inexistant_fonts, context=context) + + self.clear_caches() + self._sync(cr, uid, context=context) return True + + def _sync(self, cr, uid, context=None): + """Set the customfonts.CustomTTFonts list to the content of the database""" + customfonts.CustomTTFonts = [] + found_fonts_ids = self.search(cr, uid, [('path', '!=', '/dev/null')], context=context) + for font in self.browse(cr, uid, found_fonts_ids, context=None): + customfonts.CustomTTFonts.append((font.family, font.name, font.path, font.mode)) + return True + + def clear_caches(self): + """Force worker to resync at next report loading by setting an empty font list""" + customfonts.CustomTTFonts = [] + return super(res_font, self).clear_caches() \ No newline at end of file diff --git a/openerp/report/render/rml2pdf/customfonts.py b/openerp/report/render/rml2pdf/customfonts.py index 82d14e0803b..a54359b4f0b 100644 --- a/openerp/report/render/rml2pdf/customfonts.py +++ b/openerp/report/render/rml2pdf/customfonts.py @@ -38,13 +38,6 @@ and Ubuntu distros, we have to override the search path, too. """ _logger = logging.getLogger(__name__) -# Basic fonts family included in PDF standart, will always be in the font list -BasePDFFonts = [ - ('Helvetica', 'Helvetica', '/dev/null', 'all'), - ('Times', 'Times', '/dev/null', 'all'), - ('Courier', 'Courier', '/dev/null', 'all'), -] - CustomTTFonts = [] # Search path for TTF files, in addition of rl_config.TTFSearchPath diff --git a/openerp/report/render/rml2pdf/trml2pdf.py b/openerp/report/render/rml2pdf/trml2pdf.py index b075b0f53ea..20da1a48db6 100644 --- a/openerp/report/render/rml2pdf/trml2pdf.py +++ b/openerp/report/render/rml2pdf/trml2pdf.py @@ -56,8 +56,11 @@ def select_fontname(fontname, default_fontname): try: pdfmetrics.getFont(fontname) except Exception: - _logger.warning('Could not locate font %s, substituting default: %s', - fontname, default_fontname) + addition = "" + if " " in fontname: + addition = ". Your font contains spaces which is not valid in RML." + _logger.warning('Could not locate font %s, substituting default: %s%s', + fontname, default_fontname, addition) fontname = default_fontname return fontname From 68aac8e85515f69b98492fd4c20a62004086595a Mon Sep 17 00:00:00 2001 From: Michel Meyer Date: Mon, 9 Dec 2013 16:35:19 +0100 Subject: [PATCH 45/98] [FIX] events handling ordering courtesy of Michel Meyer lead to errors during the validation of rows in list o2ms. See https://bugs.launchpad.net/openerp-web/+bug/1182101/comments/20 for an extensive description of the events and issue. bzr revid: xmo@openerp.com-20131209153519-n05bdx15t75dh7gf --- addons/web/static/src/js/view_form.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 080cd6f70aa..3893626520f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3822,7 +3822,6 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ GroupsType: instance.web.form.One2ManyGroups, ListType: instance.web.form.One2ManyList })); - this.on('edit:before', this, this.proxy('_before_edit')); this.on('edit:after', this, this.proxy('_after_edit')); this.on('save:before cancel:before', this, this.proxy('_before_unedit')); @@ -3943,11 +3942,10 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ }); }, - _before_edit: function () { + _after_edit: function () { this.__ignore_blur = false; this.editor.form.on('blurred', this, this._on_form_blur); - }, - _after_edit: function () { + // The form's blur thing may be jiggered during the edition setup, // potentially leading to the o2m instasaving the row. Cancel any // blurring triggered the edition startup here From b37d3b79899c60f3e605952d2e8965bfb3e6d458 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 9 Dec 2013 16:38:42 +0100 Subject: [PATCH 46/98] [FIX] font: trigger signal for clear cache instead on self bzr revid: mat@openerp.com-20131209153842-l13zfc24at7cfisc --- openerp/addons/base/res/res_font.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/res/res_font.py b/openerp/addons/base/res/res_font.py index cf437b5eae8..7fab654c6d6 100644 --- a/openerp/addons/base/res/res_font.py +++ b/openerp/addons/base/res/res_font.py @@ -20,6 +20,7 @@ ############################################################################## from reportlab.pdfbase import ttfonts +from openerp.modules.registry import RegistryManager from openerp.osv import fields, osv from openerp.report.render.rml2pdf import customfonts @@ -74,7 +75,7 @@ class res_font(osv.Model): def _scan_disk(self, cr, uid, context=None): """Scan the file system and register the result in database""" - found_fonts = [] + found_fonts = [] for font_path in customfonts.list_all_sysfonts(): try: font = ttfonts.TTFontFile(font_path) @@ -96,7 +97,7 @@ class res_font(osv.Model): if inexistant_fonts: self.unlink(cr, uid, inexistant_fonts, context=context) - self.clear_caches() + RegistryManager.signal_caches_change(cr.dbname) self._sync(cr, uid, context=context) return True From b48b746dd14e71f7cac6575fa908894fc5a258e3 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 9 Dec 2013 16:45:37 +0100 Subject: [PATCH 47/98] [IMP] fix licence bzr revid: mat@openerp.com-20131209154537-r5hpcveuxmvcdj10 --- openerp/addons/base/res/res_font.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_font.py b/openerp/addons/base/res/res_font.py index 7fab654c6d6..306a8944783 100644 --- a/openerp/addons/base/res/res_font.py +++ b/openerp/addons/base/res/res_font.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). +# Copyright (C) 2013 OpenERP SA (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as From 3b328aaab4d6b1f1ad6416e299b760b1658730fd Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Mon, 9 Dec 2013 16:48:57 +0100 Subject: [PATCH 48/98] [FIX] Trigger stored field recalculation for inherited records The create() method implicitly creates record on objects of the _inherits. Therefore, in order to make the trigger on linked field works, we should include all the _inherits values (field that makes the link to the rel record) because they are created implicitly. bzr revid: cto@openerp.com-20131209154857-788f94w0kh6ef5pp --- openerp/osv/orm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 7ecf4afc6cd..5f7403ee223 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -4487,7 +4487,9 @@ class BaseModel(object): self._validate(cr, user, [id_new], context) if not context.get('no_store_function', False): - result += self._store_get_values(cr, user, [id_new], vals.keys(), context) + result += self._store_get_values(cr, user, [id_new], + list(set(vals.keys() + self._inherits.values())), + context) result.sort() done = [] for order, object, ids, fields2 in result: From efdfcfc90e016fc1c912db4598428cc2eabea893 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 9 Dec 2013 16:57:02 +0100 Subject: [PATCH 49/98] [FIX] font: family with one l (Familly is a commune in the Calvados department in the Basse-Normandie region in northwestern France.) bzr revid: mat@openerp.com-20131209155702-negir6agbiugfctz --- openerp/addons/base/base_data.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/base_data.xml b/openerp/addons/base/base_data.xml index 093a72c6406..bd38f3a3db5 100644 --- a/openerp/addons/base/base_data.xml +++ b/openerp/addons/base/base_data.xml @@ -94,19 +94,19 @@ Administrator Helvetica - Helvetica + Helvetica /dev/null all Times - Times + Times /dev/null all Courier - Courier + Courier /dev/null all From 89bc58bae61a50039be0918e00c4533971fe8c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 9 Dec 2013 17:09:23 +0100 Subject: [PATCH 50/98] [TESTS] mail: mute logger back in mail tests bzr revid: tde@openerp.com-20131209160923-3yisgzqmns6pviud --- addons/mail/tests/test_mail_gateway.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py index c88ed6555d6..c6fffbde9fe 100644 --- a/addons/mail/tests/test_mail_gateway.py +++ b/addons/mail/tests/test_mail_gateway.py @@ -163,7 +163,7 @@ class TestMailgateway(TestMail): self.assertIn('
Should create a multipart/mixed: from gmail, bold, with attachment.

', res.get('body', ''), 'message_parse: html version should be in body after parsing multipart/mixed') - # @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm') + @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm') def test_10_message_process(self): """ Testing incoming emails processing. """ cr, uid, user_raoul = self.cr, self.uid, self.user_raoul @@ -523,7 +523,7 @@ class TestMailgateway(TestMail): self.assertIn('
\nPlease call me as soon as possible this afternoon!\n\n--\nSylvie\n
', msg.body, 'message_process: plaintext incoming email incorrectly parsed') - # @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm') + @mute_logger('openerp.addons.mail.mail_thread', 'openerp.osv.orm') def test_20_thread_parent_resolution(self): """ Testing parent/child relationships are correctly established when processing incoming mails """ cr, uid = self.cr, self.uid From f8b889e1db02e7b807812b276825a964520eced9 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 9 Dec 2013 20:24:00 +0100 Subject: [PATCH 51/98] [IMP] mail: announcement bar only for screen bzr revid: chs@openerp.com-20131209192400-01jpkaofq1arqekz --- addons/mail/static/src/js/announcement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js index e05d959dede..b7a2839ac43 100644 --- a/addons/mail/static/src/js/announcement.js +++ b/addons/mail/static/src/js/announcement.js @@ -20,7 +20,7 @@ openerp_announcement = function(instance) { var $css = $('').attr({ rel : 'stylesheet', type: 'text/css', - media: 'all', + media: 'screen', href: self._ab_location(dbuuid) }); $css.on('load', function() { From 5520d73d5fc062bdef2e32dba02a79aa831d1f04 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 9 Dec 2013 20:24:50 +0100 Subject: [PATCH 52/98] [IMP] mail: announcement bar: no dblclick bzr revid: chs@openerp.com-20131209192450-zacfq6i0xli7vjju --- addons/mail/static/src/js/announcement.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js index b7a2839ac43..f61cf534010 100644 --- a/addons/mail/static/src/js/announcement.js +++ b/addons/mail/static/src/js/announcement.js @@ -38,7 +38,6 @@ openerp_announcement = function(instance) { $bar.slideUp('slow'); }; - $bar.on('dblclick', close); $bar.find('.close').on('click', close); self.trigger('ab_loaded', $bar); }); From c8e3fe44d81820a392938ed27a8c2890ba059275 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 10 Dec 2013 00:25:10 +0100 Subject: [PATCH 53/98] [FIX] web_linkedin dependencies bzr revid: al@openerp.com-20131209232510-2ibdkr3846ksb75y --- addons/web_linkedin/__openerp__.py | 2 +- addons/web_linkedin/web_linkedin.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/web_linkedin/__openerp__.py b/addons/web_linkedin/__openerp__.py index 6ce78cfca47..508ca240780 100644 --- a/addons/web_linkedin/__openerp__.py +++ b/addons/web_linkedin/__openerp__.py @@ -10,7 +10,7 @@ OpenERP Web LinkedIn module. This module provides the Integration of the LinkedIn with OpenERP. """, 'data': ['web_linkedin_view.xml'], - 'depends' : ['crm'], + 'depends' : ['web','crm'], 'js': ['static/src/js/*.js'], 'css': ['static/src/css/*.css'], 'qweb': ['static/src/xml/*.xml'], diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py index 92adb30d3dd..bacfaa2a573 100644 --- a/addons/web_linkedin/web_linkedin.py +++ b/addons/web_linkedin/web_linkedin.py @@ -24,6 +24,7 @@ import urllib2 from urlparse import urlparse, urlunparse import openerp +import openerp.addons.web from openerp.osv import fields, osv class Binary(openerp.addons.web.http.Controller): @@ -91,4 +92,4 @@ class web_linkedin_fields(osv.Model): 'linkedin_url': fields.char(string="LinkedIn url", size=100, store=True), 'linkedin_public_url': fields.function(_get_url, type='text', string="LinkedIn url", help="This url is set automatically when you join the partner with a LinkedIn account."), - } \ No newline at end of file + } From 029c866b8c68a7eb15a04ee1e42fac7c69889aa4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 10 Dec 2013 10:30:55 +0100 Subject: [PATCH 54/98] [FIX] issue when tabbing too much at end of editable list row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tabbing is intercepted by keydown_TAB, which — if the current cell is the last active field of the row — will then call _next:476. _next then calls save_edition:300 which "takes a lock" (more precisely serializes access to its body) and within its body checks if an edition is active (:303) and returns immediately if not (:304). The problem here is when a second tab event arrives during the potentially extremely long save_edition body (since for toplevel lists it needs to perform a complete RPC call): the overall state of the list has not changed so the second event *also* goes into _next, then into save_edition. There it's serialized with the ongoing call and thus inactive until said ongoing call's termination, and reaches the body after the current edition has been wound down. As a result, the body of _next (:408) gets the resolution of ``$.when()``, which is ``null`` and the first condition blows up. There are 3 possible ways to fix this: * adding a check in keydown_TAB's handler to see whether a _next call is ongoing. This requires adding a state flag to the object and does not protect (or cooperate with) _next calls from outside this specific handler, unless they are modified in turn. * alter save_edition to *fail* in case there's no ongoing edition: this part was originally in ensure_saved which does not care whether a save was necessary or not and does not propagate save information, so ``$.when()`` made sense. In save_edition, there are really 3 different outcomes: the save succeeded, the save failed (or potentially part of save's postprocessing failed, for the current implementation) and the save was unnecessary. But deferred only provide 1 bit of state (success or failure), so the last state has to be merged into either success or failure. Both make sense, to an extent. Changing from one to the other (as necessary here) could break existing code and have more extensive effects than expected. * the simplest and least far-raging change is to just alter the save_edition().then handler to ignore cases where save_edition() results in no saveinfo, this can be assumed to be a bailed-out/unnecessary save call. For simplicity, the 3rd solution was picked here although with more extensive tests &al I'd have preferred trying out 2nd. lp bug: https://launchpad.net/bugs/1253899 fixed bzr revid: xmo@openerp.com-20131210093055-207fevqc1npy7fwr --- addons/web/static/src/js/view_list_editable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 512fc4ff373..f00296eec40 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -477,6 +477,7 @@ openerp.web.list_editable = function (instance) { next_record = next_record || 'succ'; var self = this; return this.save_edition().then(function (saveInfo) { + if (!saveInfo) { return null; } if (saveInfo.created) { return self.start_edition(); } From f32b87e14d7b1c587389eaabde676060e54b6fb3 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 10 Dec 2013 12:24:44 +0100 Subject: [PATCH 55/98] [FIX] css: avoid tabs in row below to move when selected (opw 601379) bzr revid: mat@openerp.com-20131210112444-pk9yh8bke1z7eerr --- addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/css/base.sass | 3 +++ 2 files changed, 7 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index edd4d4869a5..fabb8503b34 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -623,6 +623,10 @@ display: block; color: gray; } +.openerp .ui-tabs .oe_notebook.ui-tabs-nav li.ui-tabs-active { + border-bottom: none; + padding-bottom: 1px; +} .openerp .oe_notebook > li.ui-tabs-active > a { color: #4c4c4c; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 4814e64c590..c54cd2920c0 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -561,6 +561,9 @@ $sheet-padding: 16px text-decoration: none background-color: #eee border-color: #eee #eee #ddd + .ui-tabs .oe_notebook.ui-tabs-nav li.ui-tabs-active + border-bottom: none + padding-bottom: 1px .oe_notebook > li.ui-state-active > a, .oe_notebook > li.ui-state-active > a:hover background-color: #ffffff border: 1px solid #ddd From 9322b677aa7848ab6ece42786f46137ff7eea05c Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 10 Dec 2013 13:47:55 +0100 Subject: [PATCH 56/98] [FIX] weird behavior when drag&dropping a row during edition in editable listview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When dropping, would simultanously stop the edition and try a write (so 2 writes on the same record) and generally screw up the state of all the things, ending up with an empty row and a weird (and incorrect) warning. This can be fixed by preventing resequencing during the creation or edition of a record (row) inline. For simplicity, implemented by looking up .ui-sortable descendants — there are no utility methods for handling that and, aside from the class, there's no good way to know if sortability was enabled on a list body or not (as far as I can see, jquery-ui's sortable has no API to query that) — and using jquery-ui's sortable API for enabling and disabling sortable on the fly. lp bug: https://launchpad.net/bugs/1257753 fixed bzr revid: xmo@openerp.com-20131210124755-ugr3ehf744qoh1o5 --- addons/web/static/src/js/view_list_editable.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index f00296eec40..f2fd8974d81 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -50,8 +50,10 @@ openerp.web.list_editable = function (instance) { }); this.on('edit:after', this, function () { self.$el.add(self.$buttons).addClass('oe_editing'); + self.$('.ui-sortable').sortable('disable'); }); this.on('save:after cancel:after', this, function () { + self.$('.ui-sortable').sortable('enable'); self.$el.add(self.$buttons).removeClass('oe_editing'); }); }, From 75548727ec2d676d1a64e2ce6567b097a17cc0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 10 Dec 2013 14:38:30 +0100 Subject: [PATCH 57/98] [FIX] mass_mailing: fixed label for template choice when creating a new wave of mass mailing bzr revid: tde@openerp.com-20131210133830-rhm6t1unz6urrxxj --- addons/mass_mailing/wizard/mail_mass_mailing_create_segment.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mass_mailing/wizard/mail_mass_mailing_create_segment.xml b/addons/mass_mailing/wizard/mail_mass_mailing_create_segment.xml index e307bdd8909..d320520cbd2 100644 --- a/addons/mass_mailing/wizard/mail_mass_mailing_create_segment.xml +++ b/addons/mass_mailing/wizard/mail_mass_mailing_create_segment.xml @@ -42,7 +42,7 @@

-