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

CRM Phonecall: convert opportunit useless code #362

Closed
voronind opened this issue Oct 27, 2020 · 6 comments · Fixed by #425
Closed

CRM Phonecall: convert opportunit useless code #362

voronind opened this issue Oct 27, 2020 · 6 comments · Fixed by #425
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.

Comments

@voronind
Copy link

In crm_phonecall module there is code in models/crm_phonecall.py that do nothing. v10-13

    @api.multi
    def convert_opportunity(self, opportunity_summary=False, partner_id=False,
                            planned_revenue=0.0, probability=0.0):
        partner = self.env['res.partner']
        # ...
        default_contact = False
        for call in self:
            if not partner_id:
                partner_id = call.partner_id.id or False
            if partner_id:
                address_id = partner.address_get().get('contact', False)
                # We need this here?
                # address_id = partner.browse(partner_id).address_get().get('contact', False)
                if address_id:
                    default_contact = address_id.id
                    # We need this here?
                    # default_contact = partner.browse(address_id) here?
            # using default_contact
@pedrobaeza
Copy link
Member

Why do you say it's doing nothing?

@voronind
Copy link
Author

Why do you say it's doing nothing?

partner.address_get() always returns {'contact': False}. default_contact is always False.

@pedrobaeza
Copy link
Member

I don't think so. It depends on your contacts data.

@voronind
Copy link
Author

voronind commented Oct 28, 2020 via email

@pedrobaeza
Copy link
Member

OK, then do a PR changing the code to make sense.

@github-actions
Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants