From 056ab55b6b4ccf7cd845bd666e76b4ec6e853582 Mon Sep 17 00:00:00 2001 From: dhr-odoo Date: Mon, 6 Oct 2014 18:53:15 +0530 Subject: [PATCH 01/15] [FIX] Passed bank statement's currency in payment_rate_currency_id of the account.voucher when importing payment lines --- .../account_payment/wizard/account_payment_populate_statement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py index edd47065e3a..03a67047858 100644 --- a/addons/account_payment/wizard/account_payment_populate_statement.py +++ b/addons/account_payment/wizard/account_payment_populate_statement.py @@ -92,6 +92,7 @@ class account_payment_populate_statement(osv.osv_memory): 'date': line.date or time.strftime('%Y-%m-%d'), 'amount': abs(amount), 'period_id': statement.period_id.id, + 'payment_rate_currency_id': statement.currency.id, } voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context) From 0b2bc27adc9ced899744c3bd06789d69e5b990f5 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 20 Apr 2015 11:54:53 +0200 Subject: [PATCH 02/15] [FIX] stock: use unit of measure for manual receptions When using the manual reception wizard, if a quantity in a different unit of measure was set, the unit was ignored. opw 617336 --- addons/stock/stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 5cd1b4f510a..9354fa0bf4f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2724,9 +2724,11 @@ class stock_move(osv.osv): continue partial_data = partial_datas.get('move%s'%(move.id), False) assert partial_data, _('Missing partial picking data for move #%s.') % (move.id) - product_qty = partial_data.get('product_qty',0.0) + product_uom = partial_data.get('product_uom', False) + product_qty = partial_data.get('product_qty', 0.0) + product_qty = self.pool['product.uom']._compute_qty(cr, uid, product_uom, product_qty, move.product_uom.id) move_product_qty[move.id] = product_qty - product_uom = partial_data.get('product_uom',False) + product_price = partial_data.get('product_price',0.0) product_currency = partial_data.get('product_currency',False) prodlot_ids[move.id] = partial_data.get('prodlot_id') From f4e1974d67c776b01329db443d3def05d2ce1bc2 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Mon, 20 Apr 2015 14:10:10 +0200 Subject: [PATCH 03/15] [FIX] web_calendar: fixed counting of days when selection spans multiple weeks As event_obj._length doesn't return the number of days when the selection spans multiple weeks, the test was wrong when the selection ended on the first day of a subsequent week. This fix was originaly written by rha-odoo at 95d344b, but I rewrote it a little. I would have liked a cleaner way of finding how many days there were between the two dates, but I couldn't find anything better, considering I didn't want to create new objects just for that test. Fixes opw 614703. --- addons/web_calendar/static/src/js/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 2c7edaf13e6..afc3ce4a0e8 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -482,7 +482,8 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ this.is_slow_open = true; if (this.current_mode() === 'month') { event_obj['start_date'].addHours(8); - if (event_obj._length === 1) { + var timediff = Math.abs(event_obj['end_date'] - event_obj['start_date']); + if (timediff <= 24*60*60*1000) { // If it spans one day or less event_obj['end_date'] = new Date(event_obj['start_date']); event_obj['end_date'].addHours(1); } else { From 3cc3ab62526610cdc849073fcb812882ea58d0be Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Mon, 20 Apr 2015 13:52:06 -0400 Subject: [PATCH 04/15] [FIX] document: polynomial time reordering of document ids Triggered every time on list views as the list view uses a search_count (filtered but unlimited) to display pagination. closes #6397 --- addons/document/document.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index df12431df7a..56324c6c462 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -110,8 +110,11 @@ class document_file(osv.osv): ids.extend(parents[parent_id]) # sort result according to the original sort ordering - ids = [id for id in orig_ids if id in ids] - return len(ids) if count else ids + if count: + return len(ids) + else: + set_ids = set(ids) + return [id for id in orig_ids if id in set_ids] def copy(self, cr, uid, id, default=None, context=None): if not default: From ecdaf89469654214ae07aa447fde14a591f5d9a6 Mon Sep 17 00:00:00 2001 From: Rifakat Haradwala Date: Wed, 29 Oct 2014 15:47:23 +0530 Subject: [PATCH 05/15] [FIX] membership: shown customer invoice form instead of supplier When somebody buys a membership, he is a customer, opw 615986 --- addons/membership/membership_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml index ffcbe1bae37..96552f9b850 100644 --- a/addons/membership/membership_view.xml +++ b/addons/membership/membership_view.xml @@ -259,7 +259,7 @@ - + From cb5f00f58016d087cf5387c3eadf9144f45a0397 Mon Sep 17 00:00:00 2001 From: dhr-odoo Date: Fri, 31 Oct 2014 14:18:35 +0530 Subject: [PATCH 06/15] [FIX] orm: ordering on >1000 records When reading over IN_MAX (currently 1000) records, the select is slip into subsets of IN_MAX records. However the list of ids was split using set() method which removes order that may have been pass. The subsets are ordered using _order attribute but the subsets were not ordered between themself. This is an issue in case of browsing a o2m field with more than 1000 lines as it will return sorted blocked but the order of the blocks is the order of the contained ids (e.g. split(2, [5, 4, 3, 2, 1]) -> [[2,1], [4,3], [5]]). Removes the set() to make sure the order of the given ids is preserved. opw 616070, linked to #439 --- openerp/sql_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/sql_db.py b/openerp/sql_db.py index 39c87049fb0..8571b3ba08f 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -255,7 +255,7 @@ class Cursor(object): def split_for_in_conditions(self, ids): """Split a list of identifiers into one or more smaller tuples safe for IN conditions, after uniquifying them.""" - return tools.misc.split_every(self.IN_MAX, set(ids)) + return tools.misc.split_every(self.IN_MAX, ids) def print_log(self): global sql_counter From ab65c388cdab762db0185463c66b2b291c2a8e24 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 23 Apr 2015 09:54:50 +0200 Subject: [PATCH 07/15] [FIX] crm: list of meetings from opportunity When opening the list of meetings from an opportunity, show only the meetings linked to the current opportunity. Use search_default_ to be able to remove the filter if not needed. Remove context on meeting button as it's ignored in action_makeMeeting (and there is no field attendee_id linked to a crm.lead anyway) opw 614039 --- addons/crm/crm_lead.py | 1 + addons/crm/crm_lead_view.xml | 3 +-- addons/crm/crm_meeting_menu.xml | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 5d238b9a26c..e272eca1d2f 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -930,6 +930,7 @@ class crm_lead(base_stage, format_address, osv.osv): opportunity = self.browse(cr, uid, ids[0], context) res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'base_calendar', 'action_crm_meeting', context) res['context'] = { + 'search_default_opportunity_id': opportunity.id, 'default_opportunity_id': opportunity.id, 'default_partner_id': opportunity.partner_id and opportunity.partner_id.id or False, 'default_partner_ids' : opportunity.partner_id and [opportunity.partner_id.id] or False, diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index e0311d1db40..651735b432a 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -392,8 +392,7 @@ type="action"/>