Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.0][MIG] crm_lead_to_event_registration module #68

Merged
merged 3 commits into from
Mar 24, 2017

Conversation

cubells
Copy link
Sponsor Member

@cubells cubells commented Jan 10, 2017

  • Updated views
  • Updated Readme

cc @Tecnativa

pedrobaeza and others added 2 commits January 9, 2017 22:57
* [ADD] crm_lead_to_event_registration

====================================
Register a lead directly in an event
====================================

This module allows to register a lead directly in an event when converting
this lead into a partner, so that you can save several steps.

Usage
=====

Go to any lead in *Sales > Sales > Leads*, and click on the button "Convert
to Opportunity".

In the resulting screen, if the conversion action is "Convert to opportunity"
and you have selected a related partner (a new or an existing one), you will
have a section called "Event registration".

In that section, you can select an event, and when you click on
"Create opportunity", the partner will be registered automatically in the
event.

* [IMP] crm_lead_to_event_registration: Track state changes

* [IMP] crm_lead_to_event_registration: Adapt to latest company changes
- Updated views
- Updated Readme
class WizardModel(models.TransientModel):
_name = "crm.lead.event.pick"

lead_id = fields.Many2one(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test this wizard.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

name = (s.contact_name or
s.partner_name or
s.partner_id.name)
if not name:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put here # pragma: no cover and this is not critical to test

def action_check_status_confirm_registration(self):
"""If the opportunity is won/lost, open/cancel registration."""
for s in self:
if self._track_subtype(['stage_id']) == "crm.mt_lead_won":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test this and change it if XML-IDs have changed.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done tests.

def action_apply(self):
res = super(CrmLead2OpportunityPartner, self).action_apply()
self.ensure_one()
if not self.event_id:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put event_id as required and you can remove this.

@cubells cubells force-pushed the 9.0-mig-crm_lead_to_event_registration branch from 7e125b0 to be88a6c Compare January 17, 2017 22:31
Copy link
Member

@luismontalba luismontalba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality tested on runbot

@pedrobaeza pedrobaeza merged commit 18278a6 into OCA:9.0 Mar 24, 2017
@pedrobaeza pedrobaeza deleted the 9.0-mig-crm_lead_to_event_registration branch March 24, 2017 09:37
@pedrobaeza pedrobaeza mentioned this pull request Mar 24, 2017
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants