[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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user