diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-05-23 10:56:31 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-05-23 13:35:03 +0000 |
| commit | 345a5a4aa816c146a30fe0bd07446eb9ee351a45 (patch) | |
| tree | 8a3fe6248507f1d1ab67ec0d4530c5f322fec8ec /addons/website_crm_partner_assign/tests | |
| parent | 0c50fb516c3556b2ac0d2fabe804feaa7f0cd227 (diff) | |
[FIX] crm: set the email_from from the kanban quick create
When setting the partner of a lead, on the form view the email_from
is automatically populated by the onchange on the partner_id.
This is not the case when created programmatically,
and this is not even the case when created from the kanban view.
This can lead to an unexpected failure to send emails down the line.
We apply the onchange in the create to fill all values consistently in all cases.
In case the values were already set, this simply won't change anything.
Note that we need to adapt the test from website_crm_partner_assign.
It uses demo data that makes little sense.
The opportunity crm.crm_case_21 is set in the UK,
with a partner base.res_partner_4 in the US, in the state Escuintla of Guatemala.
With the change from above, all the address fields on the opportunity are
populated by the onchange, from the partner.
opw 2000241
closes odoo/odoo#33622
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/website_crm_partner_assign/tests')
| -rw-r--r-- | addons/website_crm_partner_assign/tests/test_partner_assign.py | 15 |
1 files changed, 14 insertions, 1 deletions
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 137cd773c33..4bab904b3b8 100644 --- a/addons/website_crm_partner_assign/tests/test_partner_assign.py +++ b/addons/website_crm_partner_assign/tests/test_partner_assign.py @@ -16,6 +16,19 @@ class TestPartnerAssign(TransactionCase): def setUp(self): super(TestPartnerAssign, self).setUp() + self.customer_uk = self.env['res.partner'].create({ + 'name': 'Nigel', + 'country_id': self.env.ref('base.uk').id, + 'city': 'Birmingham', + 'zip': 'B46 3AG', + 'street': 'Cannon Hill Park', + }) + self.lead_uk = self.env['crm.lead'].create({ + 'type': 'opportunity', + 'name': 'Office Design and Architecture', + 'partner_id': self.customer_uk.id + }) + def geo_find(addr, apikey): return { 'Wavre, Belgium': (50.7158956, 4.6128075), @@ -51,7 +64,7 @@ class TestPartnerAssign(TransactionCase): "partner_weight": 10, }) - lead = self.env.ref('crm.crm_case_21') + lead = self.lead_uk # In order to test find nearest Partner functionality and assign to opportunity, # I Set Geo Lattitude and Longitude according to partner address. |
