From 4c335588a1f5d6d1f03e17aa20e37ffe4197447c Mon Sep 17 00:00:00 2001 From: Bhavik Bagdiya Date: Tue, 19 Aug 2014 10:37:54 +0530 Subject: [PATCH 01/25] [FIX] web: grid headers should be aligned properly --- addons/web/static/src/css/base.css | 1 + addons/web/static/src/css/base.sass | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index d221dfba409..463876f92b3 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2842,6 +2842,7 @@ .openerp .oe_list_content td, .openerp .oe_list_content th { padding: 3px 6px; line-height: 18px; + white-space: nowrap; } .openerp .oe_list_content th.oe_sortable, .openerp .oe_list_content th.oe_sortable div { cursor: pointer; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 05270c0b68f..b1b866684b1 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2287,6 +2287,7 @@ $sheet-padding: 16px td, th padding: 3px 6px line-height: 18px + white-space: nowrap th.oe_sortable, th.oe_sortable div cursor: pointer th.oe_sortable div From b160f99e2d0e5eb2de176f3e3dbcd7f3aa843c22 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 22 Aug 2014 12:49:39 +0200 Subject: [PATCH 02/25] [FIX] fetchmail: do not delete a failing email when using POP In case of IMAP, the email is simply set as read but in case of POP, the email is deleted. To avoid loosing data (e.g. misconfiguration of server), the email is kept for POP. Bug lp:1296724, opw 605667 --- addons/fetchmail/fetchmail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 515881e8582..4d32cc13139 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -236,12 +236,12 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p save_original=server.original, strip_attachments=(not server.attach), context=context) + pop_server.dele(num) except Exception: _logger.exception('Failed to process mail from %s server %s.', server.type, server.name) failed += 1 if res_id and server.action_id: action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': context.get("thread_model", server.object_id.model)}) - pop_server.dele(num) cr.commit() _logger.info("Fetched %d email(s) on %s server %s; %d succeeded, %d failed.", numMsgs, server.type, server.name, (numMsgs - failed), failed) except Exception: From 73546f70ca16ff9bcb51d62273ac3ec6b810e6c4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 22 Aug 2014 15:29:23 +0200 Subject: [PATCH 03/25] [FIX] point_of_sale: generate bank statement with commerical partner When a pos session is closed & confirmed, the account.move were generated with the commercial partner except for the bank statement which prevented automatic reconciliation. This patch uses the commercial partner also for bank statement. Fixes #1558, #1764 --- addons/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 2768cf8aa44..a6131bca31b 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -757,12 +757,12 @@ class pos_order(osv.osv): 'amount': data['amount'], 'date': data.get('payment_date', time.strftime('%Y-%m-%d')), 'name': order.name + ': ' + (data.get('payment_name', '') or ''), + 'partner_id': order.partner_id and self.pool.get("res.partner")._find_accounting_partner(order.partner_id).id or False, } account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) args['account_id'] = (order.partner_id and order.partner_id.property_account_receivable \ and order.partner_id.property_account_receivable.id) or (account_def and account_def.id) or False - args['partner_id'] = order.partner_id and order.partner_id.id or None if not args['account_id']: if not args['partner_id']: From 7dbb16a85658f4d15585fae195b884634abc012b Mon Sep 17 00:00:00 2001 From: Fekete Mihai Date: Fri, 22 Aug 2014 16:34:11 +0300 Subject: [PATCH 04/25] [IMP] stock: stock incoterm converted to uppercase --- addons/stock/stock_incoterms.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock_incoterms.xml b/addons/stock/stock_incoterms.xml index 42865a8164c..064480d6aea 100644 --- a/addons/stock/stock_incoterms.xml +++ b/addons/stock/stock_incoterms.xml @@ -51,15 +51,15 @@ DAT - Delivered At Terminal + DELIVERED AT TERMINAL DAP - Delivered At Place + DELIVERED AT PLACE - + DDP - Delivered Duty Paid + DELIVERED DUTY PAID From bc3991b4c58d20969816c644dd57bae68b103ba8 Mon Sep 17 00:00:00 2001 From: Ravish Murari Date: Thu, 7 Aug 2014 18:04:42 +0530 Subject: [PATCH 05/25] [FIX] board: Do not offer to create dashboard when there is no action In case we have no defined action (e.g. redirection by python code), adding a dashboard should not be possible as the rendering based on the action. This patch hides the 'Add to Dashboard' button in search view (opw 611288) --- addons/board/static/src/js/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 65737ad234e..d2587c87add 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -424,7 +424,7 @@ instance.web.SearchView.include({ add_common_inputs: function() { this._super(); var vm = this.getParent().getParent(); - if (vm.inner_action && vm.inner_action.views) { + if (vm.inner_action && vm.inner_action.id && vm.inner_action.views) { (new instance.board.AddToDashboard(this)); } } From 9b3f3fecfe5e5487dce6c24b1ee18a5b23faf474 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 25 Aug 2014 14:51:03 +0200 Subject: [PATCH 06/25] [FIX] hr_holidays: employees cannot approve their holidays Nor modify once approved It wasn't possible for employees to approve their holidays themself, thanks to the GUI, but this was possible through xmlrpc calls, or when altering the html directly in the browser. Besides, this was also possible to edit the holiday through the same trick once the holiday validated --- addons/hr_holidays/hr_holidays.py | 4 ++++ addons/hr_holidays/security/ir_rule.xml | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index fbe72a1898c..38130149825 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -305,10 +305,14 @@ class hr_holidays(osv.osv): if context is None: context = {} context = dict(context, mail_create_nolog=True) + if values.get('state') and values['state'] not in ['draft', 'confirm', 'cancel'] and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_user'): + raise osv.except_osv(_('Warning!'), _('You cannot set a leave request as \'%s\'. Contact a human resource manager.') % values.get('state')) return super(hr_holidays, self).create(cr, uid, values, context=context) def write(self, cr, uid, ids, vals, context=None): check_fnct = self.pool.get('hr.holidays.status').check_access_rights + if vals.get('state') and vals['state'] not in ['draft', 'confirm', 'cancel'] and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_user'): + raise osv.except_osv(_('Warning!'), _('You cannot set a leave request as \'%s\'. Contact a human resource manager.') % vals.get('state')) for holiday in self.browse(cr, uid, ids, context=context): if holiday.state in ('validate','validate1') and not check_fnct(cr, uid, 'write', raise_exception=False): raise osv.except_osv(_('Warning!'),_('You cannot modify a leave request that has been approved. Contact a human resource manager.')) diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml index ff0270026a4..3aa2d4db052 100644 --- a/addons/hr_holidays/security/ir_rule.xml +++ b/addons/hr_holidays/security/ir_rule.xml @@ -5,6 +5,17 @@ Employee Holidays [('employee_id.user_id','=',user.id)] + + + + + + + + Employee Holidays Create, Write, Unlink + + [('employee_id.user_id','=',user.id), ('state', 'in', ['draft', 'confirm', 'cancel'])] + From 231a478ca975eea50b7f72e5ca775b0a2eb8227b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 25 Aug 2014 16:19:29 +0200 Subject: [PATCH 07/25] [FIX] website_sale: pager in product list Keep the reference to category and search view in pager. Update the search template to include form and keep correct reference to the category (as a slug and not a parameter). Fixes #688 --- addons/website_sale/controllers/main.py | 7 +++++- addons/website_sale/views/templates.xml | 31 ++++++++++++------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 79b04fa5ee6..0de92eb5d44 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -149,8 +149,13 @@ class website_sale(http.Controller): context['pricelist'] = int(self.get_pricelist()) product_obj = pool.get('product.template') + url = "/shop" product_count = product_obj.search_count(cr, uid, domain, context=context) - pager = request.website.pager(url="/shop", total=product_count, page=page, step=PPG, scope=7, url_args=post) + if search: + post["search"] = search + if category: + url = "/shop/category/%s" % slug(category) + pager = request.website.pager(url=url, total=product_count, page=page, step=PPG, scope=7, url_args=post) product_ids = product_obj.search(cr, uid, domain, limit=PPG+10, offset=pager['offset'], order='website_published desc, website_sequence desc', context=context) products = product_obj.browse(cr, uid, product_ids, context=context) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index f4becb6ce45..6fe87097afb 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -29,18 +29,21 @@