diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-03-04 08:24:08 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-03-27 08:27:08 +0000 |
| commit | 3eeedd29616682919215f4bdb75690a7d793635e (patch) | |
| tree | 36654248791c678cdc6eca5224712334a5d8fe2e | |
| parent | 1bfd21b6dc39dade9b4cd9bbfa2881044aedb082 (diff) | |
[FIX] test_mail: test for conflicting partner_id on subscribe
From opw-2200219 opw-2210285 (v12)
Use case (2200219):
- Install CRM, sales and Automated Action
- Create the automated action
* Model -> Sale Order
* Trigger Condition -> On creation
* Action To Do -> Add followers
* Add Channels -> sales
- Create a new CRM opportunity with a partner set, Save
- Click on the "New quotation"
- Save
A Traceback "Error: A follower must be either a partner or
a channel (but not both)." will popup, blocking the user from
completing the action.
Use case (2210285):
After adding a channel as a follower to a sales team it is not
possible to create a sale order from a contact or opportunity. You can
only create a sale order from the sales app in that case.
End of use cases-----
This occur because the context flag default_partner_id is used by
the model to override the empty partner_id which should remain empty
Fixed in v12, forwarding the test for v13 and upward
closes odoo/odoo#48476
X-original-commit: 049aa5c2297938bcd378d1dee1aa766a646cb461
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/test_mail/tests/test_mail_followers.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_mail_followers.py b/addons/test_mail/tests/test_mail_followers.py index 1e1597334d5..9b9682d3b13 100644 --- a/addons/test_mail/tests/test_mail_followers.py +++ b/addons/test_mail/tests/test_mail_followers.py @@ -117,6 +117,16 @@ class BaseFollowersTest(TestMailCommon): 'channel_id': self.channel_listen.id, }) + def test_followers_default_partner_context(self): + """Test that a follower partner_id is not taken from context + when channel id is also defined. + """ + test_record = self.test_record.with_user(self.user_employee) + test_record.with_context(default_partner_id=1).message_subscribe( + partner_ids=[self.user_employee.partner_id.id, self.user_admin.partner_id.id], + channel_ids=[self.channel_listen.id] + ) + class AdvancedFollowersTest(TestMailCommon): @classmethod |
