summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-01 23:11:27 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-01 23:11:27 +0200
commit8d89148d1323b29fb97452ede3233e92b4a361e1 (patch)
tree59bf7ede03ab7fe34747834913fed31ec42c6c1d /addons
parent597d172ff0eacc4c038c50fe46e5a0f301e126f0 (diff)
parent5e19f28bfc3d60249a61b3955c3d4ebbcaa48c88 (diff)
[MERGE] forward port branch saas-15 up to 5e19f28bfc3
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_invoice.py2
-rw-r--r--addons/website_crm_partner_assign/tests/test_partner_assign.py19
2 files changed, 20 insertions, 1 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index 59371686f1a..dceb556547d 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -951,7 +951,7 @@ class AccountInvoice(models.Model):
return {
'date_maturity': line.get('date_maturity', False),
'partner_id': part,
- 'name': line['name'][:64],
+ 'name': line['name'],
'debit': line['price'] > 0 and line['price'],
'credit': line['price'] < 0 and -line['price'],
'account_id': line['account_id'],
diff --git a/addons/website_crm_partner_assign/tests/test_partner_assign.py b/addons/website_crm_partner_assign/tests/test_partner_assign.py
index 2efdfc76d0b..9d1689b3286 100644
--- a/addons/website_crm_partner_assign/tests/test_partner_assign.py
+++ b/addons/website_crm_partner_assign/tests/test_partner_assign.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from mock import patch
from odoo.exceptions import AccessError
from odoo.tests.common import TransactionCase
@@ -9,6 +10,24 @@ from odoo.addons.crm.tests.common import TestCrmCases
class TestPartnerAssign(TransactionCase):
+ def setUp(self):
+ super(TestPartnerAssign, self).setUp()
+
+ def geo_find(addr):
+ return {
+ 'Wavre, Belgium': (50.7158956, 4.6128075),
+ 'Cannon Hill Park, B46 3AG Birmingham, United Kingdom': (52.45216, -1.898578),
+ }.get(addr)
+
+ patcher = patch('odoo.addons.base_geolocalize.models.res_partner.geo_find', wraps=geo_find)
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
+ patcher = patch('odoo.addons.website_crm_partner_assign.models.crm_lead.geo_find',
+ wraps=geo_find)
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
def test_partner_assign(self):
""" Test the automatic assignation using geolocalisation """
partner2 = self.env.ref('base.res_partner_2')