From 36af222569738ef72cc15397a2d9d4b00dda09f3 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 16 Dec 2014 15:50:43 +0100 Subject: [PATCH 1/4] [FIX] crm_partner_assign: more precise geolocation Google api geolocation service returns a precise latitude and longitude, greater or equal than 5 digits The precision is important as storing 2 digits instead of 5 can lead to an inaccuracy of allmost half a mile. --- addons/crm_partner_assign/crm_partner_assign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm_partner_assign/crm_partner_assign.py b/addons/crm_partner_assign/crm_partner_assign.py index 3e3795eb653..0cbdd6929d7 100644 --- a/addons/crm_partner_assign/crm_partner_assign.py +++ b/addons/crm_partner_assign/crm_partner_assign.py @@ -85,8 +85,8 @@ class res_partner_activation(osv.osv): class res_partner(osv.osv): _inherit = "res.partner" _columns = { - 'partner_latitude': fields.float('Geo Latitude'), - 'partner_longitude': fields.float('Geo Longitude'), + 'partner_latitude': fields.float('Geo Latitude', digits=(16, 5)), + 'partner_longitude': fields.float('Geo Longitude', digits=(16, 5)), 'date_localization': fields.date('Geo Localization Date'), 'partner_weight': fields.integer('Weight', help="Gives the probability to assign a lead to this partner. (0 means no assignation.)"), From ba70393bc4170f421952bb6d42cb909c79211350 Mon Sep 17 00:00:00 2001 From: Somesh Khare Date: Wed, 17 Dec 2014 11:25:58 +0530 Subject: [PATCH 2/4] [FIX] account: prevent selecting company's contacts for manual account.move.line Only the commercial partner (parent company) should be set in partner field of an account.move.line. Fixes #4261, opw 618763 --- addons/account/account_view.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 2716e39cd80..e942df0b56e 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -995,7 +995,9 @@ - + @@ -1068,7 +1070,9 @@ - + @@ -1112,7 +1116,9 @@ - + @@ -1289,7 +1295,9 @@ - + @@ -1353,7 +1361,9 @@ - + From 998db2c61f157afe0cd750fda970fde60f4aa2b5 Mon Sep 17 00:00:00 2001 From: Gaurav Panchal Date: Tue, 16 Dec 2014 18:13:13 +0530 Subject: [PATCH 3/4] [FIX]stock: return of 'To Be Invoiced' picking should also be invoiced When creating a return picking, the default invoice state is 'To Be Invoiced' if returned picking was invoiced. However if the invoice of the picking has not been generated yet (state '2binvoiced'), the return should also be invoiced. Fixes #4002 --- addons/stock/wizard/stock_return_picking.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py index 8e30fc01bd8..46d523d7546 100644 --- a/addons/stock/wizard/stock_return_picking.py +++ b/addons/stock/wizard/stock_return_picking.py @@ -69,10 +69,10 @@ class stock_return_picking(osv.osv_memory): pick = pick_obj.browse(cr, uid, record_id, context=context) if pick: if 'invoice_state' in fields: - if pick.invoice_state=='invoiced': - res.update({'invoice_state': '2binvoiced'}) + if pick.invoice_state in ['invoiced','2binvoiced']: + res['invoice_state'] = '2binvoiced' else: - res.update({'invoice_state': 'none'}) + res['invoice_state'] = 'none' return_history = self.get_return_history(cr, uid, record_id, context) for line in pick.move_lines: qty = line.product_qty - return_history.get(line.id, 0) From 43cf6d51d2b4ccd98dc02c1221bf4b51871f92fe Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 17 Dec 2014 13:57:34 +0100 Subject: [PATCH 4/4] [FIX] account: aged partner balance, advance partial payment Partners totals were not correct if the partner paid partially an invoice in advance For an invoice of 20.000 in the future, with a payment made in advance of 5000 The column not due must contains 20.000, as the amount is not yet due One of the column 1-30, 30-60, ... (accordingly on when the payment was made). must contains -5000 The total should be 15.000 --- addons/account/report/account_aged_partner_balance.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index b2887bc0de2..57498f8a66d 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -188,9 +188,12 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): partial = date and date[0][0] <= form[str(i)]['stop'] if partial: # partial reconcilation + limit_date = 'COALESCE(l.date_maturity,l.date) %s %%s' % '<=' if self.direction_selection == 'past' else '>=' self.cr.execute('''SELECT SUM(l.debit-l.credit) FROM account_move_line AS l, account_move AS am - WHERE l.move_id = am.id AND am.state in %s AND l.reconcile_partial_id = %s''', (tuple(move_state), partner_info[2],)) + WHERE l.move_id = am.id AND am.state in %s + AND l.reconcile_partial_id = %s + AND ''' + limit_date, (tuple(move_state), partner_info[2], self.date_from)) unreconciled_amount = self.cr.fetchall() partners_amount[partner_info[0]] += unreconciled_amount[0][0] else: