From 3f7d168130aff5f9018aca8f21bf00ae78a8f7f8 Mon Sep 17 00:00:00 2001 From: rmu-odoo Date: Fri, 30 Jan 2015 15:05:07 +0530 Subject: [PATCH 1/6] [FIX] sotck: correctly set reference on internal move When creating a chained picking, the first move has no sequence, this is because there is no sequence for stock.picking.internal. Set the sequence before the chained move so that the sequences are in the right order. opw 621261 --- addons/stock/stock.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 998109635bc..5cd1b4f510a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2061,17 +2061,20 @@ class stock_move(osv.osv): for todo in moves_by_type.values(): ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0]) if picking: + # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order + old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id) + if old_ptype != picking.type: + if old_ptype == 'internal': + old_pick_name = seq_obj.get(cr, uid, 'stock.picking') + else: + old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype) + self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context) # name of new picking according to its type if ptype == 'internal': new_pick_name = seq_obj.get(cr, uid,'stock.picking') else : new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype) pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context) - # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order - old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id) - if old_ptype != picking.type: - old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype) - self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context) else: pickid = False for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo: From 51774f2a4569f4df672718e0c32f0023253d5fde Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 15 Apr 2015 16:00:44 +0200 Subject: [PATCH 2/6] [FIX] mrp_repair: missiing taxes field in invoicing tab. Taxes can be applied on the repair fees. The field was defined in the model, it was just missing in the view. In addition, the product_id_change worked already for the taxes. opw-632898 --- addons/mrp_repair/mrp_repair_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index b7a667ce308..48692400422 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -164,6 +164,7 @@ + From 5fb717a971888e105db22cbe54eb4eac49f34764 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 15 Apr 2015 16:53:35 +0200 Subject: [PATCH 3/6] [FIX] account: display name field in supplier refunds The name field contains the refund reason. The reason is filled when you create the refund from the refund wizard available when pressing "Ask Refund" on a supplier invoice. As this field wasn't visibile on the supplier invoice form, this wasn't possible to change the reason on draft supplier refunds after having created them through the wizard, while you could change your mind or having done a silly mistake in the wizard, that you could edit since the invoice is stil draft. This was also not possible to set a reason when creating the refunds without going through by the wizard. This was also not possible to change the reason when you duplicated your supplier refunds. opw-632756 closes #6301 --- addons/account/account_invoice_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 1106bd532d9..19919e53877 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -253,7 +253,7 @@ - + From 884864c40fd6faa242a4bde3f055d0be59a9da12 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 15 Apr 2015 16:31:29 +0200 Subject: [PATCH 4/6] [FIX] account: do not show empty partners in manual reconciliation When doing a manual reconciliation, the current filter could restrict the visibility of move lines and show empty results for some partners (e.g. filter the lists on only one partner will show empty list of moves for other partners). This is also the case for multicompany restrictions. Integrate the current filter to the search to only get results for displayed lines. Fixes #3817, opw 618134 Fixes #5221, opw 632095 --- addons/account/account_move_line.py | 10 ++++++++-- .../static/src/js/account_move_reconciliation.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 9287ed239c4..6dacf1a2816 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -741,7 +741,11 @@ class account_move_line(osv.osv): args.append(('partner_id', '=', partner[0])) return super(account_move_line, self).search(cr, uid, args, offset, limit, order, context, count) - def list_partners_to_reconcile(self, cr, uid, context=None): + def list_partners_to_reconcile(self, cr, uid, context=None, filter_domain=False): + line_ids = [] + if filter_domain: + line_ids = self.search(cr, uid, filter_domain, context=context) + where_clause = filter_domain and "AND l.id = ANY(%s)" or "" cr.execute( """SELECT partner_id FROM ( SELECT l.partner_id, p.last_reconciliation_date, SUM(l.debit) AS debit, SUM(l.credit) AS credit, MAX(l.create_date) AS max_date @@ -751,10 +755,12 @@ class account_move_line(osv.osv): WHERE a.reconcile IS TRUE AND l.reconcile_id IS NULL AND l.state <> 'draft' + %s GROUP BY l.partner_id, p.last_reconciliation_date ) AS s WHERE debit > 0 AND credit > 0 AND (last_reconciliation_date IS NULL OR max_date > last_reconciliation_date) - ORDER BY last_reconciliation_date""") + ORDER BY last_reconciliation_date""" + % where_clause, (line_ids,)) ids = [x[0] for x in cr.fetchall()] if not ids: return [] diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index cbc0abc4f4d..1629a16f5b3 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -49,7 +49,7 @@ openerp.account = function (instance) { this.last_group_by = group_by; this.old_search = _.bind(this._super, this); var mod = new instance.web.Model("account.move.line", context, domain); - return mod.call("list_partners_to_reconcile", []).then(function(result) { + return mod.call("list_partners_to_reconcile", [context, domain]).then(function(result) { var current = self.current_partner !== null ? self.partners[self.current_partner][0] : null; self.partners = result; var index = _.find(_.range(self.partners.length), function(el) { From cd94f10e1dccec0fc17df61992f785514fe2204e Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Thu, 16 Apr 2015 14:12:05 +0200 Subject: [PATCH 5/6] [FIX] base: fixed display of address in IE11 Spiritual backport of 5de677208c8db5589f20727d987b729dc9545976 which should have been fixed in 7.0 back then. --- openerp/addons/base/res/res_partner_view.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index 2f442479434..09473c47de9 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -155,10 +155,12 @@