From ff4fe2c05e35ccbf435583474a942512363b4cb5 Mon Sep 17 00:00:00 2001 From: Pariket Trivedi Date: Wed, 21 May 2014 16:34:34 +0530 Subject: [PATCH 001/128] [FIX]: change correct label and fields in Event Analysis. --- addons/event/report/report_event_registration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event/report/report_event_registration.py b/addons/event/report/report_event_registration.py index 595d3947687..1ce3591a105 100644 --- a/addons/event/report/report_event_registration.py +++ b/addons/event/report/report_event_registration.py @@ -37,7 +37,7 @@ class report_event_registration(osv.osv): 'draft_state': fields.integer(' # No of Draft Registrations', size=20), 'confirm_state': fields.integer(' # No of Confirmed Registrations', size=20), 'register_max': fields.integer('Maximum Registrations'), - 'nbevent': fields.integer('Number Of Events'), + 'nbevent': fields.integer('Number of Registrations in Events'), 'event_type': fields.many2one('event.type', 'Event Type'), 'registration_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Attended'), ('cancel', 'Cancelled')], 'Registration State', readonly=True, required=True), 'event_state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Event State', readonly=True, required=True), @@ -68,7 +68,7 @@ class report_event_registration(osv.osv): to_char(e.date_begin, 'YYYY-MM-DD') AS event_date, to_char(e.date_begin, 'YYYY') AS year, to_char(e.date_begin, 'MM') AS month, - count(e.id) AS nbevent, + count(r.id) AS nbevent, CASE WHEN r.state IN ('draft') THEN r.nb_register ELSE 0 END AS draft_state, CASE WHEN r.state IN ('open','done') THEN r.nb_register ELSE 0 END AS confirm_state, e.type AS event_type, From a77123fcccff56c5745abf1737122cb846fd711c Mon Sep 17 00:00:00 2001 From: Pariket Trivedi Date: Thu, 22 May 2014 11:49:09 +0530 Subject: [PATCH 002/128] [FIX]: Bad display in kanban view with a group by in Event. --- addons/event/static/src/css/event.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event/static/src/css/event.css b/addons/event/static/src/css/event.css index ff5bfaba19b..53c03cc03f0 100644 --- a/addons/event/static/src/css/event.css +++ b/addons/event/static/src/css/event.css @@ -1,7 +1,7 @@ .oe_event_date{ border-top-left-radius:3px; border-top-right-radius:3px; - font-size: 48px; + font-size: 36px; height: auto; font-weight: bold; text-align: center; From 6d65ff1f99f14cdbc32f2f0a31a9930ea9f1a086 Mon Sep 17 00:00:00 2001 From: Pariket Trivedi Date: Thu, 22 May 2014 11:56:28 +0530 Subject: [PATCH 003/128] [FIX]:IE9 Kanban: The 'show more' button is not display correctly. --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 2 ++ 2 files changed, 5 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 8c2da02d969..d7c40480e11 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3392,6 +3392,9 @@ body.oe_single_form .oe_single_form_container { .openerp_ie .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF', endColorstr='#D8D8D8'); } +.openerp_ie .oe_webclient { + height: auto !important; +} @media print { .openerp { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index b18e4fc65d8..090cf3de0fe 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2736,6 +2736,8 @@ body.oe_single_form // jquery ui for ie .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#EFEFEF', endColorstr='#D8D8D8') + .oe_webclient + height: auto !important // }}} // @media print {{{ From 74eb6624207758f565842b1d5ee1c621b85105dc Mon Sep 17 00:00:00 2001 From: fka-odoo Date: Tue, 3 Jun 2014 19:04:07 +0530 Subject: [PATCH 004/128] [FIX] display_name is not compute for non-active partner --- addons/account_report_company/account_report_company.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_report_company/account_report_company.py b/addons/account_report_company/account_report_company.py index 6915657ba84..fe5d237adf2 100644 --- a/addons/account_report_company/account_report_company.py +++ b/addons/account_report_company/account_report_company.py @@ -31,7 +31,7 @@ class res_partner(osv.Model): return dict(self.name_get(cr, uid, ids, context=context)) _display_name_store_triggers = { - 'res.partner': (lambda self,cr,uid,ids,context=None: self.search(cr, uid, [('id','child_of',ids)]), + 'res.partner': (lambda self,cr,uid,ids,context=None: self.search(cr, uid, [('id','child_of',ids)], context=dict(active_test=False)), ['parent_id', 'is_company', 'name'], 10) } From 271885716f7303551d74e0989183e5f27d35da54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=C3=ABl=20Closson?= Date: Tue, 3 Jun 2014 16:19:05 +0200 Subject: [PATCH 005/128] [FIX] sale: cannot filter on paid = False --- addons/sale/sale.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0664b6521c1..dc79c435ee0 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -128,13 +128,12 @@ class sale_order(osv.osv): sale_clause = '' no_invoiced = False for arg in args: - if arg[1] == '=': - if arg[2]: - clause += 'AND inv.state = \'paid\'' - else: - clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id ' - sale_clause = ', sale_order AS sale ' - no_invoiced = True + if (arg[1] == '=' and arg[2]) or (arg[1] == '!=' and not arg[2]): + clause += 'AND inv.state = \'paid\'' + else: + clause += 'AND inv.state != \'cancel\' AND sale.state != \'cancel\' AND inv.state <> \'paid\' AND rel.order_id = sale.id ' + sale_clause = ', sale_order AS sale ' + no_invoiced = True cursor.execute('SELECT rel.order_id ' \ 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv '+ sale_clause + \ From fcb82dc5f1cc4c81dabd2f0be318d4774a630e54 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 5 Jun 2014 13:10:48 +0200 Subject: [PATCH 006/128] [IMP] add XID to view name in Ace editor dropdown When looking for template bit to override or alter (in-core) through the Ace editor, displaying only the name is a pain: - the name generally sucks diseased donkey balls - having to go through the code to find out what the template's XID is is a waste of time --- addons/website/static/src/js/website.ace.js | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index 27e5cd60e62..e1c45065c33 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -65,12 +65,13 @@ website.ace.ViewOption = openerp.Widget.extend({ template: 'website.ace_view_option', init: function (parent, options) { - var indent = "- "; this.view_id = options.id; this.view_name = options.name; - for (var i = 0; i Date: Mon, 9 Jun 2014 18:20:02 +0530 Subject: [PATCH 007/128] [FIX] mail: Speep improvement when sending email using 'Send by Email' wizard. (Maintenance Case: 606994) --- addons/mail/mail_message.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 4280983f288..3f491df82b7 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -881,9 +881,11 @@ class mail_message(osv.Model): fol_ids = fol_obj.search(cr, SUPERUSER_ID, [ ('res_model', '=', message.model), ('res_id', '=', message.res_id), - ('subtype_ids', 'in', message.subtype_id.id) ], context=context) - partners_to_notify |= set(fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context)) + partners_to_notify |= set( + fo.partner_id for fo in fol_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context) + if message.subtype_id.id in [st.id for st in fo.subtype_ids] + ) # remove me from notified partners, unless the message is written on my own wall if message.author_id and message.model == "res.partner" and message.res_id == message.author_id.id: partners_to_notify |= set([message.author_id]) From 15f5abcbbef8aa6da6590ec8848261349ebebf84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 12 Jun 2014 13:45:21 +0200 Subject: [PATCH 008/128] [IMP] mail, website_mail_group: discussion group improvements - added possibility in mail to have a model adding custom headers in emails sent for notifications for new messages - mail.group now add list-id and precedence: list in the headers to inform mailing systems that those mails are to be considered as mailing lists - website_mail_group adds some further data in the headers (subscribe, unsubscribe, archives) - groups page now display the number of message in the last month - notification emails are now queued after 50 recipients --- addons/mail/mail_followers.py | 4 ++-- addons/mail/mail_group.py | 13 +++++++++++++ addons/mail/mail_mail.py | 10 ++++++++-- addons/mail/mail_thread.py | 10 ++++++++++ addons/website_mail_group/__init__.py | 1 + addons/website_mail_group/controllers/main.py | 16 ++++++++++++++-- addons/website_mail_group/models/__init__.py | 1 + addons/website_mail_group/models/mail_group.py | 18 ++++++++++++++++++ .../views/website_mail_group.xml | 2 +- 9 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 addons/website_mail_group/models/__init__.py create mode 100644 addons/website_mail_group/models/mail_group.py diff --git a/addons/mail/mail_followers.py b/addons/mail/mail_followers.py index ffc49414b2e..e4028111a73 100644 --- a/addons/mail/mail_followers.py +++ b/addons/mail/mail_followers.py @@ -176,7 +176,7 @@ class mail_notification(osv.Model): references = message.parent_id.message_id if message.parent_id else False # create email values - max_recipients = 100 + max_recipients = 50 chunks = [email_pids[x:x + max_recipients] for x in xrange(0, len(email_pids), max_recipients)] email_ids = [] for chunk in chunks: @@ -188,7 +188,7 @@ class mail_notification(osv.Model): 'references': references, } email_ids.append(self.pool.get('mail.mail').create(cr, uid, mail_values, context=context)) - if force_send and len(chunks) < 6: # for more than 500 followers, use the queue system + if force_send and len(chunks) < 2: # for more than 50 followers, use the queue system self.pool.get('mail.mail').send(cr, uid, email_ids, context=context) return True diff --git a/addons/mail/mail_group.py b/addons/mail/mail_group.py index 4ae47a96774..186787c121a 100644 --- a/addons/mail/mail_group.py +++ b/addons/mail/mail_group.py @@ -211,3 +211,16 @@ class mail_group(osv.Model): return [] else: return super(mail_group, self).get_suggested_thread(cr, uid, removed_suggested_threads, context) + + def message_get_email_values(self, cr, uid, id, notif_mail=None, context=None): + res = super(mail_group, self).message_get_email_values(cr, uid, id, notif_mail=notif_mail, context=context) + group = self.browse(cr, uid, id, context=context) + res.update({ + 'headers': { + 'Precedence': 'list', + } + }) + if group.alias_domain: + res['headers']['List-Id'] = '%s.%s' % (group.alias_name, group.alias_domain) + res['headers']['List-Post'] = '' % (group.alias_name, group.alias_domain) + return res diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index a4814140479..cc12bde2436 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -204,12 +204,15 @@ class mail_mail(osv.Model): """ body = self.send_get_mail_body(cr, uid, mail, partner=partner, context=context) body_alternative = tools.html2plaintext(body) - return { + res = { 'body': body, 'body_alternative': body_alternative, 'subject': self.send_get_mail_subject(cr, uid, mail, partner=partner, context=context), 'email_to': self.send_get_mail_to(cr, uid, mail, partner=partner, context=context), } + if mail.model and mail.res_id and self.pool.get(mail.model) and hasattr(self.pool[mail.model], 'message_get_email_values'): + res.update(self.pool[mail.model].message_get_email_values(cr, uid, mail.res_id, mail, context=context)) + return res def send(self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None): """ Sends the selected emails immediately, ignoring their current @@ -268,6 +271,9 @@ class mail_mail(osv.Model): # build an RFC2822 email.message.Message object and send it without queuing res = None for email in email_list: + email_headers = dict(headers) + if email.get('headers'): + email_headers.update(email['headers']) msg = ir_mail_server.build_email( email_from=mail.email_from, email_to=email.get('email_to'), @@ -282,7 +288,7 @@ class mail_mail(osv.Model): object_id=mail.res_id and ('%s-%s' % (mail.res_id, mail.model)), subtype='html', subtype_alternative='plain', - headers=headers) + headers=email_headers) res = ir_mail_server.send_email(cr, uid, msg, mail_server_id=mail.mail_server_id.id, context=context) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 36d6ecbf630..4ad9ca63049 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -694,6 +694,16 @@ class mail_thread(osv.AbstractModel): if record.alias_domain and record.alias_name else False for record in self.browse(cr, SUPERUSER_ID, ids, context=context)] + def message_get_email_values(self, cr, uid, id, notif_mail=None, context=None): + """ Temporary method to create custom notification email values for a given + model and document. This should be better to have a headers field on + the mail.mail model, computed when creating the notification email, but + this cannot be done in a stable version. + + TDE FIXME: rethink this ulgy thing. """ + res = dict() + return res + #------------------------------------------------------ # Mail gateway #------------------------------------------------------ diff --git a/addons/website_mail_group/__init__.py b/addons/website_mail_group/__init__.py index ee5959455ad..9f86759e32b 100644 --- a/addons/website_mail_group/__init__.py +++ b/addons/website_mail_group/__init__.py @@ -1 +1,2 @@ import controllers +import models diff --git a/addons/website_mail_group/controllers/main.py b/addons/website_mail_group/controllers/main.py index a28b808d9f2..59478b37fa3 100644 --- a/addons/website_mail_group/controllers/main.py +++ b/addons/website_mail_group/controllers/main.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- import datetime +from dateutil import relativedelta -from openerp import tools +from openerp import tools, SUPERUSER_ID from openerp.addons.web import http from openerp.addons.website.models.website import slug from openerp.addons.web.http import request @@ -28,12 +29,23 @@ class MailGroup(http.Controller): def view(self, **post): cr, uid, context = request.cr, request.uid, request.context group_obj = request.registry.get('mail.group') + mail_message_obj = request.registry.get('mail.message') group_ids = group_obj.search(cr, uid, [('alias_id', '!=', False), ('alias_id.alias_name', '!=', False)], context=context) - values = {'groups': group_obj.browse(cr, uid, group_ids, context)} + groups = group_obj.browse(cr, uid, group_ids, context) + # compute statistics + month_date = datetime.datetime.today() - relativedelta.relativedelta(months=1) + group_data = dict.fromkeys(group_ids, dict()) + for group in groups: + group_data[group.id]['monthly_message_nbr'] = mail_message_obj.search( + cr, SUPERUSER_ID, + [('model', '=', 'mail.group'), ('res_id', '=', group.id), ('date', '>=', month_date.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT))], + count=True, context=context) + values = {'groups': groups, 'group_data': group_data} return request.website.render('website_mail_group.mail_groups', values) @http.route(["/groups/subscription/"], type='json', auth="user") def subscription(self, group_id=0, action=False, **post): + """ TDE FIXME: seems dead code """ cr, uid, context = request.cr, request.uid, request.context group_obj = request.registry.get('mail.group') if action: diff --git a/addons/website_mail_group/models/__init__.py b/addons/website_mail_group/models/__init__.py new file mode 100644 index 00000000000..ea8be51acde --- /dev/null +++ b/addons/website_mail_group/models/__init__.py @@ -0,0 +1 @@ +import mail_group diff --git a/addons/website_mail_group/models/mail_group.py b/addons/website_mail_group/models/mail_group.py new file mode 100644 index 00000000000..804785b66f9 --- /dev/null +++ b/addons/website_mail_group/models/mail_group.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +from openerp.osv import osv + + +class MailGroup(osv.Model): + _inherit = 'mail.group' + + def message_get_email_values(self, cr, uid, id, notif_mail=None, context=None): + res = super(MailGroup, self).message_get_email_values(cr, uid, id, notif_mail=notif_mail, context=context) + group = self.browse(cr, uid, id, context=context) + base_url = self.pool['ir.config_parameter'].get_param(cr, uid, 'web.base.url') + res['headers'].update({ + 'List-Archive': '<%s/groups/%s>' % (base_url, group.id), + 'List-Subscribe': '<%s/groups>' % (base_url), + 'List-Unsubscribe': '<%s/groups>' % (base_url), + }) + return res diff --git a/addons/website_mail_group/views/website_mail_group.xml b/addons/website_mail_group/views/website_mail_group.xml index d52c34513b8..332c6e7b576 100644 --- a/addons/website_mail_group/views/website_mail_group.xml +++ b/addons/website_mail_group/views/website_mail_group.xml @@ -45,7 +45,7 @@
participants
- messages + messages / month
From 0b4921e4d6c075ff47dbe3356433b698b61008b3 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 12 Jun 2014 12:24:48 +0200 Subject: [PATCH 009/128] parse_value: interger != float Wwhen parsing a integer field, do not accept float values. '1' or '1.0' is ok but not '1.1'. (opw 608544) --- addons/web/static/src/js/formats.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 3280b9f4f75..0c3577b2671 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -228,7 +228,8 @@ instance.web.parse_value = function (value, descriptor, value_if_empty) { value = value.replace(instance.web._t.database.parameters.thousands_sep, ""); } while(tmp !== value); tmp = Number(value); - if (isNaN(tmp)) + // do not accept not numbers or float values + if (isNaN(tmp) || tmp % 1) throw new Error(_.str.sprintf(_t("'%s' is not a correct integer"), value)); return tmp; case 'float': From 86acc1a62ffd1bdbbf79a6d315287baf5a5cea2b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 12 Jun 2014 16:14:41 +0200 Subject: [PATCH 010/128] [FIX] orm: avoir errors reading twice a field _read_flat: remove duplicated fields in read call get many2one: as False is instance of int, check the value of x first to avoid calling a name_get with a list of False When we were reading twice a m2o field where at least one result is null, the first call to name_get would set the value to False instead of None and then accepted by the filter 'isinstance(x, (int,long))' --- openerp/osv/fields.py | 2 +- openerp/osv/orm.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 18aa3aad8c2..49421365852 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -464,7 +464,7 @@ class many2one(_column): # we use uid=1 because the visibility of a many2one field value (just id and name) # must be the access right of the parent form and not the linked object itself. records = dict(obj.name_get(cr, SUPERUSER_ID, - list(set([x for x in res.values() if isinstance(x, (int,long))])), + list(set([x for x in res.values() if x and isinstance(x, (int,long))])), context=context)) for id in res: if res[id] in records: diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 6e91ba46721..1dbac53511f 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -3694,6 +3694,8 @@ class BaseModel(object): return [] if fields_to_read is None: fields_to_read = self._columns.keys() + else: + fields_to_read = list(set(fields_to_read)) # all inherited fields + all non inherited fields for which the attribute whose name is in load is True fields_pre = [f for f in fields_to_read if From e95545dcf020982604214ea44217ce5cda5d7185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 12 Jun 2014 17:32:32 +0200 Subject: [PATCH 011/128] [FIX] hr: typo in a field definition --- addons/hr/hr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 0b1da11dd18..dbb20cc8b76 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -196,7 +196,7 @@ class hr_employee(osv.osv): "resized as a 128x128px image, with aspect ratio preserved. "\ "Use this field in form views or some kanban views."), 'image_small': fields.function(_get_image, fnct_inv=_set_image, - string="Smal-sized photo", type="binary", multi="_get_image", + string="Small-sized photo", type="binary", multi="_get_image", store = { 'hr.employee': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10), }, From 28ff7e38b909a7b020c51168b2ee1c4a9230667a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 12 Jun 2014 17:35:41 +0200 Subject: [PATCH 012/128] [FIX] portal: typos in portal wall actions. --- addons/portal/portal_data.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/portal/portal_data.xml b/addons/portal/portal_data.xml index 5c7fa14ce2a..ebaaa3f8424 100644 --- a/addons/portal/portal_data.xml +++ b/addons/portal/portal_data.xml @@ -39,7 +39,7 @@ }"/>

- Youd don't have unread company's news. + You don't have unread company's news.

@@ -71,7 +71,7 @@ }"/>

- Youd don't have unread job offers. + You don't have unread job offers.

From 4a508885ac043b25465aa5741955082aa66ce949 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 12 Jun 2014 20:03:50 +0200 Subject: [PATCH 013/128] [FIX] web: view_list_editable, on add an item, focus on the first cell of new row Before, the focus was set on the first row, and, thererefore, if the list was enough long, it jumped out and the actual new row was hidden --- .../web/static/src/js/view_list_editable.js | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index c4aac5565ab..b97aef19815 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -127,15 +127,7 @@ openerp.web.list_editable = function (instance) { if (this.editable()) { this.$el.find('table:first').show(); this.$el.find('.oe_view_nocontent').remove(); - this.start_edition().then(function(){ - var fields = self.editor.form.fields; - self.editor.form.fields_order.some(function(field){ - if (fields[field].$el.is(':visible')){ - fields[field].$el.find("input").select(); - return true; - } - }); - }); + this.start_edition(); } else { this._super(); } @@ -240,6 +232,7 @@ openerp.web.list_editable = function (instance) { return this.ensure_saved().then(function () { var $recordRow = self.groups.get_row_for(record); var cells = self.get_cells_for($recordRow); + var fields = {}; self.fields_for_resize.splice(0, self.fields_for_resize.length); return self.with_event('edit', { record: record.attributes, @@ -253,10 +246,13 @@ openerp.web.list_editable = function (instance) { // FIXME: need better way to get the field back from bubbling (delegated) DOM events somehow field.$el.attr('data-fieldname', field_name); + fields[field_name] = field; self.fields_for_resize.push({field: field, cell: cell}); }, options).then(function () { $recordRow.addClass('oe_edition'); self.resize_fields(); + var focus_field = options && options.focus_field ? options.focus_field : (self.visible_columns.length ? self.visible_columns[0].name : undefined); + if (focus_field) fields[focus_field].$el.find('input').select(); return record.attributes; }); }).fail(function () { @@ -750,31 +746,6 @@ openerp.web.list_editable = function (instance) { throw new Error("is_editing's state filter must be either `new` or" + " `edit` if provided"); }, - _focus_setup: function (focus_field) { - var form = this.form; - - var field; - // If a field to focus was specified - if (focus_field - // Is actually in the form - && (field = form.fields[focus_field]) - // And is visible - && field.$el.is(':visible')) { - // focus it - field.focus(); - return; - } - - _(form.fields_order).detect(function (name) { - // look for first visible field in fields_order, focus it - var field = form.fields[name]; - if (!field.$el.is(':visible')) { - return false; - } - // Stop as soon as a field got focused - return field.focus() !== false; - }); - }, edit: function (record, configureField, options) { // TODO: specify sequence of edit calls var self = this; @@ -789,7 +760,6 @@ openerp.web.list_editable = function (instance) { _(form.fields).each(function (field, name) { configureField(name, field); }); - self._focus_setup(options && options.focus_field); return form; }); }, From 4e0559ef97dcb3422223b5a68ca8cbf9d8de79ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 12 Jun 2014 17:50:19 +0200 Subject: [PATCH 014/128] [FIX] hr_holidays: display float for leaves remaining / leaves taken in holiday type name get --- addons/hr_holidays/hr_holidays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 07d4995998a..6a55403e960 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -104,7 +104,7 @@ class hr_holidays_status(osv.osv): for record in self.browse(cr, uid, ids, context=context): name = record.name if not record.limit: - name = name + (' (%d/%d)' % (record.leaves_taken or 0.0, record.max_leaves or 0.0)) + name = name + (' (%g/%g)' % (record.leaves_taken or 0.0, record.max_leaves or 0.0)) res.append((record.id, name)) return res From f9fc9fdf1c1ac429d2a1d217b3e3b0689e285248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 13 Jun 2014 09:07:28 +0200 Subject: [PATCH 015/128] [FIX] hr: working and home adresses should not be customers by default, only 'normal' adresses. --- addons/hr/hr_view.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 3e79c0ca7d6..0d90d5d4dc7 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -35,7 +35,9 @@ - + @@ -64,7 +66,9 @@ - + From 2f43cf041de34b23f15974d09d9cb2b7b515fcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 13 Jun 2014 09:25:48 +0200 Subject: [PATCH 016/128] [FIX] hr_holidays: date_from, date_to required in form view only for leave requests, not for allocation requests --- addons/hr_holidays/hr_holidays_view.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index c39adcb3182..7c5db338bdb 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -63,13 +63,16 @@ +